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

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: Fix test name 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
« no previous file with comments | « net/http/http_network_session.cc ('k') | net/http/http_stream_factory_impl_unittest.cc » ('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 4d32ffcf207320ddfbf65bf5787c98d33770be37..516bb835c352abeed8c53db1b03059498c3928ee 100644
--- a/net/http/http_stream_factory_impl.cc
+++ b/net/http/http_stream_factory_impl.cc
@@ -14,6 +14,7 @@
#include "net/http/http_stream_factory_impl_job.h"
#include "net/http/http_stream_factory_impl_request.h"
#include "net/log/net_log.h"
+#include "net/quic/quic_server_id.h"
#include "net/spdy/spdy_http_stream.h"
#include "url/gurl.h"
@@ -133,6 +134,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().quic_disable_preconnect_if_0rtt &&
+ alternative_service.protocol == QUIC &&
+ session_->quic_stream_factory()->ZeroRTTEnabledFor(QuicServerId(
+ 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 +218,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);
}
« no previous file with comments | « net/http/http_network_session.cc ('k') | net/http/http_stream_factory_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698