summaryrefslogtreecommitdiffstats
path: root/net/http/http_network_session.cc
diff options
context:
space:
mode:
authormmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-30 16:44:27 +0000
committermmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-30 16:44:27 +0000
commit59d7a5ac32804bb1b12a2d5b8d21dede3f7be233 (patch)
tree25e69facf864a46c61a5466b7c9fa061a4417abe /net/http/http_network_session.cc
parentb9a3dc3b7b9c1cb60a7aa05f38a568612e5224cb (diff)
downloadchromium_src-59d7a5ac32804bb1b12a2d5b8d21dede3f7be233.zip
chromium_src-59d7a5ac32804bb1b12a2d5b8d21dede3f7be233.tar.gz
chromium_src-59d7a5ac32804bb1b12a2d5b8d21dede3f7be233.tar.bz2
Sockets page on net-internals now displays some information about the current socket pool state. Table padding slightly increased for legibility.
TEST=manual BUG=39756 Review URL: http://codereview.chromium.org/3267002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57869 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_network_session.cc')
-rw-r--r--net/http/http_network_session.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc
index 93340ef..718d2cd 100644
--- a/net/http/http_network_session.cc
+++ b/net/http/http_network_session.cc
@@ -30,6 +30,18 @@ int g_max_sockets_per_group = 6;
// http://crbug.com/44501 for details about proxy server connection limits.
int g_max_sockets_per_proxy_server = 32;
+// Appends information about all |socket_pools| to the end of |list|.
+template <class MapType>
+static void AddSocketPoolsToList(ListValue* list,
+ const MapType& socket_pools,
+ const std::string& type) {
+ typename MapType::const_iterator socket_pool_it = socket_pools.begin();
+ for (typename MapType::const_iterator it = socket_pools.begin();
+ it != socket_pools.end(); it++) {
+ list->Append(it->second->GetInfoAsValue(it->first.ToString(), type));
+ }
+}
+
} // namespace
// TODO(mbelshe): Move the socket factories into HttpStreamFactory.
@@ -153,6 +165,24 @@ HttpNetworkSession::GetSocketPoolForSSLWithProxy(
return ret.first->second;
}
+Value* HttpNetworkSession::SocketPoolInfoToValue() const {
+ ListValue* list = new ListValue();
+ list->Append(tcp_socket_pool_->GetInfoAsValue("tcp_socket_pool",
+ "tcp_socket_pool"));
+ list->Append(ssl_socket_pool_->GetInfoAsValue("ssl_socket_pool",
+ "ssl_socket_pool"));
+ AddSocketPoolsToList(list,
+ http_proxy_socket_pools_,
+ "http_proxy_socket_pool");
+ AddSocketPoolsToList(list,
+ socks_socket_pools_,
+ "proxy_socket_pool");
+ AddSocketPoolsToList(list,
+ ssl_socket_pools_for_proxies_,
+ "ssl_socket_pool_for_proxies");
+ return list;
+}
+
// static
int HttpNetworkSession::max_sockets_per_group() {
return g_max_sockets_per_group;