summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorrtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-23 05:57:54 +0000
committerrtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-23 05:57:54 +0000
commit3231b619a191e753e8b64c2061a1d5e2c99aa8b7 (patch)
tree988e5117e505d24f0c97b02b52c2c64f5def101b /net
parent04797250b8e2c836b5701390e1443ac45aa4208a (diff)
downloadchromium_src-3231b619a191e753e8b64c2061a1d5e2c99aa8b7.zip
chromium_src-3231b619a191e753e8b64c2061a1d5e2c99aa8b7.tar.gz
chromium_src-3231b619a191e753e8b64c2061a1d5e2c99aa8b7.tar.bz2
SPDY - Added enabling of SPDY/3 and SPDY flow control to
about:flags. Added command line switches --enable-spdy3 to enable SPDY/3 and --enable-spdy-flow-control to enable flow control (SPDY/2.1). Added Field Trials for SPDY/2.1 and SPDY/3. The FieldTrials are enabled when SPDY/3 and flow control command line options are not chosen. Removed --use-spdy=v3 and --use-spdy=flow-control options. BUG=118440,119205 R=willchan TEST=Netowrk unit tests and browser tests. Enable SPDY/3 in about:flags and see in chrome://net-internals that SPDY/2, SPDY/2.1 and SPDY/3 are displayed as the protocols supported. Enable SPDY FLow Control in about:flags and see in chrome://net-internals that SPDY/2 and SPDY/2.1 are displayed as the protocols supported. Review URL: http://codereview.chromium.org/9766021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128420 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/http/http_network_layer.cc20
-rw-r--r--net/http/http_stream_factory.cc19
-rw-r--r--net/http/http_stream_factory.h10
3 files changed, 29 insertions, 20 deletions
diff --git a/net/http/http_network_layer.cc b/net/http/http_network_layer.cc
index f8da78d..0ae03d2 100644
--- a/net/http/http_network_layer.cc
+++ b/net/http/http_network_layer.cc
@@ -46,16 +46,9 @@ void HttpNetworkLayer::EnableSpdy(const std::string& mode) {
static const char kExclude[] = "exclude"; // Hosts to exclude
static const char kDisableCompression[] = "no-compress";
static const char kDisableAltProtocols[] = "no-alt-protocols";
- static const char kEnableVersionThree[] = "v3";
static const char kForceAltProtocols[] = "force-alt-protocols";
static const char kSingleDomain[] = "single-domain";
- // If flow-control is enabled, received WINDOW_UPDATE and SETTINGS
- // messages are processed and outstanding window size is actually obeyed
- // when sending data frames, and WINDOW_UPDATE messages are generated
- // when data is consumed.
- static const char kEnableFlowControl[] = "flow-control";
-
// We want an A/B experiment between SPDY enabled and SPDY disabled,
// but only for pages where SPDY *could have been* negotiated. To do
// this, we use NPN, but prevent it from negotiating SPDY. If the
@@ -103,13 +96,6 @@ void HttpNetworkLayer::EnableSpdy(const std::string& mode) {
next_protos.push_back("http/1.1");
next_protos.push_back("spdy/2");
HttpStreamFactory::SetNextProtos(next_protos);
- } else if (option == kEnableVersionThree) {
- std::vector<std::string> next_protos;
- next_protos.push_back("http/1.1");
- next_protos.push_back("spdy/2");
- next_protos.push_back("spdy/2.1");
- next_protos.push_back("spdy/3");
- HttpStreamFactory::SetNextProtos(next_protos);
} else if (option == kEnableNpnHttpOnly) {
// Avoid alternate protocol in this case. Otherwise, browser will try SSL
// and then fallback to http. This introduces extra load.
@@ -121,12 +107,6 @@ void HttpNetworkLayer::EnableSpdy(const std::string& mode) {
} else if (option == kDisableAltProtocols) {
use_alt_protocols = false;
HttpStreamFactory::set_use_alternate_protocols(false);
- } else if (option == kEnableFlowControl) {
- std::vector<std::string> next_protos;
- next_protos.push_back("http/1.1");
- next_protos.push_back("spdy/2");
- next_protos.push_back("spdy/2.1");
- HttpStreamFactory::SetNextProtos(next_protos);
} else if (option == kForceAltProtocols) {
PortAlternateProtocolPair pair;
pair.port = 443;
diff --git a/net/http/http_stream_factory.cc b/net/http/http_stream_factory.cc
index dda9951..dee1874 100644
--- a/net/http/http_stream_factory.cc
+++ b/net/http/http_stream_factory.cc
@@ -149,6 +149,25 @@ bool HttpStreamFactory::HasSpdyExclusion(const HostPortPair& endpoint) {
}
// static
+void HttpStreamFactory::EnableFlowControl() {
+ std::vector<std::string> next_protos;
+ next_protos.push_back("http/1.1");
+ next_protos.push_back("spdy/2");
+ next_protos.push_back("spdy/2.1");
+ SetNextProtos(next_protos);
+}
+
+// static
+void HttpStreamFactory::EnableSPDY3() {
+ std::vector<std::string> next_protos;
+ next_protos.push_back("http/1.1");
+ next_protos.push_back("spdy/2");
+ next_protos.push_back("spdy/2.1");
+ next_protos.push_back("spdy/3");
+ SetNextProtos(next_protos);
+}
+
+// static
void HttpStreamFactory::SetNextProtos(const std::vector<std::string>& value) {
if (!next_protos_)
next_protos_ = new std::vector<std::string>;
diff --git a/net/http/http_stream_factory.h b/net/http/http_stream_factory.h
index 8c726bb..ff32589 100644
--- a/net/http/http_stream_factory.h
+++ b/net/http/http_stream_factory.h
@@ -230,6 +230,16 @@ class NET_EXPORT HttpStreamFactory {
// Check if a HostPortPair is excluded from using spdy.
static bool HasSpdyExclusion(const HostPortPair& endpoint);
+ // Sets http/1.1, spdy/2, spdy/2.1 and spdy/3 as the protocols supported.
+ static void EnableSPDY3();
+
+ // Sets http/1.1, spdy/2 and spdy/2.1 as the protocols supported.
+ // If flow-control is enabled, received WINDOW_UPDATE and SETTINGS messages
+ // are processed and outstanding window size is actually obeyed when sending
+ // data frames, and WINDOW_UPDATE messages are generated when data is
+ // consumed.
+ static void EnableFlowControl();
+
// Sets the protocols supported by NPN (next protocol negotiation) during the
// SSL handshake as well as by HTTP Alternate-Protocol.
static void SetNextProtos(const std::vector<std::string>& value);