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

Unified Diff: net/http/http_stream_factory_impl.cc

Issue 9433015: Add a force pipelining option to load flags. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merge 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
« no previous file with comments | « net/http/http_stream_factory_impl.h ('k') | net/http/http_stream_factory_impl_job.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_stream_factory_impl.cc
diff --git a/net/http/http_stream_factory_impl.cc b/net/http/http_stream_factory_impl.cc
index 3eb067a6e30c0efb92f899fedb1faf6dc349c7d5..1236787a824c199e681f8883b6dcb51711cc0dc8 100644
--- a/net/http/http_stream_factory_impl.cc
+++ b/net/http/http_stream_factory_impl.cc
@@ -38,7 +38,8 @@ GURL UpgradeUrlToHttps(const GURL& original_url, int port) {
HttpStreamFactoryImpl::HttpStreamFactoryImpl(HttpNetworkSession* session)
: session_(session),
http_pipelined_host_pool_(this, NULL,
- session_->http_server_properties()) {}
+ session_->http_server_properties(),
+ session_->force_http_pipelining()) {}
HttpStreamFactoryImpl::~HttpStreamFactoryImpl() {
DCHECK(request_map_.empty());
@@ -232,12 +233,16 @@ void HttpStreamFactoryImpl::OnPreconnectsComplete(const Job* job) {
}
void HttpStreamFactoryImpl::OnHttpPipelinedHostHasAdditionalCapacity(
- const HostPortPair& origin) {
- HttpPipelinedStream* stream;
- while (ContainsKey(http_pipelining_request_map_, origin) &&
- (stream = http_pipelined_host_pool_.CreateStreamOnExistingPipeline(
- origin))) {
- Request* request = *http_pipelining_request_map_[origin].begin();
+ HttpPipelinedHost* host) {
+ while (ContainsKey(http_pipelining_request_map_, host->GetKey())) {
+ HttpPipelinedStream* stream =
+ http_pipelined_host_pool_.CreateStreamOnExistingPipeline(
+ host->GetKey());
+ if (!stream) {
+ break;
+ }
+
+ Request* request = *http_pipelining_request_map_[host->GetKey()].begin();
request->Complete(stream->was_npn_negotiated(),
stream->protocol_negotiated(),
false, // not using_spdy
@@ -249,4 +254,16 @@ void HttpStreamFactoryImpl::OnHttpPipelinedHostHasAdditionalCapacity(
}
}
+void HttpStreamFactoryImpl::AbortPipelinedRequestsWithKey(
+ const Job* job, const HttpPipelinedHost::Key& key, int status,
+ const SSLConfig& used_ssl_config) {
+ RequestSet requests_to_fail = http_pipelining_request_map_[key];
+ requests_to_fail.erase(request_map_[job]);
+ for (RequestSet::const_iterator it = requests_to_fail.begin();
+ it != requests_to_fail.end(); ++it) {
+ Request* request = *it;
+ request->OnStreamFailed(NULL, status, used_ssl_config);
+ }
+}
+
} // namespace net
« no previous file with comments | « net/http/http_stream_factory_impl.h ('k') | net/http/http_stream_factory_impl_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698