Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(279)

Unified Diff: net/spdy/spdy_session_pool.cc

Issue 2756503002: Allow SpdySessionPool to find/create SpdySession with IP pooling disabled. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/spdy/spdy_session_pool.h ('k') | net/spdy/spdy_session_pool_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_session_pool.cc
diff --git a/net/spdy/spdy_session_pool.cc b/net/spdy/spdy_session_pool.cc
index 308a80b1e7175cefa941b7c3f2b4a7f55df6f586..7850b4f564159466573c99a8681577476354afc2 100644
--- a/net/spdy/spdy_session_pool.cc
+++ b/net/spdy/spdy_session_pool.cc
@@ -130,6 +130,7 @@ base::WeakPtr<SpdySession> SpdySessionPool::CreateAvailableSessionFromSocket(
base::WeakPtr<SpdySession> SpdySessionPool::FindAvailableSession(
const SpdySessionKey& key,
const GURL& url,
+ bool enable_ip_based_pooling,
const NetLogWithSource& net_log) {
UnclaimedPushedStreamMap::iterator url_it =
unclaimed_pushed_streams_.find(url);
@@ -169,6 +170,16 @@ base::WeakPtr<SpdySession> SpdySessionPool::FindAvailableSession(
NetLogEventType::HTTP2_SESSION_POOL_FOUND_EXISTING_SESSION,
it->second->net_log().source().ToEventParametersCallback());
} else {
+ if (!enable_ip_based_pooling) {
+ // Remove session from available sessions and from aliases, and remove
+ // key from the session's pooled alias set, so that a new session can be
+ // created with this |key|.
+ it->second->RemovePooledAlias(key);
+ UnmapKey(key);
+ RemoveAliases(key);
+ return base::WeakPtr<SpdySession>();
+ }
+
UMA_HISTOGRAM_ENUMERATION("Net.SpdySessionGet",
FOUND_EXISTING_FROM_IP_POOL,
SPDY_SESSION_GET_MAX);
@@ -180,6 +191,9 @@ base::WeakPtr<SpdySession> SpdySessionPool::FindAvailableSession(
return it->second;
}
+ if (!enable_ip_based_pooling)
+ return base::WeakPtr<SpdySession>();
+
// Look up IP addresses from resolver cache.
HostResolver::RequestInfo resolve_info(key.host_port_pair());
AddressList addresses;
« no previous file with comments | « net/spdy/spdy_session_pool.h ('k') | net/spdy/spdy_session_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698