diff options
author | kristianm@chromium.org <kristianm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-08 04:22:28 +0000 |
---|---|---|
committer | kristianm@chromium.org <kristianm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-08 04:22:28 +0000 |
commit | 4a3315aa161157d999188daed1d276f49c3867bc (patch) | |
tree | 056a75deef784f5df3e3d6eb28d3a5bf6a8e20e1 /net/http | |
parent | 83f366259f43e3a11b1dfff40df768dadef6b6f8 (diff) | |
download | chromium_src-4a3315aa161157d999188daed1d276f49c3867bc.zip chromium_src-4a3315aa161157d999188daed1d276f49c3867bc.tar.gz chromium_src-4a3315aa161157d999188daed1d276f49c3867bc.tar.bz2 |
Exposing CloseIdleConnections in HttpCache, and close idle spdy sessions
Adding CloseIdleSessions to SPDY, use it when closing idle
sessions in HttpNetworkSession.
Expose CloseIdleConnections to HttpCache so it can be use
when from clients of the HttpCache.
BUG=None
TEST=None
Review URL: http://codereview.chromium.org/7380004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100100 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http')
-rw-r--r-- | net/http/http_cache.cc | 8 | ||||
-rw-r--r-- | net/http/http_cache.h | 3 | ||||
-rw-r--r-- | net/http/http_network_session.cc | 1 |
3 files changed, 12 insertions, 0 deletions
diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc index 589777d..738a539 100644 --- a/net/http/http_cache.cc +++ b/net/http/http_cache.cc @@ -465,6 +465,14 @@ void HttpCache::CloseAllConnections() { HttpNetworkSession* session = network->GetSession(); if (session) session->CloseAllConnections(); + } + +void HttpCache::CloseIdleConnections() { + net::HttpNetworkLayer* network = + static_cast<net::HttpNetworkLayer*>(network_layer_.get()); + HttpNetworkSession* session = network->GetSession(); + if (session) + session->CloseIdleConnections(); } void HttpCache::OnExternalCacheHit(const GURL& url, diff --git a/net/http/http_cache.h b/net/http/http_cache.h index 5e29701..e9f0e11 100644 --- a/net/http/http_cache.h +++ b/net/http/http_cache.h @@ -181,6 +181,9 @@ class NET_EXPORT HttpCache : public HttpTransactionFactory, // immediately, but they will not be reusable. This is for debugging. void CloseAllConnections(); + // Close all idle connections. Will close all sockets not in active use. + void CloseIdleConnections(); + // Called whenever an external cache in the system reuses the resource // referred to by |url| and |http_method|. void OnExternalCacheHit(const GURL& url, const std::string& http_method); diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc index b52aa107..b5a104d 100644 --- a/net/http/http_network_session.cc +++ b/net/http/http_network_session.cc @@ -94,6 +94,7 @@ void HttpNetworkSession::CloseAllConnections() { void HttpNetworkSession::CloseIdleConnections() { socket_pool_manager_.CloseIdleSockets(); + spdy_session_pool_.CloseIdleSessions(); } } // namespace net |