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

Unified Diff: net/spdy/spdy_session.cc

Issue 9252029: SPDY - default to SPDY/2.1 protocol in unittests (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync with trunk Created 8 years, 11 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') | 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
===================================================================
--- net/spdy/spdy_session.cc (revision 119306)
+++ net/spdy/spdy_session.cc (working copy)
@@ -227,7 +227,8 @@
bool SpdySession::use_ssl_ = true;
// static
-bool SpdySession::use_flow_control_ = false;
+SpdySession::FlowControl SpdySession::use_flow_control_ =
+ SpdySession::kFlowControlBasedOnNPN;
// static
size_t SpdySession::init_max_concurrent_streams_ = 10;
@@ -282,7 +283,7 @@
trailing_ping_pending_(false),
check_ping_status_pending_(false),
need_to_send_ping_(false),
- flow_control_(use_flow_control_),
+ flow_control_(false),
initial_send_window_size_(spdy::kSpdyStreamInitialWindowSize),
initial_recv_window_size_(spdy::kSpdyStreamInitialWindowSize),
net_log_(BoundNetLog::Make(net_log, NetLog::SOURCE_SPDY_SESSION)),
@@ -293,6 +294,10 @@
make_scoped_refptr(
new NetLogSpdySessionParameter(host_port_proxy_pair_)));
+ // In unit tests, check if use_flow_control_ is enabled or disabled.
+ if (use_flow_control_ == SpdySession::kEnableFlowControl)
+ flow_control_ = true;
+
// TODO(mbelshe): consider randomization of the stream_hi_water_mark.
buffered_spdy_framer_.set_visitor(this);
@@ -344,8 +349,14 @@
SSLClientSocket* ssl_socket =
reinterpret_cast<SSLClientSocket*>(connection_->socket());
DCHECK(ssl_socket);
- if (ssl_socket->protocol_negotiated() == SSLClientSocket::kProtoSPDY21)
- flow_control_ = true;
+
+ // For SPDY 2.1 and above versions, flow control is enabled by default and
+ // for older versions, flow control is disabled by default. Unit tests can
+ // either enable or disable flow_control_ by setting the use_flow_control_.
+ if (ssl_socket->protocol_negotiated() >= SSLClientSocket::kProtoSPDY21)
+ flow_control_ = (use_flow_control_ != SpdySession::kDisableFlowControl);
+ else
+ flow_control_ = (use_flow_control_ == SpdySession::kEnableFlowControl);
}
// Write out any data that we might have to send, such as the settings frame.
« no previous file with comments | « net/spdy/spdy_session.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698