diff options
-rw-r--r-- | chrome/browser/io_thread.cc | 4 | ||||
-rw-r--r-- | chrome/browser/io_thread.h | 1 | ||||
-rw-r--r-- | chrome/common/chrome_switches.cc | 3 | ||||
-rw-r--r-- | chrome/common/chrome_switches.h | 1 | ||||
-rw-r--r-- | net/http/http_network_session.cc | 3 | ||||
-rw-r--r-- | net/http/http_network_session.h | 1 | ||||
-rw-r--r-- | net/http/http_stream_factory_impl_job.cc | 6 |
7 files changed, 15 insertions, 4 deletions
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc index cd6d292..6bfbfcb 100644 --- a/chrome/browser/io_thread.cc +++ b/chrome/browser/io_thread.cc @@ -515,6 +515,9 @@ void IOThread::Init() { globals_->testing_fixed_https_port = GetSwitchValueAsInt(command_line, switches::kTestingFixedHttpsPort); } + if (command_line.HasSwitch(switches::kEnableQuic)) { + globals_->enable_quic.set(true); + } if (command_line.HasSwitch(switches::kOriginPortToForceQuicOn)) { globals_->origin_port_to_force_quic_on.set( GetSwitchValueAsInt(command_line, @@ -825,6 +828,7 @@ void IOThread::InitializeNetworkSessionParams( ¶ms->enable_spdy_ping_based_connection_checking); globals_->spdy_default_protocol.CopyToIfSet( ¶ms->spdy_default_protocol); + globals_->enable_quic.CopyToIfSet(¶ms->enable_quic); globals_->origin_port_to_force_quic_on.CopyToIfSet( ¶ms->origin_port_to_force_quic_on); globals_->use_spdy_over_quic.CopyToIfSet(¶ms->use_spdy_over_quic); diff --git a/chrome/browser/io_thread.h b/chrome/browser/io_thread.h index df89dde..d612b35 100644 --- a/chrome/browser/io_thread.h +++ b/chrome/browser/io_thread.h @@ -160,6 +160,7 @@ class IOThread : public content::BrowserThreadDelegate { Optional<bool> enable_spdy_compression; Optional<bool> enable_spdy_ping_based_connection_checking; Optional<net::NextProto> spdy_default_protocol; + Optional<bool> enable_quic; Optional<uint16> origin_port_to_force_quic_on; Optional<bool> use_spdy_over_quic; // NetErrorTabHelper uses |dns_probe_service| to send DNS probes when a diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index d99f05c..8018b3f 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -606,6 +606,9 @@ const char kEnableProfiling[] = "enable-profiling"; // Enables query extraction in the omnibox. const char kEnableQueryExtraction[] = "enable-query-extraction"; +// Enables support for the QUIC protocol. This is a temporary testing flag. +const char kEnableQuic[] = "enable-quic"; + // Enables content settings based on host *and* plug-in in the user // preferences. const char kEnableResourceContentSettings[] = diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index 488a756..23e1654 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -168,6 +168,7 @@ extern const char kEnablePanelStacking[]; extern const char kEnablePasswordGeneration[]; extern const char kEnablePnacl[]; extern const char kEnableProfiling[]; +extern const char kEnableQuic[]; extern const char kEnableQueryExtraction[]; extern const char kEnableResourceContentSettings[]; extern const char kEnableSdch[]; diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc index 1111562..a53a31b 100644 --- a/net/http/http_network_session.cc +++ b/net/http/http_network_session.cc @@ -80,6 +80,7 @@ HttpNetworkSession::Params::Params() spdy_initial_max_concurrent_streams(0), spdy_max_concurrent_streams_limit(0), time_func(&base::TimeTicks::Now), + enable_quic(false), origin_port_to_force_quic_on(0), use_spdy_over_quic(false) { } @@ -184,7 +185,7 @@ Value* HttpNetworkSession::SpdySessionPoolInfoToValue() const { Value* HttpNetworkSession::QuicInfoToValue() const { base::DictionaryValue* dict = new base::DictionaryValue(); dict->Set("sessions", quic_stream_factory_.QuicStreamFactoryInfoToValue()); - dict->SetBoolean("quic_enabled", params_.origin_port_to_force_quic_on != 0); + dict->SetBoolean("quic_enabled", params_.enable_quic); dict->SetInteger("origin_port_to_force_quic_on", params_.origin_port_to_force_quic_on); dict->SetBoolean("use_spdy_over_quic", params_.use_spdy_over_quic); diff --git a/net/http/http_network_session.h b/net/http/http_network_session.h index 1004ab4..9bb41d2 100644 --- a/net/http/http_network_session.h +++ b/net/http/http_network_session.h @@ -80,6 +80,7 @@ class NET_EXPORT HttpNetworkSession size_t spdy_max_concurrent_streams_limit; SpdySessionPool::TimeFunc time_func; std::string trusted_spdy_proxy; + bool enable_quic; uint16 origin_port_to_force_quic_on; bool use_spdy_over_quic; }; diff --git a/net/http/http_stream_factory_impl_job.cc b/net/http/http_stream_factory_impl_job.cc index 034bb949..ea62c3f 100644 --- a/net/http/http_stream_factory_impl_job.cc +++ b/net/http/http_stream_factory_impl_job.cc @@ -649,9 +649,9 @@ bool HttpStreamFactoryImpl::Job::ShouldForceSpdyWithoutSSL() const { } bool HttpStreamFactoryImpl::Job::ShouldForceQuic() const { - return session_->params().origin_port_to_force_quic_on == origin_.port() - && session_->params().origin_port_to_force_quic_on != 0 - && proxy_info_.is_direct(); + return session_->params().enable_quic && + session_->params().origin_port_to_force_quic_on == origin_.port() && + proxy_info_.is_direct(); } int HttpStreamFactoryImpl::Job::DoWaitForJob() { |