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

Unified Diff: net/http/http_stream_factory_impl.cc

Issue 1502453003: QUIC - Disable Preconnect when QUIC can be spoken to a server with 0RTT (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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.cc
diff --git a/net/http/http_stream_factory_impl.cc b/net/http/http_stream_factory_impl.cc
index 4d32ffcf207320ddfbf65bf5787c98d33770be37..f3ab8bcbc85cb0c4be204c41b2a5e31774e52a20 100644
--- a/net/http/http_stream_factory_impl.cc
+++ b/net/http/http_stream_factory_impl.cc
@@ -133,6 +133,12 @@ void HttpStreamFactoryImpl::PreconnectStreams(
if (!alternative_service_vector.empty()) {
// TODO(bnc): Pass on multiple alternative services to Job.
alternative_service = alternative_service_vector[0];
+ if (session_->params().disable_preconnects &&
+ alternative_service.protocol == QUIC &&
+ session_->quic_stream_factory()->IsQuicDoingZeroRTT(
+ alternative_service.host_port_pair(), request_info.privacy_mode)) {
+ return;
+ }
}
// Due to how the socket pools handle priorities and idle sockets, only IDLE
@@ -211,9 +217,8 @@ AlternativeServiceVector HttpStreamFactoryImpl::GetAlternativeServicesFor(
if (session_->quic_stream_factory()->IsQuicDisabled(origin.port()))
continue;
- if (!original_url.SchemeIs("https")) {
+ if (!original_url.SchemeIs("https"))
continue;
- }
enabled_alternative_service_vector.push_back(alternative_service);
}

Powered by Google App Engine
This is Rietveld 408576698