diff options
author | bnc <bnc@chromium.org> | 2016-02-09 07:04:42 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-09 15:05:56 +0000 |
commit | 4c30fcf73c5636339f3418addcd927858af93c8f (patch) | |
tree | 83ca41ccc2b49f18f8bd100d4f692f72157f25cf | |
parent | 75d54fe84473d8a17cf4a28d05fa2fc6d104ab54 (diff) | |
download | chromium_src-4c30fcf73c5636339f3418addcd927858af93c8f.zip chromium_src-4c30fcf73c5636339f3418addcd927858af93c8f.tar.gz chromium_src-4c30fcf73c5636339f3418addcd927858af93c8f.tar.bz2 |
Replace --use-spdy by --disable-http2.
Introduce --disable-http2 command line flag that does the exact same thing as
the broken --use-spdy one: disable SPDY/3.1 and HTTP/2. This will be accurately
named once SPDY/3.1 is deprecated.
Remove broken --use-spdy command line flag, which only did one thing: disable
SPDY/3.1 and HTTP/2. Also remove related IOThread::Globals and
IOSChromeIOThread::Globals members. This makes some flags only used in tests,
which are removed as follows:
Remove |forced_spdy_exclusions| from HttpNetworkSession::Params and
SpdySessionDependencies. Also remove HttpNetworkSession::HasSpdyExclusion().
Remove |initial_max_spdy_concurrent_streams| from HttpNetworkSession::Params and
SpdySessionDependencies. Also remove SpdySessionPool constructor argument,
member, and SpdySession constructor argument.
BUG=547781
Review URL: https://codereview.chromium.org/1668433002
Cr-Commit-Position: refs/heads/master@{#374374}
-rw-r--r-- | chrome/browser/io_thread.cc | 72 | ||||
-rw-r--r-- | chrome/browser/io_thread.h | 3 | ||||
-rw-r--r-- | chrome/browser/io_thread_unittest.cc | 4 | ||||
-rw-r--r-- | chrome/common/chrome_switches.cc | 7 | ||||
-rw-r--r-- | chrome/common/chrome_switches.h | 2 | ||||
-rw-r--r-- | ios/chrome/browser/ios_chrome_io_thread.cc | 6 | ||||
-rw-r--r-- | ios/chrome/browser/ios_chrome_io_thread.h | 4 | ||||
-rw-r--r-- | jingle/glue/proxy_resolving_client_socket.cc | 2 | ||||
-rw-r--r-- | net/http/http_network_session.cc | 8 | ||||
-rw-r--r-- | net/http/http_network_session.h | 7 | ||||
-rw-r--r-- | net/http/http_stream_factory_impl.cc | 3 | ||||
-rw-r--r-- | net/spdy/spdy_session.cc | 5 | ||||
-rw-r--r-- | net/spdy/spdy_session.h | 1 | ||||
-rw-r--r-- | net/spdy/spdy_session_pool.cc | 6 | ||||
-rw-r--r-- | net/spdy/spdy_session_pool.h | 2 |
15 files changed, 12 insertions, 120 deletions
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc index 3aa63ea..179ed66 100644 --- a/chrome/browser/io_thread.cc +++ b/chrome/browser/io_thread.cc @@ -297,60 +297,6 @@ const std::string& GetVariationParam( return it->second; } -// Parse kUseSpdy command line flag options, which may contain the following: -// -// "off" : Disables SPDY support entirely. -// "no-ping" : Disables SPDY ping connection testing. -// "exclude=<host>" : Disables SPDY support for the host <host>. -// "no-compress" : Disables SPDY header compression. -// "init-max-streams=<limit>" : Specifies the maximum number of concurrent -// streams for a SPDY session, unless the -// specifies a different value via SETTINGS. -void ConfigureSpdyGlobalsFromUseSpdyArgument(const std::string& mode, - IOThread::Globals* globals) { - static const char kOff[] = "off"; - static const char kDisablePing[] = "no-ping"; - static const char kExclude[] = "exclude"; // Hosts to exclude - static const char kDisableCompression[] = "no-compress"; - static const char kInitialMaxConcurrentStreams[] = "init-max-streams"; - - for (const base::StringPiece& element : base::SplitStringPiece( - mode, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) { - std::vector<base::StringPiece> name_value = base::SplitStringPiece( - element, "=", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); - const base::StringPiece option = - name_value.size() > 0 ? name_value[0] : base::StringPiece(); - const base::StringPiece value = - name_value.size() > 1 ? name_value[1] : base::StringPiece(); - - if (option == kOff) { - net::HttpStreamFactory::set_spdy_enabled(false); - continue; - } - if (option == kDisablePing) { - globals->enable_spdy_ping_based_connection_checking.set(false); - continue; - } - if (option == kExclude) { - globals->forced_spdy_exclusions.insert( - net::HostPortPair::FromURL(GURL(value.as_string()))); - continue; - } - if (option == kDisableCompression) { - globals->enable_spdy_compression.set(false); - continue; - } - if (option == kInitialMaxConcurrentStreams) { - int streams; - if (base::StringToInt(value, &streams)) { - globals->initial_max_spdy_concurrent_streams.set(streams); - continue; - } - } - LOG(DFATAL) << "Unrecognized spdy option: " << option.as_string(); - } -} - } // namespace class IOThread::LoggingNetworkChangeObserver @@ -935,8 +881,8 @@ void IOThread::CleanUp() { } void IOThread::InitializeNetworkOptions(const base::CommandLine& command_line) { - // Only handle use-spdy command line flags if "spdy.disabled" preference is - // not disabled via policy. + // Only handle SPDY field trial parameters and command line flags if + // "spdy.disabled" preference is not forced via policy. if (is_spdy_disabled_by_policy_) { base::FieldTrial* trial = base::FieldTrialList::Find(kSpdyFieldTrialName); if (trial) @@ -986,12 +932,7 @@ void IOThread::ConfigureSpdyGlobals( if (command_line.HasSwitch(switches::kIgnoreUrlFetcherCertRequests)) net::URLFetcher::SetIgnoreCertificateRequests(true); - if (command_line.HasSwitch(switches::kUseSpdy)) { - std::string spdy_mode = - command_line.GetSwitchValueASCII(switches::kUseSpdy); - ConfigureSpdyGlobalsFromUseSpdyArgument(spdy_mode, globals); - // TODO(bnc): https://crbug.com/547781 - // This command line flag is broken. + if (command_line.HasSwitch(switches::kDisableHttp2)) { globals->enable_spdy31.set(false); globals->enable_http2.set(false); return; @@ -1155,17 +1096,10 @@ void IOThread::InitializeNetworkSessionParamsFromGlobals( globals.enable_tcp_fast_open_for_ssl.CopyToIfSet( ¶ms->enable_tcp_fast_open_for_ssl); - globals.initial_max_spdy_concurrent_streams.CopyToIfSet( - ¶ms->spdy_initial_max_concurrent_streams); - globals.enable_spdy_compression.CopyToIfSet( - ¶ms->enable_spdy_compression); - globals.enable_spdy_ping_based_connection_checking.CopyToIfSet( - ¶ms->enable_spdy_ping_based_connection_checking); globals.spdy_default_protocol.CopyToIfSet( ¶ms->spdy_default_protocol); globals.enable_spdy31.CopyToIfSet(¶ms->enable_spdy31); globals.enable_http2.CopyToIfSet(¶ms->enable_http2); - params->forced_spdy_exclusions = globals.forced_spdy_exclusions; globals.parse_alternative_services.CopyToIfSet( ¶ms->parse_alternative_services); globals.enable_alternative_service_with_different_host.CopyToIfSet( diff --git a/chrome/browser/io_thread.h b/chrome/browser/io_thread.h index b56f2a1..06c3c1d 100644 --- a/chrome/browser/io_thread.h +++ b/chrome/browser/io_thread.h @@ -203,9 +203,6 @@ class IOThread : public content::BrowserThreadDelegate { uint16_t testing_fixed_https_port; Optional<bool> enable_tcp_fast_open_for_ssl; - Optional<size_t> initial_max_spdy_concurrent_streams; - Optional<bool> enable_spdy_compression; - Optional<bool> enable_spdy_ping_based_connection_checking; Optional<net::NextProto> spdy_default_protocol; Optional<bool> enable_spdy31; Optional<bool> enable_http2; diff --git a/chrome/browser/io_thread_unittest.cc b/chrome/browser/io_thread_unittest.cc index 343b138..0c98a27 100644 --- a/chrome/browser/io_thread_unittest.cc +++ b/chrome/browser/io_thread_unittest.cc @@ -188,8 +188,8 @@ TEST_F(IOThreadTest, SpdyFieldTrialParametrized) { EXPECT_TRUE(params.enable_http2); } -TEST_F(IOThreadTest, SpdyCommandLineUseSpdyOff) { - command_line_.AppendSwitchASCII("use-spdy", "off"); +TEST_F(IOThreadTest, SpdyCommandLineDisableHttp2) { + command_line_.AppendSwitch("disable-http2"); // Command line should overwrite field trial group. field_trial_group_ = "Spdy4Enabled"; ConfigureSpdyGlobals(); diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index eb7c6be..abeece3 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -271,6 +271,9 @@ const char kDisableExtensionsHttpThrottling[] = // Disable field trial tests configured in fieldtrial_testing_config.json. const char kDisableFieldTrialTestingConfig[] = "disable-field-trial-config"; +// Disable HTTP/2 and SPDY/3.1 protocols. +const char kDisableHttp2[] = "disable-http2"; + // Disables the Material Design version of chrome://downloads. const char kDisableMaterialDesignDownloads[] = "disable-md-downloads"; @@ -1054,10 +1057,6 @@ const char kUnlimitedStorage[] = "unlimited-storage"; const char kUnsafelyTreatInsecureOriginAsSecure[] = "unsafely-treat-insecure-origin-as-secure"; -// Uses Spdy for the transport protocol instead of HTTP. This is a temporary -// testing flag. -const char kUseSpdy[] = "use-spdy"; - // A string used to override the default user agent with a custom one. const char kUserAgent[] = "user-agent"; diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index 95b5784..9507ae8 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -78,6 +78,7 @@ extern const char kDisableExtensionsFileAccessCheck[]; extern const char kDisableExtensionsHttpThrottling[]; extern const char kDisableExtensions[]; extern const char kDisableFieldTrialTestingConfig[]; +extern const char kDisableHttp2[]; extern const char kDisableJavaScriptHarmonyShipping[]; extern const char kDisableMaterialDesignDownloads[]; extern const char kDisableMinimizeOnSecondLauncherItemClick[]; @@ -279,7 +280,6 @@ extern const char kTryChromeAgain[]; extern const char kUnlimitedStorage[]; extern const char kUnsafelyTreatInsecureOriginAsSecure[]; extern const char kUseSimpleCacheBackend[]; -extern const char kUseSpdy[]; extern const char kUserAgent[]; extern const char kUserDataDir[]; extern const char kV8PacMojoInProcess[]; diff --git a/ios/chrome/browser/ios_chrome_io_thread.cc b/ios/chrome/browser/ios_chrome_io_thread.cc index e2376f2..fea44a0 100644 --- a/ios/chrome/browser/ios_chrome_io_thread.cc +++ b/ios/chrome/browser/ios_chrome_io_thread.cc @@ -630,14 +630,8 @@ void IOSChromeIOThread::InitializeNetworkSessionParamsFromGlobals( globals.enable_tcp_fast_open_for_ssl.CopyToIfSet( ¶ms->enable_tcp_fast_open_for_ssl); - globals.initial_max_spdy_concurrent_streams.CopyToIfSet( - ¶ms->spdy_initial_max_concurrent_streams); - globals.enable_spdy_compression.CopyToIfSet(¶ms->enable_spdy_compression); - globals.enable_spdy_ping_based_connection_checking.CopyToIfSet( - ¶ms->enable_spdy_ping_based_connection_checking); globals.enable_spdy31.CopyToIfSet(¶ms->enable_spdy31); globals.enable_http2.CopyToIfSet(¶ms->enable_http2); - params->forced_spdy_exclusions = globals.forced_spdy_exclusions; globals.parse_alternative_services.CopyToIfSet( ¶ms->parse_alternative_services); globals.enable_alternative_service_with_different_host.CopyToIfSet( diff --git a/ios/chrome/browser/ios_chrome_io_thread.h b/ios/chrome/browser/ios_chrome_io_thread.h index e0b481d..67faf2d 100644 --- a/ios/chrome/browser/ios_chrome_io_thread.h +++ b/ios/chrome/browser/ios_chrome_io_thread.h @@ -134,12 +134,8 @@ class IOSChromeIOThread : public web::WebThreadDelegate { uint16_t testing_fixed_https_port; Optional<bool> enable_tcp_fast_open_for_ssl; - Optional<size_t> initial_max_spdy_concurrent_streams; - Optional<bool> enable_spdy_compression; - Optional<bool> enable_spdy_ping_based_connection_checking; Optional<bool> enable_spdy31; Optional<bool> enable_http2; - std::set<net::HostPortPair> forced_spdy_exclusions; Optional<bool> parse_alternative_services; Optional<bool> enable_alternative_service_with_different_host; Optional<double> alternative_service_probability_threshold; diff --git a/jingle/glue/proxy_resolving_client_socket.cc b/jingle/glue/proxy_resolving_client_socket.cc index a932399..92f9e5e 100644 --- a/jingle/glue/proxy_resolving_client_socket.cc +++ b/jingle/glue/proxy_resolving_client_socket.cc @@ -85,8 +85,6 @@ ProxyResolvingClientSocket::ProxyResolvingClientSocket( reference_params->testing_fixed_https_port; session_params.enable_spdy31 = reference_params->enable_spdy31; session_params.enable_http2 = reference_params->enable_http2; - session_params.forced_spdy_exclusions = - reference_params->forced_spdy_exclusions; session_params.parse_alternative_services = reference_params->parse_alternative_services; session_params.enable_alternative_service_with_different_host = diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc index 2e0ed5c..db233c0d 100644 --- a/net/http/http_network_session.cc +++ b/net/http/http_network_session.cc @@ -96,7 +96,6 @@ HttpNetworkSession::Params::Params() enable_http2(true), spdy_session_max_recv_window_size(kSpdySessionMaxRecvWindowSize), spdy_stream_max_recv_window_size(kSpdyStreamMaxRecvWindowSize), - spdy_initial_max_concurrent_streams(0), time_func(&base::TimeTicks::Now), parse_alternative_services(false), enable_alternative_service_with_different_host(false), @@ -198,7 +197,6 @@ HttpNetworkSession::HttpNetworkSession(const Params& params) params.spdy_default_protocol, params.spdy_session_max_recv_window_size, params.spdy_stream_max_recv_window_size, - params.spdy_initial_max_concurrent_streams, params.time_func, params.proxy_delegate), http_stream_factory_(new HttpStreamFactoryImpl(this, false)), @@ -380,12 +378,6 @@ void HttpNetworkSession::GetNpnProtos(NextProtoVector* npn_protos) const { } } -bool HttpNetworkSession::HasSpdyExclusion( - HostPortPair host_port_pair) const { - return params_.forced_spdy_exclusions.find(host_port_pair) != - params_.forced_spdy_exclusions.end(); -} - ClientSocketPoolManager* HttpNetworkSession::GetSocketPoolManager( SocketPoolType pool_type) { switch (pool_type) { diff --git a/net/http/http_network_session.h b/net/http/http_network_session.h index 608b45c..d10817f 100644 --- a/net/http/http_network_session.h +++ b/net/http/http_network_session.h @@ -95,11 +95,8 @@ class NET_EXPORT HttpNetworkSession bool enable_http2; size_t spdy_session_max_recv_window_size; size_t spdy_stream_max_recv_window_size; - size_t spdy_initial_max_concurrent_streams; // Source of time for SPDY connections. SpdySessionPool::TimeFunc time_func; - // URLs to exclude from forced SPDY. - std::set<HostPortPair> forced_spdy_exclusions; // Whether to parse Alt-Svc headers. bool parse_alternative_services; // Whether to enable Alt-Svc entries with hostname different than that of @@ -272,10 +269,6 @@ class NET_EXPORT HttpNetworkSession // Populates |*npn_protos| with protocols to be used with NPN. void GetNpnProtos(NextProtoVector* npn_protos) const; - // Convenience function for searching through |params_| for - // |forced_spdy_exclusions|. - bool HasSpdyExclusion(HostPortPair host_port_pair) const; - private: friend class HttpNetworkSessionPeer; diff --git a/net/http/http_stream_factory_impl.cc b/net/http/http_stream_factory_impl.cc index de395a9..4931e9a 100644 --- a/net/http/http_stream_factory_impl.cc +++ b/net/http/http_stream_factory_impl.cc @@ -258,9 +258,6 @@ AlternativeService HttpStreamFactoryImpl::GetAlternativeServiceFor( if (!HttpStreamFactory::spdy_enabled()) continue; - if (session_->HasSpdyExclusion(origin)) - continue; - // Cache this entry if we don't have a non-broken Alt-Svc yet. if (first_alternative_service.protocol == UNINITIALIZED_ALTERNATE_PROTOCOL) diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc index 4eb8b42..3ac7648 100644 --- a/net/spdy/spdy_session.cc +++ b/net/spdy/spdy_session.cc @@ -658,7 +658,6 @@ SpdySession::SpdySession( NextProto default_protocol, size_t session_max_recv_window_size, size_t stream_max_recv_window_size, - size_t initial_max_concurrent_streams, TimeFunc time_func, ProxyDelegate* proxy_delegate, NetLog* net_log) @@ -680,9 +679,7 @@ SpdySession::SpdySession( read_state_(READ_STATE_DO_READ), write_state_(WRITE_STATE_IDLE), error_on_close_(OK), - max_concurrent_streams_(initial_max_concurrent_streams == 0 - ? kInitialMaxConcurrentStreams - : initial_max_concurrent_streams), + max_concurrent_streams_(kInitialMaxConcurrentStreams), max_concurrent_pushed_streams_(kMaxConcurrentPushedStreams), streams_initiated_count_(0), streams_pushed_count_(0), diff --git a/net/spdy/spdy_session.h b/net/spdy/spdy_session.h index ece02bc..9bff8db 100644 --- a/net/spdy/spdy_session.h +++ b/net/spdy/spdy_session.h @@ -245,7 +245,6 @@ class NET_EXPORT SpdySession : public BufferedSpdyFramerVisitorInterface, NextProto default_protocol, size_t session_max_recv_window_size, size_t stream_max_recv_window_size, - size_t initial_max_concurrent_streams, TimeFunc time_func, ProxyDelegate* proxy_delegate, NetLog* net_log); diff --git a/net/spdy/spdy_session_pool.cc b/net/spdy/spdy_session_pool.cc index 7e98ded..371f28e 100644 --- a/net/spdy/spdy_session_pool.cc +++ b/net/spdy/spdy_session_pool.cc @@ -39,7 +39,6 @@ SpdySessionPool::SpdySessionPool( NextProto default_protocol, size_t session_max_recv_window_size, size_t stream_max_recv_window_size, - size_t initial_max_concurrent_streams, SpdySessionPool::TimeFunc time_func, ProxyDelegate* proxy_delegate) : http_server_properties_(http_server_properties), @@ -57,7 +56,6 @@ SpdySessionPool::SpdySessionPool( : default_protocol), session_max_recv_window_size_(session_max_recv_window_size), stream_max_recv_window_size_(stream_max_recv_window_size), - initial_max_concurrent_streams_(initial_max_concurrent_streams), time_func_(time_func), proxy_delegate_(proxy_delegate) { DCHECK(default_protocol_ >= kProtoSPDYMinimumVersion && @@ -100,8 +98,8 @@ base::WeakPtr<SpdySession> SpdySessionPool::CreateAvailableSessionFromSocket( verify_domain_authentication_, enable_sending_initial_data_, enable_compression_, enable_ping_based_connection_checking_, default_protocol_, session_max_recv_window_size_, - stream_max_recv_window_size_, initial_max_concurrent_streams_, time_func_, - proxy_delegate_, net_log.net_log())); + stream_max_recv_window_size_, time_func_, proxy_delegate_, + net_log.net_log())); new_session->InitializeWithSocket(std::move(connection), this, is_secure, certificate_error_code); diff --git a/net/spdy/spdy_session_pool.h b/net/spdy/spdy_session_pool.h index 092567f..a1a53d1 100644 --- a/net/spdy/spdy_session_pool.h +++ b/net/spdy/spdy_session_pool.h @@ -59,7 +59,6 @@ class NET_EXPORT SpdySessionPool NextProto default_protocol, size_t session_max_recv_window_size, size_t stream_max_recv_window_size, - size_t initial_max_concurrent_streams, SpdySessionPool::TimeFunc time_func, ProxyDelegate* proxy_delegate); ~SpdySessionPool() override; @@ -215,7 +214,6 @@ class NET_EXPORT SpdySessionPool const NextProto default_protocol_; size_t session_max_recv_window_size_; size_t stream_max_recv_window_size_; - size_t initial_max_concurrent_streams_; TimeFunc time_func_; // Determines if a proxy is a trusted SPDY proxy, which is allowed to push |