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

Unified Diff: net/http/http_network_session.cc

Issue 2546533003: Respect QuicAllowed policy for new streams (Closed)
Patch Set: IOS io_thread also initializes DynamicSharedParams 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 3b2ca28d9fe3fb33557f429cd546c39354303c1d..6c11ecc6b7dfd9f8239450fc8cbe77b29192a80a 100644
--- a/net/http/http_network_session.cc
+++ b/net/http/http_network_session.cc
@@ -73,23 +73,24 @@ const int32_t kSpdyStreamMaxRecvWindowSize = 6 * 1024 * 1024; // 6 MB
const int32_t kQuicSocketReceiveBufferSize = 1024 * 1024; // 1MB
HttpNetworkSession::Params::Params()
- : client_socket_factory(NULL),
- host_resolver(NULL),
- cert_verifier(NULL),
- channel_id_service(NULL),
- transport_security_state(NULL),
- cert_transparency_verifier(NULL),
- ct_policy_enforcer(NULL),
- proxy_service(NULL),
- ssl_config_service(NULL),
- http_auth_handler_factory(NULL),
- net_log(NULL),
- host_mapping_rules(NULL),
- socket_performance_watcher_factory(NULL),
+ : client_socket_factory(nullptr),
+ host_resolver(nullptr),
+ cert_verifier(nullptr),
+ channel_id_service(nullptr),
+ transport_security_state(nullptr),
+ cert_transparency_verifier(nullptr),
+ ct_policy_enforcer(nullptr),
+ proxy_service(nullptr),
+ ssl_config_service(nullptr),
+ http_auth_handler_factory(nullptr),
+ net_log(nullptr),
+ host_mapping_rules(nullptr),
+ socket_performance_watcher_factory(nullptr),
ignore_certificate_errors(false),
testing_fixed_http_port(0),
testing_fixed_https_port(0),
enable_tcp_fast_open_for_ssl(false),
+ dynamic_shared_params(nullptr),
enable_spdy_ping_based_connection_checking(true),
enable_http2(true),
spdy_session_max_recv_window_size(kSpdySessionMaxRecvWindowSize),
@@ -97,7 +98,6 @@ HttpNetworkSession::Params::Params()
time_func(&base::TimeTicks::Now),
enable_http2_alternative_service_with_different_host(false),
enable_quic_alternative_service_with_different_host(true),
- enable_quic(false),
disable_quic_on_timeout_with_open_streams(false),
quic_always_require_handshake_confirmation(false),
quic_disable_connection_pooling(false),
@@ -109,8 +109,8 @@ HttpNetworkSession::Params::Params()
quic_socket_receive_buffer_size(kQuicSocketReceiveBufferSize),
quic_delay_tcp_race(true),
quic_max_server_configs_stored_in_properties(0u),
- quic_clock(NULL),
- quic_random(NULL),
+ quic_clock(nullptr),
+ quic_random(nullptr),
quic_max_packet_length(kDefaultMaxPacketSize),
enable_user_alternate_protocol_ports(false),
quic_crypto_client_stream_factory(
@@ -128,7 +128,7 @@ HttpNetworkSession::Params::Params()
quic_force_hol_blocking(false),
quic_race_cert_verification(false),
quic_do_not_fragment(false),
- proxy_delegate(NULL),
+ proxy_delegate(nullptr),
enable_token_binding(false),
http_09_on_non_default_ports_enabled(false) {
quic_supported_versions.push_back(QUIC_VERSION_35);
@@ -138,6 +138,15 @@ HttpNetworkSession::Params::Params(const Params& other) = default;
HttpNetworkSession::Params::~Params() {}
+bool HttpNetworkSession::Params::enable_quic() const {
+ return dynamic_shared_params && dynamic_shared_params->enable_quic;
+}
+
+HttpNetworkSession::DynamicSharedParams::DynamicSharedParams()
+ : enable_quic(false) {}
+
+HttpNetworkSession::DynamicSharedParams::~DynamicSharedParams() {}
+
// TODO(mbelshe): Move the socket factories into HttpStreamFactory.
HttpNetworkSession::HttpNetworkSession(const Params& params)
: net_log_(params.net_log),
@@ -292,7 +301,7 @@ std::unique_ptr<base::Value> HttpNetworkSession::SpdySessionPoolInfoToValue()
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", params_.enable_quic());
std::unique_ptr<base::ListValue> connection_options(new base::ListValue);
for (QuicTagVector::const_iterator it =
params_.quic_connection_options.begin();
@@ -358,7 +367,7 @@ bool HttpNetworkSession::IsProtocolEnabled(NextProto protocol) const {
case kProtoHTTP2:
return params_.enable_http2;
case kProtoQUIC:
- return params_.enable_quic;
+ return params_.enable_quic();
}
NOTREACHED();
return false;

Powered by Google App Engine
This is Rietveld 408576698