Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1569)

Unified Diff: net/spdy/spdy_session.cc

Issue 13845012: [SPDY] Add flag and about:flags entry for SPDY/4 alpha 1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« net/http/http_stream_factory.cc ('K') | « net/spdy/spdy_session.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_session.cc
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc
index fede4ce89f8d21e53dff4dcad45051d6a4336eb3..5e2860651c771bb560d46972d596d564be27e2e6 100644
--- a/net/spdy/spdy_session.cc
+++ b/net/spdy/spdy_session.cc
@@ -53,6 +53,21 @@ const SpdyStreamId kFirstStreamId = 1;
// Minimum seconds that unclaimed pushed streams will be kept in memory.
const int kMinPushedStreamLifetimeSeconds = 300;
+int NPNToSpdyVersion(NextProto next_proto) {
+ switch (next_proto) {
+ case kProtoSPDY2:
+ return kSpdyVersion2;
+ case kProtoSPDY3:
+ case kProtoSPDY31:
+ return kSpdyVersion3;
+ case kProtoSPDY4a1:
+ return kSpdyVersion4;
+ default:
+ NOTREACHED();
+ }
+ return kSpdyVersion2;
+}
+
base::Value* NetLogSpdySynCallback(const SpdyHeaderBlock* headers,
bool fin,
bool unidirectional,
@@ -404,10 +419,7 @@ net::Error SpdySession::InitializeWithSocket(
host_port_pair().ToString()));
}
- DCHECK_GE(protocol, kProtoSPDY2);
- DCHECK_LE(protocol, kProtoSPDY31);
- int version = (protocol >= kProtoSPDY3) ? kSpdyVersion3 : kSpdyVersion2;
- if (protocol >= kProtoSPDY31) {
+ if (protocol >= kProtoSPDY4a1) {
flow_control_state_ = FLOW_CONTROL_STREAM_AND_SESSION;
session_send_window_size_ = kSpdySessionInitialWindowSize;
session_recv_window_size_ = kSpdySessionInitialWindowSize;
@@ -417,8 +429,8 @@ net::Error SpdySession::InitializeWithSocket(
flow_control_state_ = FLOW_CONTROL_NONE;
}
- buffered_spdy_framer_.reset(new BufferedSpdyFramer(version,
- enable_compression_));
+ buffered_spdy_framer_.reset(
+ new BufferedSpdyFramer(NPNToSpdyVersion(protocol), enable_compression_));
buffered_spdy_framer_->set_visitor(this);
SendInitialSettings();
UMA_HISTOGRAM_ENUMERATION("Net.SpdyVersion", protocol, kProtoMaximumVersion);
« net/http/http_stream_factory.cc ('K') | « net/spdy/spdy_session.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698