summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-06 05:26:02 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-06 05:26:02 +0000
commitb05bcaa3f5d01ba60c19342dae8a9ab01fde9942 (patch)
tree245f3aca2cf92aa9d2aba8a62a61cde8188081af /chrome
parent55bc19755af0a15dd4f317d90ddc45adca1d5b79 (diff)
downloadchromium_src-b05bcaa3f5d01ba60c19342dae8a9ab01fde9942.zip
chromium_src-b05bcaa3f5d01ba60c19342dae8a9ab01fde9942.tar.gz
chromium_src-b05bcaa3f5d01ba60c19342dae8a9ab01fde9942.tar.bz2
[SPDY] Do not advertise SPDY/2 by default
Add a switch to re-enable advertising SPDY/2. Use SPDY/3 instead of SPDY/2 for cases where SPDY is forced on. Also use SPDY/3 instead of SPDY/2 in tests. Add "deprecated" to all enum constants involving SPDY/2. Remove unused --enable-npn switch. BUG=303957 R=darin@chromium.org, rtenneti@chromium.org Review URL: https://codereview.chromium.org/25977005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227229 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/chrome_net_benchmarking_message_filter.cc2
-rw-r--r--chrome/browser/io_thread.cc10
-rw-r--r--chrome/browser/io_thread.h6
-rw-r--r--chrome/browser/net/http_server_properties_manager_unittest.cc14
-rw-r--r--chrome/common/chrome_switches.cc7
-rw-r--r--chrome/common/chrome_switches.h2
6 files changed, 21 insertions, 20 deletions
diff --git a/chrome/browser/chrome_net_benchmarking_message_filter.cc b/chrome/browser/chrome_net_benchmarking_message_filter.cc
index 4ad3fc7..04bc990 100644
--- a/chrome/browser/chrome_net_benchmarking_message_filter.cc
+++ b/chrome/browser/chrome_net_benchmarking_message_filter.cc
@@ -112,7 +112,7 @@ void ChromeNetBenchmarkingMessageFilter::OnEnableSpdy(bool enable) {
return;
}
if (enable) {
- net::HttpStreamFactory::EnableNpnSpdy();
+ net::HttpStreamFactory::EnableNpnSpdy3();
net::HttpNetworkLayer::ForceAlternateProtocol();
} else {
net::HttpStreamFactory::EnableNpnHttpOnly();
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index b347651..3d958b8 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -734,8 +734,8 @@ void IOThread::InitializeNetworkOptions(const CommandLine& command_line) {
net::HttpStreamFactory::EnableNpnSpdy4a2();
} else if (command_line.HasSwitch(switches::kDisableSpdy31)) {
net::HttpStreamFactory::EnableNpnSpdy3();
- } else if (command_line.HasSwitch(switches::kEnableNpn)) {
- net::HttpStreamFactory::EnableNpnSpdy();
+ } else if (command_line.HasSwitch(switches::kEnableSpdy2)) {
+ net::HttpStreamFactory::EnableNpnSpdy31WithSpdy2();
} else if (command_line.HasSwitch(switches::kEnableNpnHttpOnly)) {
net::HttpStreamFactory::EnableNpnHttpOnly();
} else {
@@ -786,11 +786,11 @@ void IOThread::EnableSpdy(const std::string& mode) {
if (option == kOff) {
net::HttpStreamFactory::set_spdy_enabled(false);
} else if (option == kDisableSSL) {
- globals_->spdy_default_protocol.set(net::kProtoSPDY2);
+ globals_->spdy_default_protocol.set(net::kProtoSPDY3);
net::HttpStreamFactory::set_force_spdy_over_ssl(false);
net::HttpStreamFactory::set_force_spdy_always(true);
} else if (option == kSSL) {
- globals_->spdy_default_protocol.set(net::kProtoSPDY2);
+ globals_->spdy_default_protocol.set(net::kProtoSPDY3);
net::HttpStreamFactory::set_force_spdy_over_ssl(true);
net::HttpStreamFactory::set_force_spdy_always(true);
} else if (option == kDisablePing) {
@@ -804,7 +804,7 @@ void IOThread::EnableSpdy(const std::string& mode) {
} else if (option == kForceAltProtocols) {
net::PortAlternateProtocolPair pair;
pair.port = 443;
- pair.protocol = net::NPN_SPDY_2;
+ pair.protocol = net::NPN_SPDY_3;
net::HttpServerPropertiesImpl::ForceAlternateProtocol(pair);
} else if (option == kSingleDomain) {
DLOG(INFO) << "FORCING SINGLE DOMAIN";
diff --git a/chrome/browser/io_thread.h b/chrome/browser/io_thread.h
index 9901afd..e5187f4 100644
--- a/chrome/browser/io_thread.h
+++ b/chrome/browser/io_thread.h
@@ -221,8 +221,8 @@ class IOThread : public content::BrowserThreadDelegate {
void InitializeNetworkOptions(const CommandLine& parsed_command_line);
- // Enable the SPDY protocol. If this function is not called, SPDY/3
- // will be enabled.
+ // Enable SPDY with the given mode, which may contain the following:
+ //
// "off" : Disables SPDY support entirely.
// "ssl" : Forces SPDY for all HTTPS requests.
// "no-ssl" : Forces SPDY for all HTTP requests.
@@ -230,7 +230,7 @@ class IOThread : public content::BrowserThreadDelegate {
// "exclude=<host>" : Disables SPDY support for the host <host>.
// "no-compress" : Disables SPDY header compression.
// "no-alt-protocols : Disables alternate protocol support.
- // "force-alt-protocols : Forces an alternate protocol of SPDY/2
+ // "force-alt-protocols : Forces an alternate protocol of SPDY/3
// on port 443.
// "single-domain" : Forces all spdy traffic to a single domain.
// "init-max-streams=<limit>" : Specifies the maximum number of concurrent
diff --git a/chrome/browser/net/http_server_properties_manager_unittest.cc b/chrome/browser/net/http_server_properties_manager_unittest.cc
index 7bb3fe1..64da47a 100644
--- a/chrome/browser/net/http_server_properties_manager_unittest.cc
+++ b/chrome/browser/net/http_server_properties_manager_unittest.cc
@@ -152,7 +152,7 @@ TEST_F(HttpServerPropertiesManagerTest,
// Set up alternate_protocol for www.google.com:80.
base::DictionaryValue* alternate_protocol = new base::DictionaryValue;
alternate_protocol->SetInteger("port", 443);
- alternate_protocol->SetString("protocol_str", "npn-spdy/2");
+ alternate_protocol->SetString("protocol_str", "npn-spdy/3");
server_pref_dict->SetWithoutPathExpansion(
"alternate_protocol", alternate_protocol);
@@ -173,7 +173,7 @@ TEST_F(HttpServerPropertiesManagerTest,
// Set up alternate_protocol for mail.google.com:80
base::DictionaryValue* alternate_protocol1 = new base::DictionaryValue;
alternate_protocol1->SetInteger("port", 444);
- alternate_protocol1->SetString("protocol_str", "npn-spdy/3");
+ alternate_protocol1->SetString("protocol_str", "npn-spdy/3.1");
server_pref_dict1->SetWithoutPathExpansion(
"alternate_protocol", alternate_protocol1);
@@ -218,12 +218,12 @@ TEST_F(HttpServerPropertiesManagerTest,
http_server_props_manager_->GetAlternateProtocol(
net::HostPortPair::FromString("www.google.com:80"));
EXPECT_EQ(443, port_alternate_protocol.port);
- EXPECT_EQ(net::NPN_SPDY_2, port_alternate_protocol.protocol);
+ EXPECT_EQ(net::NPN_SPDY_3, port_alternate_protocol.protocol);
port_alternate_protocol =
http_server_props_manager_->GetAlternateProtocol(
net::HostPortPair::FromString("mail.google.com:80"));
EXPECT_EQ(444, port_alternate_protocol.port);
- EXPECT_EQ(net::NPN_SPDY_3, port_alternate_protocol.protocol);
+ EXPECT_EQ(net::NPN_SPDY_3_1, port_alternate_protocol.protocol);
// Verify pipeline capability.
EXPECT_EQ(net::PIPELINE_CAPABLE,
@@ -360,7 +360,7 @@ TEST_F(HttpServerPropertiesManagerTest, HasAlternateProtocol) {
EXPECT_FALSE(
http_server_props_manager_->HasAlternateProtocol(spdy_server_mail));
http_server_props_manager_->SetAlternateProtocol(
- spdy_server_mail, 443, net::NPN_SPDY_2);
+ spdy_server_mail, 443, net::NPN_SPDY_3);
// Run the task.
loop_.RunUntilIdle();
@@ -371,7 +371,7 @@ TEST_F(HttpServerPropertiesManagerTest, HasAlternateProtocol) {
net::PortAlternateProtocolPair port_alternate_protocol =
http_server_props_manager_->GetAlternateProtocol(spdy_server_mail);
EXPECT_EQ(443, port_alternate_protocol.port);
- EXPECT_EQ(net::NPN_SPDY_2, port_alternate_protocol.protocol);
+ EXPECT_EQ(net::NPN_SPDY_3, port_alternate_protocol.protocol);
}
TEST_F(HttpServerPropertiesManagerTest, PipelineCapability) {
@@ -407,7 +407,7 @@ TEST_F(HttpServerPropertiesManagerTest, Clear) {
net::HostPortPair spdy_server_mail("mail.google.com", 443);
http_server_props_manager_->SetSupportsSpdy(spdy_server_mail, true);
http_server_props_manager_->SetAlternateProtocol(
- spdy_server_mail, 443, net::NPN_SPDY_2);
+ spdy_server_mail, 443, net::NPN_SPDY_3);
const net::SpdySettingsIds id1 = net::SETTINGS_UPLOAD_BANDWIDTH;
const net::SpdySettingsFlags flags1 = net::SETTINGS_FLAG_PLEASE_PERSIST;
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 7c4087b..72a9719 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -679,9 +679,6 @@ const char kEnableNetBenchmarking[] = "enable-net-benchmarking";
// Enables |NetworkTimeService| to convert local time to network time.
const char kEnableNetworkTime[] = "enable-network-time";
-// Enables NPN and SPDY. In case server supports SPDY, browser will use SPDY.
-const char kEnableNpn[] = "enable-npn";
-
// Enables NPN with HTTP. It means NPN is enabled but SPDY won't be used.
// HTTP is still used for all requests.
const char kEnableNpnHttpOnly[] = "enable-npn-http";
@@ -743,6 +740,10 @@ const char kEnableStickyKeys[] = "enable-sticky-keys";
// Disables support of sticky keys.
const char kDisableStickyKeys[] = "disable-sticky-keys";
+// Enable SPDY/2. This is a temporary testing flag. See
+// http://crbug.com/303957 .
+const char kEnableSpdy2[] = "enable-spdy2";
+
// Disable SPDY/3.1. This is a temporary testing flag.
const char kDisableSpdy31[] = "disable-spdy31";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 726293e..73c3554 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -196,7 +196,6 @@ extern const char kEnableMetricsReportingForTesting[];
extern const char kEnableNaCl[];
extern const char kEnableNetBenchmarking[];
extern const char kEnableNetworkTime[];
-extern const char kEnableNpn[];
extern const char kEnableNpnHttpOnly[];
extern const char kEnableOmniboxAutoCompletionForIme[];
extern const char kEnablePanels[];
@@ -211,6 +210,7 @@ extern const char kEnableSavePasswordBubble[];
extern const char kEnableSdch[];
extern const char kEnableStickyKeys[];
extern const char kDisableStickyKeys[];
+extern const char kEnableSpdy2[];
extern const char kDisableSpdy31[];
extern const char kEnableSpdy4a2[];
extern const char kEnableSpdyCredentialFrames[];