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/spdy/spdy_session_pool.cc | |
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/spdy/spdy_session_pool.cc')
-rw-r--r-- | net/spdy/spdy_session_pool.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/net/spdy/spdy_session_pool.cc b/net/spdy/spdy_session_pool.cc index d90a1d5..7bac3bc 100644 --- a/net/spdy/spdy_session_pool.cc +++ b/net/spdy/spdy_session_pool.cc @@ -413,4 +413,20 @@ void SpdySessionPool::CloseCurrentSessions() { DCHECK(aliases_.empty()); } +void SpdySessionPool::CloseIdleSessions() { + SpdySessionsMap::const_iterator map_it = sessions_.begin(); + while (map_it != sessions_.end()) { + SpdySessionList* list = map_it->second; + ++map_it; + CHECK(list); + + // Assumes there is only 1 element in the list + SpdySessionList::iterator session_it = list->begin(); + const scoped_refptr<SpdySession>& session = *session_it; + CHECK(session); + if (!session->is_active()) + session->CloseSessionOnError(net::ERR_ABORTED, true); + } +} + } // namespace net |