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

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: Address comments 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
« no previous file with comments | « net/spdy/spdy_session.h ('k') | net/spdy/spdy_session_spdy3_unittest.cc » ('j') | 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 aedb042c7a2bc9a7420cf2501cdbb918a94702b2..9943190e72dd5117fcde19b242da7d05b02941c6 100644
--- a/net/spdy/spdy_session.cc
+++ b/net/spdy/spdy_session.cc
@@ -52,6 +52,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,
@@ -426,8 +441,7 @@ net::Error SpdySession::InitializeWithSocket(
}
DCHECK_GE(protocol, kProtoSPDY2);
- DCHECK_LE(protocol, kProtoSPDY31);
- int version = (protocol >= kProtoSPDY3) ? kSpdyVersion3 : kSpdyVersion2;
+ DCHECK_LE(protocol, kProtoSPDY4a1);
if (protocol >= kProtoSPDY31) {
flow_control_state_ = FLOW_CONTROL_STREAM_AND_SESSION;
session_send_window_size_ = kSpdySessionInitialWindowSize;
@@ -438,8 +452,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);
« no previous file with comments | « net/spdy/spdy_session.h ('k') | net/spdy/spdy_session_spdy3_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698