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

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: Added about:flags entry Created 9 years, 5 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
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 d8bb09fde99a51735e847cdf814286f9f30b04d2..e3fd31d8d6e23ad7f41832ce8f02f61910680ec8 100644
--- a/net/http/http_stream_factory_impl_request.cc
+++ b/net/http/http_stream_factory_impl_request.cc
@@ -43,6 +43,7 @@ HttpStreamFactoryImpl::Request::~Request() {
STLDeleteElements(&jobs_);
RemoveRequestFromSpdySessionRequestMap();
+ RemoveRequestFromHttpPipeliningRequestMap();
}
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);
@@ -225,6 +236,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 +305,7 @@ void HttpStreamFactoryImpl::Request::OrphanJobsExcept(Job* job) {
void HttpStreamFactoryImpl::Request::OrphanJobs() {
RemoveRequestFromSpdySessionRequestMap();
+ RemoveRequestFromHttpPipeliningRequestMap();
std::set<Job*> tmp;
tmp.swap(jobs_);

Powered by Google App Engine
This is Rietveld 408576698