diff options
-rw-r--r-- | chrome/browser/dom_ui/net_internals_ui.cc | 1 | ||||
-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 | ||||
-rw-r--r-- | net/base/net_log.h | 1 | ||||
-rw-r--r-- | net/base/net_log_event_type_list.h | 35 | ||||
-rw-r--r-- | net/spdy/spdy_session.cc | 57 | ||||
-rw-r--r-- | net/spdy/spdy_session.h | 2 | ||||
-rw-r--r-- | net/spdy/spdy_session_pool.cc | 4 |
9 files changed, 11 insertions, 170 deletions
diff --git a/chrome/browser/dom_ui/net_internals_ui.cc b/chrome/browser/dom_ui/net_internals_ui.cc index 9b55d0e..c643af2 100644 --- a/chrome/browser/dom_ui/net_internals_ui.cc +++ b/chrome/browser/dom_ui/net_internals_ui.cc @@ -523,7 +523,6 @@ void NetInternalsMessageHandler::IOThreadImpl::OnRendererReady( net::NetLog::SOURCE_INIT_PROXY_RESOLVER); dict->SetInteger(L"CONNECT_JOB", net::NetLog::SOURCE_CONNECT_JOB); dict->SetInteger(L"SOCKET", net::NetLog::SOURCE_SOCKET); - dict->SetInteger(L"SPDY_SESSION", net::NetLog::SOURCE_SPDY_SESSION); CallJavascriptFunction(L"g_browser.receivedLogSourceTypeConstants", dict); } 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()); -} diff --git a/net/base/net_log.h b/net/base/net_log.h index 02f0a4b..9270d78 100644 --- a/net/base/net_log.h +++ b/net/base/net_log.h @@ -59,7 +59,6 @@ class NetLog { SOURCE_INIT_PROXY_RESOLVER, SOURCE_CONNECT_JOB, SOURCE_SOCKET, - SOURCE_SPDY_SESSION, }; // Identifies the entity that generated this log. The |id| field should diff --git a/net/base/net_log_event_type_list.h b/net/base/net_log_event_type_list.h index 7ae2a69..7a75f26 100644 --- a/net/base/net_log_event_type_list.h +++ b/net/base/net_log_event_type_list.h @@ -366,34 +366,6 @@ EVENT_TYPE(SPDY_TRANSACTION_READ_HEADERS) EVENT_TYPE(SPDY_TRANSACTION_READ_BODY) // ------------------------------------------------------------------------ -// SpdySession -// ------------------------------------------------------------------------ - -// The start/end of a SpdySession. -EVENT_TYPE(SPDY_SESSION) - -// On sending a SPDY SETTINGS frame. -// The following parameters are attached: -// { -// "settings": <The list of setting id:value pairs> -// } -EVENT_TYPE(SPDY_SESSION_SEND_SETTINGS) - -// Receipt of a SPDY SETTINGS frame. -// The following parameters are attached: -// { -// "settings": <The list of setting id:value pairs> -// } -EVENT_TYPE(SPDY_SESSION_RECV_SETTINGS) - -// Receipt of a SPDY GOAWAY frame. -// The following parameters are attached: -// { -// "last_accepted_stream_id": <Last stream id accepted by the server, duh> -// } -EVENT_TYPE(SPDY_SESSION_GOAWAY) - -// ------------------------------------------------------------------------ // SpdyStream // ------------------------------------------------------------------------ @@ -430,13 +402,6 @@ EVENT_TYPE(SPDY_STREAM_READ_BODY) // Logs that a stream attached to a pushed stream. EVENT_TYPE(SPDY_STREAM_ADOPTED_PUSH_STREAM) -// The receipt of a RST_STREAM -// The following parameters are attached: -// { -// "status": <The reason for the RST_STREAM> -// } -EVENT_TYPE(SPDY_STREAM_RST_STREAM) - // ------------------------------------------------------------------------ // HttpStreamParser // ------------------------------------------------------------------------ diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc index de3042d..4208d06 100644 --- a/net/spdy/spdy_session.cc +++ b/net/spdy/spdy_session.cc @@ -213,31 +213,6 @@ class NetLogSpdySynParameter : public NetLog::EventParameters { DISALLOW_COPY_AND_ASSIGN(NetLogSpdySynParameter); }; -class NetLogSpdySettingsParameter : public NetLog::EventParameters { - public: - explicit NetLogSpdySettingsParameter(const spdy::SpdySettings& settings) - : settings_(settings) {} - - Value* ToValue() const { - DictionaryValue* dict = new DictionaryValue(); - ListValue* settings = new ListValue(); - for (spdy::SpdySettings::const_iterator it = settings_.begin(); - it != settings_.end(); ++it) { - settings->Append(new StringValue( - StringPrintf("[%u:%u]", it->first.id(), it->second))); - } - dict->Set(L"settings", settings); - return dict; - } - - private: - ~NetLogSpdySettingsParameter() {} - - const spdy::SpdySettings settings_; - - DISALLOW_COPY_AND_ASSIGN(NetLogSpdySettingsParameter); -}; - } // namespace // static @@ -245,7 +220,7 @@ bool SpdySession::use_ssl_ = true; SpdySession::SpdySession(const HostPortPair& host_port_pair, HttpNetworkSession* session, - NetLog* net_log) + const BoundNetLog& net_log) : ALLOW_THIS_IN_INITIALIZER_LIST( connect_callback_(this, &SpdySession::OnTCPConnect)), ALLOW_THIS_IN_INITIALIZER_LIST( @@ -270,11 +245,7 @@ SpdySession::SpdySession(const HostPortPair& host_port_pair, streams_pushed_and_claimed_count_(0), streams_abandoned_count_(0), in_session_pool_(true), - net_log_(BoundNetLog::Make(net_log, NetLog::SOURCE_SPDY_SESSION)) { - net_log_.BeginEvent( - NetLog::TYPE_SPDY_SESSION, - new NetLogStringParameter("host_port", host_port_pair_.ToString())); - + net_log_(net_log) { // TODO(mbelshe): consider randomization of the stream_hi_water_mark. spdy_framer_.set_visitor(this); @@ -306,8 +277,6 @@ SpdySession::~SpdySession() { UMA_HISTOGRAM_CUSTOM_COUNTS("Net.SpdyStreamsAbandonedPerSession", streams_abandoned_count_, 0, 300, 50); - - net_log_.EndEvent(NetLog::TYPE_SPDY_SESSION, NULL); } void SpdySession::InitializeWithSSLSocket(ClientSocketHandle* connection) { @@ -551,6 +520,7 @@ void SpdySession::OnTCPConnect(int result) { socket, "" /* request_->url.HostNoBrackets() */ , ssl_config_); connection_->set_socket(socket); is_secure_ = true; + // TODO(willchan): Plumb NetLog into SPDY code. int status = connection_->socket()->Connect(&ssl_connect_callback_); if (status != ERR_IO_PENDING) OnSSLConnect(status); @@ -1180,12 +1150,6 @@ void SpdySession::OnFin(const spdy::SpdyRstStreamControlFrame& frame) { scoped_refptr<SpdyStream> stream = active_streams_[stream_id]; CHECK_EQ(stream->stream_id(), stream_id); CHECK(!stream->cancelled()); - - const BoundNetLog& log = stream->net_log(); - log.AddEvent( - NetLog::TYPE_SPDY_STREAM_RST_STREAM, - new NetLogIntegerParameter("status", frame.status())); - if (frame.status() == 0) { stream->OnDataReceived(NULL, 0); } else { @@ -1201,13 +1165,6 @@ void SpdySession::OnFin(const spdy::SpdyRstStreamControlFrame& frame) { void SpdySession::OnGoAway(const spdy::SpdyGoAwayControlFrame& frame) { LOG(INFO) << "Spdy GOAWAY for session[" << this << "] for " << host_port_pair().ToString(); - - net_log_.AddEvent( - NetLog::TYPE_SPDY_SESSION_GOAWAY, - new NetLogIntegerParameter( - "last_accepted_stream_id", - frame.last_accepted_stream_id())); - RemoveFromPool(); // TODO(willchan): Cancel any streams that are past the GoAway frame's @@ -1224,10 +1181,6 @@ void SpdySession::OnSettings(const spdy::SpdySettingsControlFrame& frame) { SpdySettingsStorage* settings_storage = session_->mutable_spdy_settings(); settings_storage->Set(host_port_pair_, settings); } - - net_log_.AddEvent( - NetLog::TYPE_SPDY_SESSION_RECV_SETTINGS, - new NetLogSpdySettingsParameter(settings)); } void SpdySession::SendSettings() { @@ -1236,10 +1189,6 @@ void SpdySession::SendSettings() { if (settings.empty()) return; - net_log_.AddEvent( - NetLog::TYPE_SPDY_SESSION_SEND_SETTINGS, - new NetLogSpdySettingsParameter(settings)); - // Create the SETTINGS frame and send it. scoped_ptr<spdy::SpdySettingsControlFrame> settings_frame( spdy_framer_.CreateSettings(settings)); diff --git a/net/spdy/spdy_session.h b/net/spdy/spdy_session.h index 8ef8759..8ef2da0 100644 --- a/net/spdy/spdy_session.h +++ b/net/spdy/spdy_session.h @@ -46,7 +46,7 @@ class SpdySession : public base::RefCounted<SpdySession>, // |session| is the HttpNetworkSession. |net_log| is the NetLog that we log // network events to. SpdySession(const HostPortPair& host_port_pair, HttpNetworkSession* session, - NetLog* net_log); + const BoundNetLog& net_log); const HostPortPair& host_port_pair() const { return host_port_pair_; } diff --git a/net/spdy/spdy_session_pool.cc b/net/spdy/spdy_session_pool.cc index cd505a8..af397c7 100644 --- a/net/spdy/spdy_session_pool.cc +++ b/net/spdy/spdy_session_pool.cc @@ -35,7 +35,7 @@ scoped_refptr<SpdySession> SpdySessionPool::Get( DCHECK(list); if (!spdy_session) - spdy_session = new SpdySession(host_port_pair, session, net_log.net_log()); + spdy_session = new SpdySession(host_port_pair, session, net_log); DCHECK(spdy_session); list->push_back(spdy_session); @@ -53,7 +53,7 @@ scoped_refptr<SpdySession> SpdySessionPool::GetSpdySessionFromSSLSocket( list = AddSessionList(host_port_pair); DCHECK(list->empty()); scoped_refptr<SpdySession> spdy_session( - new SpdySession(host_port_pair, session, net_log.net_log())); + new SpdySession(host_port_pair, session, net_log)); spdy_session->InitializeWithSSLSocket(connection); list->push_back(spdy_session); return spdy_session; |