summaryrefslogtreecommitdiffstats
path: root/net/spdy/spdy_session_pool.h
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-28 23:55:46 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-28 23:55:46 +0000
commite3ceb68c8b7176d838a071abdb028a652fa9570d (patch)
tree72b7ce9d23670aaac5c3cd449618712768d0595d /net/spdy/spdy_session_pool.h
parent37ebcd63f367449cadde58365bc840aec9ae1a9e (diff)
downloadchromium_src-e3ceb68c8b7176d838a071abdb028a652fa9570d.zip
chromium_src-e3ceb68c8b7176d838a071abdb028a652fa9570d.tar.gz
chromium_src-e3ceb68c8b7176d838a071abdb028a652fa9570d.tar.bz2
Speculative fix for bug 80095.
Based off previous CHECKs added, it appears that SpdySessionPool::HasSession() may return true, but later on, may return false. I hypothesize that this is because of HostCache entries expiring in between calls to HasSession(). The solution is not to use HasSession(), but instead just call a new SpdySessionPool::GetIfExists() function. If we acquire it, then cache it in a member variable of HttpStreamFactoryImpl::Job. BUG=80095 TEST=New tests in HttpNetworkTransactionTest. Because it's timing related, it's hard to come up with a solid repro case. Review URL: http://codereview.chromium.org/7260014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90886 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy/spdy_session_pool.h')
-rw-r--r--net/spdy/spdy_session_pool.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/net/spdy/spdy_session_pool.h b/net/spdy/spdy_session_pool.h
index 0fd1a17..4ef8c47 100644
--- a/net/spdy/spdy_session_pool.h
+++ b/net/spdy/spdy_session_pool.h
@@ -50,6 +50,11 @@ class NET_API SpdySessionPool
const HostPortProxyPair& host_port_proxy_pair,
const BoundNetLog& net_log);
+ // Only returns a SpdySession if it already exists.
+ scoped_refptr<SpdySession> GetIfExists(
+ const HostPortProxyPair& host_port_proxy_pair,
+ const BoundNetLog& net_log);
+
// Set the maximum concurrent sessions per domain.
static void set_max_sessions_per_domain(int max) {
if (max >= 1)
@@ -75,7 +80,10 @@ class NET_API SpdySessionPool
bool is_secure);
// TODO(willchan): Consider renaming to HasReusableSession, since perhaps we
- // should be creating a new session.
+ // should be creating a new session. WARNING: Because of IP connection pooling
+ // using the HostCache, if HasSession() returns true at one point, it does not
+ // imply the SpdySessionPool will still have a matching session in the near
+ // future, since the HostCache's entry may have expired.
bool HasSession(const HostPortProxyPair& host_port_proxy_pair) const;
// Close all SpdySessions, including any new ones created in the process of
@@ -128,6 +136,11 @@ class NET_API SpdySessionPool
typedef std::map<HostPortProxyPair, SpdySessionList*> SpdySessionsMap;
typedef std::map<IPEndPoint, HostPortProxyPair> SpdyAliasMap;
+
+ scoped_refptr<SpdySession> GetInternal(
+ const HostPortProxyPair& host_port_proxy_pair,
+ const BoundNetLog& net_log,
+ bool only_use_existing_sessions);
scoped_refptr<SpdySession> GetExistingSession(
SpdySessionList* list,
const BoundNetLog& net_log) const;