summaryrefslogtreecommitdiffstats
path: root/net/http
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-05 20:46:01 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-05 20:46:01 +0000
commit63bf966c829d04878c3012cd221a27f1ea44b7d8 (patch)
tree630e51035533a1592dc02bf6fb9ae66c16b00019 /net/http
parent736441a7a4e0dde8240d5eeca984351fb0100501 (diff)
downloadchromium_src-63bf966c829d04878c3012cd221a27f1ea44b7d8.zip
chromium_src-63bf966c829d04878c3012cd221a27f1ea44b7d8.tar.gz
chromium_src-63bf966c829d04878c3012cd221a27f1ea44b7d8.tar.bz2
[SPDY] Add flag to turn on SPDY/3.1 (with per-session flow control)
Add SPDY/3.1 info for NPN and Alternate-Protocol. BUG=176592 TBR=jam@chromium.org Review URL: https://codereview.chromium.org/12388099 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186250 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http')
-rw-r--r--net/http/http_network_transaction_spdy3_unittest.cc4
-rw-r--r--net/http/http_server_properties.cc1
-rw-r--r--net/http/http_server_properties.h1
-rw-r--r--net/http/http_stream_factory.cc13
-rw-r--r--net/http/http_stream_factory.h4
5 files changed, 21 insertions, 2 deletions
diff --git a/net/http/http_network_transaction_spdy3_unittest.cc b/net/http/http_network_transaction_spdy3_unittest.cc
index 4473ac9..51313c6 100644
--- a/net/http/http_network_transaction_spdy3_unittest.cc
+++ b/net/http/http_network_transaction_spdy3_unittest.cc
@@ -105,7 +105,7 @@ std::vector<std::string> MakeNextProtos(const char* a, ...) {
// SpdyNextProtos returns a vector of NPN protocol strings for negotiating
// SPDY.
std::vector<std::string> SpdyNextProtos() {
- return MakeNextProtos("http/1.1", "spdy/2", "spdy/3", NULL);
+ return MakeNextProtos("http/1.1", "spdy/2", "spdy/3", "spdy/3.1", NULL);
}
int GetIdleSocketCountInTransportSocketPool(net::HttpNetworkSession* session) {
@@ -9558,7 +9558,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, SpdyAlternateProtocolThroughProxy) {
HttpStreamFactory::set_use_alternate_protocols(true);
HttpStreamFactory::SetNextProtos(
MakeNextProtos(
- "http/1.1", "http1.1", "spdy/2", "spdy/3", "spdy", NULL));
+ "http/1.1", "http1.1", "spdy/2", "spdy/3", "spdy/3.1", "spdy", NULL));
SpdySessionDependencies session_deps(
ProxyService::CreateFixedFromPacResult("PROXY myproxy:70"));
diff --git a/net/http/http_server_properties.cc b/net/http/http_server_properties.cc
index 022c8e7..34d1617 100644
--- a/net/http/http_server_properties.cc
+++ b/net/http/http_server_properties.cc
@@ -16,6 +16,7 @@ const char* const kAlternateProtocolStrings[] = {
"npn-spdy/1",
"npn-spdy/2",
"npn-spdy/3",
+ "npn-spdy/3.1",
"quic/1"
};
const char kBrokenAlternateProtocol[] = "Broken";
diff --git a/net/http/http_server_properties.h b/net/http/http_server_properties.h
index 040763c..c4ced05 100644
--- a/net/http/http_server_properties.h
+++ b/net/http/http_server_properties.h
@@ -19,6 +19,7 @@ enum AlternateProtocol {
NPN_SPDY_1 = 0,
NPN_SPDY_2,
NPN_SPDY_3,
+ NPN_SPDY_3_1,
QUIC_1,
NUM_ALTERNATE_PROTOCOLS,
ALTERNATE_PROTOCOL_BROKEN, // The alternate protocol is known to be broken.
diff --git a/net/http/http_stream_factory.cc b/net/http/http_stream_factory.cc
index bd30444..7b4e8c0 100644
--- a/net/http/http_stream_factory.cc
+++ b/net/http/http_stream_factory.cc
@@ -169,6 +169,17 @@ void HttpStreamFactory::EnableNpnSpdy3() {
}
// static
+void HttpStreamFactory::EnableNpnSpdy31() {
+ set_use_alternate_protocols(true);
+ std::vector<std::string> next_protos;
+ next_protos.push_back("http/1.1");
+ next_protos.push_back("spdy/2");
+ next_protos.push_back("spdy/3");
+ next_protos.push_back("spdy/3.1");
+ SetNextProtos(next_protos);
+}
+
+// static
void HttpStreamFactory::SetNextProtos(const std::vector<std::string>& value) {
if (!next_protos_)
next_protos_ = new std::vector<std::string>;
@@ -187,6 +198,8 @@ void HttpStreamFactory::SetNextProtos(const std::vector<std::string>& value) {
enabled_protocols_[NPN_SPDY_2] = true;
} else if (value[i] == "spdy/3") {
enabled_protocols_[NPN_SPDY_3] = true;
+ } else if (value[i] == "spdy/3.1") {
+ enabled_protocols_[NPN_SPDY_3_1] = true;
} else if (value[i] == "quic/1") {
enabled_protocols_[QUIC_1] = true;
}
diff --git a/net/http/http_stream_factory.h b/net/http/http_stream_factory.h
index 5f6ef2f..a0355ae 100644
--- a/net/http/http_stream_factory.h
+++ b/net/http/http_stream_factory.h
@@ -239,6 +239,10 @@ class NET_EXPORT HttpStreamFactory {
// Sets http/1.1, spdy/2, and spdy/3 as the protocols supported via NPN.
static void EnableNpnSpdy3();
+ // Sets http/1.1, spdy/2, spdy/3, and spdy/3.1 as the protocols
+ // supported via NPN.
+ static void EnableNpnSpdy31();
+
// 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);