diff options
author | mmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-12 20:32:44 +0000 |
---|---|---|
committer | mmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-12 20:32:44 +0000 |
commit | 1ce7b66b8e871fb39633e8dc7547a649f6d60b53 (patch) | |
tree | ef72863fccd02a85a6ae864372bf75ba57d71f9b /net/spdy | |
parent | 0834a4b75e40256a08e4a0b1bacab2e8b69da665 (diff) | |
download | chromium_src-1ce7b66b8e871fb39633e8dc7547a649f6d60b53.zip chromium_src-1ce7b66b8e871fb39633e8dc7547a649f6d60b53.tar.gz chromium_src-1ce7b66b8e871fb39633e8dc7547a649f6d60b53.tar.bz2 |
Render SpdySessionPools on the Data tab and on a new
net-internals tab, with links to the corresponding sources on
the events tab.
Includes a minor cleanup or two relating to unneeded/unused code/headers for the rendering of SocketPools.
BUG=58034
TEST=manual
Review URL: http://codereview.chromium.org/3565015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62329 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy')
-rw-r--r-- | net/spdy/spdy_session.cc | 30 | ||||
-rw-r--r-- | net/spdy/spdy_session.h | 4 | ||||
-rw-r--r-- | net/spdy/spdy_session_pool.cc | 16 | ||||
-rw-r--r-- | net/spdy/spdy_session_pool.h | 4 |
4 files changed, 54 insertions, 0 deletions
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc index a360c52..d0ebff9 100644 --- a/net/spdy/spdy_session.cc +++ b/net/spdy/spdy_session.cc @@ -839,6 +839,36 @@ void SpdySession::CloseSessionOnError(net::Error err, bool remove_from_pool) { } } +Value* SpdySession::GetInfoAsValue() const { + DictionaryValue* dict = new DictionaryValue(); + + dict->SetInteger("source_id", net_log_.source().id); + + dict->SetString("host_port_pair", host_port_proxy_pair_.first.ToString()); + dict->SetString("proxy", host_port_proxy_pair_.second.ToURI()); + + dict->SetInteger("active_streams", active_streams_.size()); + + dict->SetInteger("unclaimed_pushed_streams", + unclaimed_pushed_streams_.size()); + + dict->SetBoolean("is_secure", is_secure_); + + dict->SetInteger("error", error_); + dict->SetInteger("max_concurrent_streams", max_concurrent_streams_); + + dict->SetInteger("streams_initiated_count", streams_initiated_count_); + dict->SetInteger("streams_pushed_count", streams_pushed_count_); + dict->SetInteger("streams_pushed_and_claimed_count", + streams_pushed_and_claimed_count_); + dict->SetInteger("streams_abandoned_count", streams_abandoned_count_); + dict->SetInteger("frames_received", frames_received_); + + dict->SetBoolean("sent_settings", sent_settings_); + dict->SetBoolean("received_settings", received_settings_); + return dict; +} + void SpdySession::ActivateStream(SpdyStream* stream) { const spdy::SpdyStreamId id = stream->stream_id(); DCHECK(!IsStreamActive(id)); diff --git a/net/spdy/spdy_session.h b/net/spdy/spdy_session.h index de5f0e2..f90907d 100644 --- a/net/spdy/spdy_session.h +++ b/net/spdy/spdy_session.h @@ -155,6 +155,10 @@ class SpdySession : public base::RefCounted<SpdySession>, // session pool. void CloseSessionOnError(net::Error err, bool remove_from_pool); + // Retrieves information on the current state of the SPDY session as a + // Value. Caller takes possession of the returned value. + Value* GetInfoAsValue() const; + // Indicates whether the session is being reused after having successfully // used to send/receive data in the past. bool IsReused() const { diff --git a/net/spdy/spdy_session_pool.cc b/net/spdy/spdy_session_pool.cc index 086fa9f..fe2a310 100644 --- a/net/spdy/spdy_session_pool.cc +++ b/net/spdy/spdy_session_pool.cc @@ -5,6 +5,7 @@ #include "net/spdy/spdy_session_pool.h" #include "base/logging.h" +#include "base/values.h" #include "net/http/http_network_session.h" #include "net/spdy/spdy_session.h" @@ -109,6 +110,21 @@ void SpdySessionPool::Remove(const scoped_refptr<SpdySession>& session) { RemoveSessionList(session->host_port_proxy_pair()); } +Value* SpdySessionPool::SpdySessionPoolInfoToValue() { + ListValue* list = new ListValue(); + + SpdySessionsMap::const_iterator spdy_session_pool_it = sessions_.begin(); + for (SpdySessionsMap::const_iterator it = sessions_.begin(); + it != sessions_.end(); it++) { + SpdySessionList* sessions = it->second; + for (SpdySessionList::const_iterator session = sessions->begin(); + session != sessions->end(); session++) { + list->Append(session->get()->GetInfoAsValue()); + } + } + return list; +} + void SpdySessionPool::OnIPAddressChanged() { CloseCurrentSessions(); } diff --git a/net/spdy/spdy_session_pool.h b/net/spdy/spdy_session_pool.h index 49f9e45..6b346f6 100644 --- a/net/spdy/spdy_session_pool.h +++ b/net/spdy/spdy_session_pool.h @@ -88,6 +88,10 @@ class SpdySessionPool // by SpdySession, because otherwise session->state_ is not set to CLOSED. void Remove(const scoped_refptr<SpdySession>& session); + // Creates a Value summary of the state of the spdy session pool. The caller + // responsible for deleting the returned value. + Value* SpdySessionPoolInfoToValue(); + // NetworkChangeNotifier::Observer methods: // We flush all idle sessions and release references to the active ones so |