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

Unified Diff: net/http/http_network_session.cc

Issue 2546533003: Respect QuicAllowed policy for new streams (Closed)
Patch Set: Naming, formatting Created 4 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_network_session.cc
diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc
index 2936e12e5048e5b176db85fc7768bf0e4b7b697c..1e5219ff6c0cdab5d6ef9b504386e9bd7226298b 100644
--- a/net/http/http_network_session.cc
+++ b/net/http/http_network_session.cc
@@ -87,6 +87,7 @@ HttpNetworkSession::Params::Params()
testing_fixed_http_port(0),
testing_fixed_https_port(0),
enable_tcp_fast_open_for_ssl(false),
+ dynamic_shared_params(NULL),
mmenke 2016/12/13 18:48:54 nullptr is now preferred (Feel free to change the
pmarko 2016/12/19 21:25:11 Done.
enable_spdy_ping_based_connection_checking(true),
enable_http2(true),
spdy_session_max_recv_window_size(kSpdySessionMaxRecvWindowSize),
@@ -136,6 +137,19 @@ HttpNetworkSession::Params::Params(const Params& other) = default;
HttpNetworkSession::Params::~Params() {}
+bool HttpNetworkSession::Params::enable_quic_for_new_streams() const {
+ return enable_quic && (!dynamic_shared_params ||
+ dynamic_shared_params->enable_quic_for_new_streams);
mmenke 2016/12/13 18:48:54 I assume we do need both this and enable_quic, and
Bence 2016/12/13 19:24:45 Correct. For example, |enable_quic| can be cleare
pmarko 2016/12/19 21:25:11 Reduced to only enable_quic, the logic is now outs
+}
+
+HttpNetworkSession::DynamicSharedParams::DynamicSharedParams()
+ : enable_quic_for_new_streams(true) {}
+
+HttpNetworkSession::DynamicSharedParams::DynamicSharedParams(
+ const DynamicSharedParams& other) = default;
+
+HttpNetworkSession::DynamicSharedParams::~DynamicSharedParams() {}
+
// TODO(mbelshe): Move the socket factories into HttpStreamFactory.
HttpNetworkSession::HttpNetworkSession(const Params& params)
: net_log_(params.net_log),
@@ -291,6 +305,8 @@ std::unique_ptr<base::Value> HttpNetworkSession::QuicInfoToValue() const {
std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
dict->Set("sessions", quic_stream_factory_.QuicStreamFactoryInfoToValue());
dict->SetBoolean("quic_enabled", params_.enable_quic);
+ dict->SetBoolean("quic_enabled_for_new_streams",
+ params_.enable_quic_for_new_streams());
dict->SetBoolean("enable_quic_port_selection",
params_.enable_quic_port_selection);
std::unique_ptr<base::ListValue> connection_options(new base::ListValue);
@@ -358,7 +374,7 @@ bool HttpNetworkSession::IsProtocolEnabled(NextProto protocol) const {
case kProtoHTTP2:
return params_.enable_http2;
case kProtoQUIC:
- return params_.enable_quic;
+ return params_.enable_quic_for_new_streams();
mmenke 2016/12/13 18:48:54 HttpNetworkSession::IsProtocolEnabled() -> enable_
pmarko 2016/12/19 21:25:11 Reduced to only enable_quic, the logic is now outs
}
NOTREACHED();
return false;

Powered by Google App Engine
This is Rietveld 408576698