diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-10 00:05:56 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-10 00:05:56 +0000 |
commit | 0ef23e3a8d68186a3117899b17e12d25d2b2de61 (patch) | |
tree | adb2b9235a050c54deb810fcc67e3b8d9bada02a /net | |
parent | 8fee64afe7ba2867255af94eae719f6f6b5ddc33 (diff) | |
download | chromium_src-0ef23e3a8d68186a3117899b17e12d25d2b2de61.zip chromium_src-0ef23e3a8d68186a3117899b17e12d25d2b2de61.tar.gz chromium_src-0ef23e3a8d68186a3117899b17e12d25d2b2de61.tar.bz2 |
Add back a flag to disable Alternate-Protocol processing.
Specifically, provide a no-alt-protocols option to the --use-spdy flag.
Review URL: http://codereview.chromium.org/2896003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52022 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/http/http_network_layer.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/net/http/http_network_layer.cc b/net/http/http_network_layer.cc index 27c6272..09ba494 100644 --- a/net/http/http_network_layer.cc +++ b/net/http/http_network_layer.cc @@ -128,6 +128,7 @@ HttpNetworkSession* HttpNetworkLayer::GetSession() { void HttpNetworkLayer::EnableSpdy(const std::string& mode) { static const char kDisableSSL[] = "no-ssl"; static const char kDisableCompression[] = "no-compress"; + static const char kDisableAltProtocols[] = "no-alt-protocols"; // We want an A/B experiment between SPDY enabled and SPDY disabled, // but only for pages where SPDY *could have been* negotiated. To do @@ -156,6 +157,8 @@ void HttpNetworkLayer::EnableSpdy(const std::string& mode) { // Force spdy mode (use SpdyNetworkTransaction for all http requests). force_spdy_ = true; + bool use_alt_protocols = true; + for (std::vector<std::string>::iterator it = spdy_options.begin(); it != spdy_options.end(); ++it) { const std::string& option = *it; @@ -164,13 +167,16 @@ void HttpNetworkLayer::EnableSpdy(const std::string& mode) { } else if (option == kDisableCompression) { spdy::SpdyFramer::set_enable_compression_default(false); } else if (option == kEnableNPN) { - HttpNetworkTransaction::SetUseAlternateProtocols(true); + HttpNetworkTransaction::SetUseAlternateProtocols(use_alt_protocols); HttpNetworkTransaction::SetNextProtos(kNpnProtosFull); force_spdy_ = false; } else if (option == kEnableNpnHttpOnly) { - HttpNetworkTransaction::SetUseAlternateProtocols(true); + HttpNetworkTransaction::SetUseAlternateProtocols(use_alt_protocols); HttpNetworkTransaction::SetNextProtos(kNpnProtosHttpOnly); force_spdy_ = false; + } else if (option == kDisableAltProtocols) { + use_alt_protocols = false; + HttpNetworkTransaction::SetUseAlternateProtocols(false); } else if (option.empty() && it == spdy_options.begin()) { continue; } else { |