diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-15 00:28:32 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-15 00:28:32 +0000 |
commit | bd33ed7ac21b7c7fbee5b716092092434f62a469 (patch) | |
tree | 1af624ab76b385dc77ae16aa0607ab3f96fe660b /chrome/browser/net | |
parent | 47b3b473b847a92005065094524a33bbdb8d134f (diff) | |
download | chromium_src-bd33ed7ac21b7c7fbee5b716092092434f62a469.zip chromium_src-bd33ed7ac21b7c7fbee5b716092092434f62a469.tar.gz chromium_src-bd33ed7ac21b7c7fbee5b716092092434f62a469.tar.bz2 |
Revert 47342 - Support SpdySession as a new NetLog source type. Start logging some more SPDY control frames.
BUG=43237
Review URL: http://codereview.chromium.org/2102003
TBR=willchan@chromium.org
Review URL: http://codereview.chromium.org/2118003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47343 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net')
-rw-r--r-- | chrome/browser/net/passive_log_collector.cc | 22 | ||||
-rw-r--r-- | chrome/browser/net/passive_log_collector.h | 27 | ||||
-rw-r--r-- | chrome/browser/net/passive_log_collector_unittest.cc | 32 |
3 files changed, 5 insertions, 76 deletions
diff --git a/chrome/browser/net/passive_log_collector.cc b/chrome/browser/net/passive_log_collector.cc index 5417c1d..1192965 100644 --- a/chrome/browser/net/passive_log_collector.cc +++ b/chrome/browser/net/passive_log_collector.cc @@ -133,7 +133,6 @@ void PassiveLogCollector::GetAllCapturedEvents(EntryList* out) const { // |out|. socket_stream_tracker_.AppendAllEntries(out); url_request_tracker_.AppendAllEntries(out); - spdy_session_tracker_.AppendAllEntries(out); const EntryList& proxy_entries = init_proxy_resolver_tracker_.entries(); @@ -557,24 +556,3 @@ void PassiveLogCollector::InitProxyResolverTracker::OnAddEntry( entries_.clear(); } -//---------------------------------------------------------------------------- -// SpdySessionTracker -//---------------------------------------------------------------------------- - -const size_t PassiveLogCollector::SpdySessionTracker::kMaxGraveyardSize = 10; - -PassiveLogCollector::SpdySessionTracker::SpdySessionTracker() - : RequestTrackerBase(kMaxGraveyardSize) { -} - -PassiveLogCollector::RequestTrackerBase::Action -PassiveLogCollector::SpdySessionTracker::DoAddEntry(const Entry& entry, - RequestInfo* out_info) { - if (entry.type == net::NetLog::TYPE_SPDY_SESSION && - entry.phase == net::NetLog::PHASE_END) { - return ACTION_MOVE_TO_GRAVEYARD; - } else { - AddEntryToRequestInfo(entry, is_unbounded(), out_info); - return ACTION_NONE; - } -} diff --git a/chrome/browser/net/passive_log_collector.h b/chrome/browser/net/passive_log_collector.h index 207b45b..e67b27b 100644 --- a/chrome/browser/net/passive_log_collector.h +++ b/chrome/browser/net/passive_log_collector.h @@ -96,6 +96,10 @@ class PassiveLogCollector : public ChromeNetLog::Observer { ACTION_MOVE_TO_GRAVEYARD, }; + // Updates |out_info| with the information from |entry|. Returns an action + // to perform for this map entry on completion. + virtual Action DoAddEntry(const Entry& entry, RequestInfo* out_info) = 0; + // Finds a request, either in the live entries or the graveyard and returns // it. RequestInfo* GetRequestInfo(uint32 id); @@ -108,10 +112,6 @@ class PassiveLogCollector : public ChromeNetLog::Observer { private: typedef base::hash_map<uint32, RequestInfo> SourceIDToInfoMap; - // Updates |out_info| with the information from |entry|. Returns an action - // to perform for this map entry on completion. - virtual Action DoAddEntry(const Entry& entry, RequestInfo* out_info) = 0; - void RemoveFromLiveRequests(uint32 source_id); void InsertIntoGraveyard(const RequestInfo& info); @@ -197,20 +197,6 @@ class PassiveLogCollector : public ChromeNetLog::Observer { DISALLOW_COPY_AND_ASSIGN(InitProxyResolverTracker); }; - // Tracks the log entries for the last seen SOURCE_SPDY_SESSION. - class SpdySessionTracker : public RequestTrackerBase { - public: - static const size_t kMaxGraveyardSize; - - SpdySessionTracker(); - - protected: - virtual Action DoAddEntry(const Entry& entry, RequestInfo* out_info); - - private: - DISALLOW_COPY_AND_ASSIGN(SpdySessionTracker); - }; - PassiveLogCollector(); ~PassiveLogCollector(); @@ -236,10 +222,6 @@ class PassiveLogCollector : public ChromeNetLog::Observer { return &init_proxy_resolver_tracker_; } - SpdySessionTracker* spdy_session_tracker() { - return &spdy_session_tracker_; - } - // Fills |out| with the full list of events that have been passively // captured. The list is ordered by capture time. void GetAllCapturedEvents(EntryList* out) const; @@ -253,7 +235,6 @@ class PassiveLogCollector : public ChromeNetLog::Observer { RequestTracker url_request_tracker_; RequestTracker socket_stream_tracker_; InitProxyResolverTracker init_proxy_resolver_tracker_; - SpdySessionTracker spdy_session_tracker_; // The count of how many events have flowed through this log. Used to set the // "order" field on captured events. diff --git a/chrome/browser/net/passive_log_collector_unittest.cc b/chrome/browser/net/passive_log_collector_unittest.cc index 0e86210..e7e2f2e 100644 --- a/chrome/browser/net/passive_log_collector_unittest.cc +++ b/chrome/browser/net/passive_log_collector_unittest.cc @@ -14,7 +14,7 @@ namespace { typedef PassiveLogCollector::RequestTracker RequestTracker; typedef PassiveLogCollector::RequestInfoList RequestInfoList; -using net::NetLog; +typedef net::NetLog NetLog; const NetLog::SourceType kSourceType = NetLog::SOURCE_NONE; @@ -959,33 +959,3 @@ TEST(PassiveLogCollectorTest, AccumulateRxTxData) { EXPECT_EQ(6u, requests[0].entries.size()); EXPECT_EQ(6u, requests[1].entries.size()); } - -TEST(SpdySessionTracker, MovesToGraveyard) { - PassiveLogCollector::SpdySessionTracker tracker; - EXPECT_EQ(0u, tracker.GetLiveRequests().size()); - EXPECT_EQ(0u, tracker.GetRecentlyDeceased().size()); - - PassiveLogCollector::Entry begin( - 0u, - NetLog::TYPE_SPDY_SESSION, - base::TimeTicks(), - NetLog::Source(NetLog::SOURCE_SPDY_SESSION, 1), - NetLog::PHASE_BEGIN, - NULL); - - tracker.OnAddEntry(begin); - EXPECT_EQ(1u, tracker.GetLiveRequests().size()); - EXPECT_EQ(0u, tracker.GetRecentlyDeceased().size()); - - PassiveLogCollector::Entry end( - 0u, - NetLog::TYPE_SPDY_SESSION, - base::TimeTicks(), - NetLog::Source(NetLog::SOURCE_SPDY_SESSION, 1), - NetLog::PHASE_END, - NULL); - - tracker.OnAddEntry(end); - EXPECT_EQ(0u, tracker.GetLiveRequests().size()); - EXPECT_EQ(1u, tracker.GetRecentlyDeceased().size()); -} |