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

Unified Diff: net/http/http_stream_factory_impl_request.cc

Issue 7289006: Basic HTTP pipelining support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge Created 9 years, 2 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/http/http_stream_factory_impl_request.h ('k') | net/http/http_stream_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_stream_factory_impl_request.cc
diff --git a/net/http/http_stream_factory_impl_request.cc b/net/http/http_stream_factory_impl_request.cc
index 801638ae99f5c4081ce1575b035b9c0933accf72..17c717e00b29967f69854253930b345ad1ef5ebd 100644
--- a/net/http/http_stream_factory_impl_request.cc
+++ b/net/http/http_stream_factory_impl_request.cc
@@ -40,9 +40,10 @@ HttpStreamFactoryImpl::Request::~Request() {
for (std::set<Job*>::iterator it = jobs_.begin(); it != jobs_.end(); ++it)
factory_->request_map_.erase(*it);
- STLDeleteElements(&jobs_);
-
RemoveRequestFromSpdySessionRequestMap();
+ RemoveRequestFromHttpPipeliningRequestMap();
+
+ STLDeleteElements(&jobs_);
}
void HttpStreamFactoryImpl::Request::SetSpdySessionKey(
@@ -55,6 +56,16 @@ void HttpStreamFactoryImpl::Request::SetSpdySessionKey(
request_set.insert(this);
}
+void HttpStreamFactoryImpl::Request::SetHttpPipeliningKey(
+ const HostPortPair& http_pipelining_key) {
+ DCHECK(!http_pipelining_key_.get());
+ http_pipelining_key_.reset(new HostPortPair(http_pipelining_key));
+ RequestSet& request_set =
+ factory_->http_pipelining_request_map_[http_pipelining_key];
+ DCHECK(!ContainsKey(request_set, this));
+ request_set.insert(this);
+}
+
void HttpStreamFactoryImpl::Request::AttachJob(Job* job) {
DCHECK(job);
jobs_.insert(job);
@@ -84,7 +95,8 @@ void HttpStreamFactoryImpl::Request::OnStreamReady(
DCHECK(completed_);
// |job| should only be NULL if we're being serviced by a late bound
- // SpdySession (one that was not created by a job in our |jobs_| set).
+ // SpdySession or HttpPipelinedConnection (one that was not created by a job
+ // in our |jobs_| set).
if (!job) {
DCHECK(!bound_job_.get());
DCHECK(!jobs_.empty());
@@ -225,6 +237,22 @@ HttpStreamFactoryImpl::Request::RemoveRequestFromSpdySessionRequestMap() {
}
}
+void
+HttpStreamFactoryImpl::Request::RemoveRequestFromHttpPipeliningRequestMap() {
+ if (http_pipelining_key_.get()) {
+ HttpPipeliningRequestMap& http_pipelining_request_map =
+ factory_->http_pipelining_request_map_;
+ DCHECK(ContainsKey(http_pipelining_request_map, *http_pipelining_key_));
+ RequestSet& request_set =
+ http_pipelining_request_map[*http_pipelining_key_];
+ DCHECK(ContainsKey(request_set, this));
+ request_set.erase(this);
+ if (request_set.empty())
+ http_pipelining_request_map.erase(*http_pipelining_key_);
+ http_pipelining_key_.reset();
+ }
+}
+
void HttpStreamFactoryImpl::Request::OnSpdySessionReady(
Job* job,
scoped_refptr<SpdySession> spdy_session,
@@ -278,6 +306,7 @@ void HttpStreamFactoryImpl::Request::OrphanJobsExcept(Job* job) {
void HttpStreamFactoryImpl::Request::OrphanJobs() {
RemoveRequestFromSpdySessionRequestMap();
+ RemoveRequestFromHttpPipeliningRequestMap();
std::set<Job*> tmp;
tmp.swap(jobs_);
« no previous file with comments | « net/http/http_stream_factory_impl_request.h ('k') | net/http/http_stream_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698