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

Unified Diff: net/http/http_stream_factory_impl_request.cc

Issue 9567025: Ensure pipelined requests are sent in the same order they're queued. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 10 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 451b15903c6d939989fa802140106929aec2fafd..424104d471c58701465688027121370b35eac93e 100644
--- a/net/http/http_stream_factory_impl_request.cc
+++ b/net/http/http_stream_factory_impl_request.cc
@@ -63,10 +63,9 @@ bool HttpStreamFactoryImpl::Request::SetHttpPipeliningKey(
http_pipelining_key_.reset(new HttpPipelinedHost::Key(http_pipelining_key));
bool was_new_key = !ContainsKey(factory_->http_pipelining_request_map_,
http_pipelining_key);
- RequestSet& request_set =
+ RequestVector& request_vector =
factory_->http_pipelining_request_map_[http_pipelining_key];
- DCHECK(!ContainsKey(request_set, this));
- request_set.insert(this);
+ request_vector.push_back(this);
return was_new_key;
}
@@ -267,11 +266,16 @@ HttpStreamFactoryImpl::Request::RemoveRequestFromHttpPipeliningRequestMap() {
HttpPipeliningRequestMap& http_pipelining_request_map =
factory_->http_pipelining_request_map_;
DCHECK(ContainsKey(http_pipelining_request_map, *http_pipelining_key_));
- RequestSet& request_set =
+ RequestVector& request_vector =
http_pipelining_request_map[*http_pipelining_key_];
- DCHECK(ContainsKey(request_set, this));
- request_set.erase(this);
- if (request_set.empty())
+ for (RequestVector::iterator it = request_vector.begin();
+ it != request_vector.end(); ++it) {
+ if (*it == this) {
+ request_vector.erase(it);
+ break;
+ }
+ }
+ if (request_vector.empty())
http_pipelining_request_map.erase(*http_pipelining_key_);
http_pipelining_key_.reset();
}

Powered by Google App Engine
This is Rietveld 408576698