diff options
author | jgraettinger@chromium.org <jgraettinger@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-21 20:11:19 +0000 |
---|---|---|
committer | jgraettinger@chromium.org <jgraettinger@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-21 20:11:19 +0000 |
commit | 6d61cacf9f59918234cf3421309b31bb07cf0688 (patch) | |
tree | db67fc6a4c7c618dfa2ad2ec7d53714d3f94d9f3 | |
parent | 61850458d6ffefc848213e4db74aecc1257b6373 (diff) | |
download | chromium_src-6d61cacf9f59918234cf3421309b31bb07cf0688.zip chromium_src-6d61cacf9f59918234cf3421309b31bb07cf0688.tar.gz chromium_src-6d61cacf9f59918234cf3421309b31bb07cf0688.tar.bz2 |
Merge 278366 "Avoid setting a duplicate SpdySessionKey on a Request"
> Avoid setting a duplicate SpdySessionKey on a Request
>
> BUG=364365
>
> Review URL: https://codereview.chromium.org/344603004
TBR=rch@chromium.org
Review URL: https://codereview.chromium.org/401353002
git-svn-id: svn://svn.chromium.org/chrome/branches/1985/src@284494 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | net/http/http_stream_factory_impl_job.cc | 3 | ||||
-rw-r--r-- | net/http/http_stream_factory_impl_request.cc | 6 | ||||
-rw-r--r-- | net/http/http_stream_factory_impl_request.h | 1 |
3 files changed, 8 insertions, 2 deletions
diff --git a/net/http/http_stream_factory_impl_job.cc b/net/http/http_stream_factory_impl_job.cc index 3fad3d1..ad79ec4 100644 --- a/net/http/http_stream_factory_impl_job.cc +++ b/net/http/http_stream_factory_impl_job.cc @@ -779,7 +779,8 @@ int HttpStreamFactoryImpl::Job::DoInitConnection() { next_state_ = STATE_CREATE_STREAM; existing_spdy_session_ = spdy_session; return OK; - } else if (request_ && (using_ssl_ || ShouldForceSpdyWithoutSSL())) { + } else if (request_ && !request_->HasSpdySessionKey() && + (using_ssl_ || ShouldForceSpdyWithoutSSL())) { // Update the spdy session key for the request that launched this job. request_->SetSpdySessionKey(spdy_session_key); } else if (IsRequestEligibleForPipelining()) { diff --git a/net/http/http_stream_factory_impl_request.cc b/net/http/http_stream_factory_impl_request.cc index 1eb8e51..e28b032 100644 --- a/net/http/http_stream_factory_impl_request.cc +++ b/net/http/http_stream_factory_impl_request.cc @@ -55,7 +55,7 @@ HttpStreamFactoryImpl::Request::~Request() { void HttpStreamFactoryImpl::Request::SetSpdySessionKey( const SpdySessionKey& spdy_session_key) { - DCHECK(!spdy_session_key_.get()); + CHECK(!spdy_session_key_.get()); spdy_session_key_.reset(new SpdySessionKey(spdy_session_key)); RequestSet& request_set = factory_->spdy_session_request_map_[spdy_session_key]; @@ -289,6 +289,10 @@ HttpStreamFactoryImpl::Request::RemoveRequestFromHttpPipeliningRequestMap() { } } +bool HttpStreamFactoryImpl::Request::HasSpdySessionKey() const { + return spdy_session_key_.get() != NULL; +} + void HttpStreamFactoryImpl::Request::OnNewSpdySessionReady( Job* job, scoped_ptr<HttpStream> stream, diff --git a/net/http/http_stream_factory_impl_request.h b/net/http/http_stream_factory_impl_request.h index 22c8ff2..3d1295d 100644 --- a/net/http/http_stream_factory_impl_request.h +++ b/net/http/http_stream_factory_impl_request.h @@ -37,6 +37,7 @@ class HttpStreamFactoryImpl::Request : public HttpStreamRequest { // for this SpdySessionKey, since we may need to wait for NPN to complete // before knowing if SPDY is available. void SetSpdySessionKey(const SpdySessionKey& spdy_session_key); + bool HasSpdySessionKey() const; // Called when the Job determines the appropriate |http_pipelining_key| for // the Request. Registers this Request with the factory, so that if an |