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

Unified Diff: net/http/http_stream_factory_impl_job.cc

Issue 10095024: Refuse to pipeline frames, prefetches, and downloads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add unit test Created 8 years, 8 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_pipelined_network_transaction_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_stream_factory_impl_job.cc
diff --git a/net/http/http_stream_factory_impl_job.cc b/net/http/http_stream_factory_impl_job.cc
index 408c75e718070fbcaf72ae9c5a4176c69703c39d..28532ddc038ea2c9f12901295a172258009c6e49 100644
--- a/net/http/http_stream_factory_impl_job.cc
+++ b/net/http/http_stream_factory_impl_job.cc
@@ -902,7 +902,6 @@ int HttpStreamFactoryImpl::Job::DoCreateStream() {
if (!using_spdy_) {
bool using_proxy = (proxy_info_.is_http() || proxy_info_.is_https()) &&
request_info_.url.SchemeIs("http");
- // TODO(simonjam): Support proxies.
if (stream_factory_->http_pipelined_host_pool_.
IsExistingPipelineAvailableForKey(*http_pipelining_key_.get())) {
stream_.reset(stream_factory_->http_pipelined_host_pool_.
@@ -910,6 +909,7 @@ int HttpStreamFactoryImpl::Job::DoCreateStream() {
*http_pipelining_key_.get()));
CHECK(stream_.get());
} else if (!using_proxy && IsRequestEligibleForPipelining()) {
+ // TODO(simonjam): Support proxies.
stream_.reset(
stream_factory_->http_pipelined_host_pool_.CreateStreamOnNewPipeline(
*http_pipelining_key_.get(),
@@ -1246,6 +1246,12 @@ bool HttpStreamFactoryImpl::Job::IsRequestEligibleForPipelining() {
if (request_info_.method != "GET" && request_info_.method != "HEAD") {
return false;
}
+ if (request_info_.load_flags &
+ (net::LOAD_MAIN_FRAME | net::LOAD_SUB_FRAME | net::LOAD_PREFETCH |
+ net::LOAD_IS_DOWNLOAD)) {
+ // Avoid pipelining resources that may be streamed for a long time.
+ return false;
+ }
return stream_factory_->http_pipelined_host_pool_.IsKeyEligibleForPipelining(
*http_pipelining_key_.get());
}
« no previous file with comments | « net/http/http_pipelined_network_transaction_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698