Fix SpdySessionPool to take a host port pair instead of just the host.
BUG=28595
Review URL: http://codereview.chromium.org/660107
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40077 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index 0f66188e..5e770d3 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -678,9 +678,11 @@
resolve_info.set_allow_cached_response(false);
}
+ HostPortPair host_port_pair(host, port);
+
// Check first if we have a spdy session for this group. If so, then go
// straight to using that.
- if (session_->spdy_session_pool()->HasSession(resolve_info)) {
+ if (session_->spdy_session_pool()->HasSession(host_port_pair)) {
using_spdy_ = true;
return OK;
}
@@ -1130,21 +1132,20 @@
// if one already exists, then screw it, use the existing one! Otherwise,
// use the existing TCP socket.
- HostResolver::RequestInfo req_info(request_->url.HostNoBrackets(),
- request_->url.EffectiveIntPort());
- req_info.set_priority(request_->priority);
+ HostPortPair host_port_pair(request_->url.HostNoBrackets(),
+ request_->url.EffectiveIntPort());
const scoped_refptr<SpdySessionPool> spdy_pool =
session_->spdy_session_pool();
scoped_refptr<SpdySession> spdy_session;
- if (spdy_pool->HasSession(req_info)) {
- spdy_session = spdy_pool->Get(req_info, session_);
+ if (spdy_pool->HasSession(host_port_pair)) {
+ spdy_session = spdy_pool->Get(host_port_pair, session_);
} else {
// SPDY is negotiated using the TLS next protocol negotiation (NPN)
// extension, so |connection_| must contain an SSLClientSocket.
DCHECK(using_ssl_);
spdy_session = spdy_pool->GetSpdySessionFromSSLSocket(
- req_info, session_, connection_.release());
+ host_port_pair, session_, connection_.release());
}
CHECK(spdy_session.get());