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

Unified Diff: net/spdy/spdy_session.cc

Issue 129873010: Deprecate instead of close SPDY sessions upon network change. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
Index: net/spdy/spdy_session.cc
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc
index 9508f0e6af47da6326ecb732c14bdd86e3a4d314..ff45287028a45c683bbd6c541d2e97826e510824 100644
--- a/net/spdy/spdy_session.cc
+++ b/net/spdy/spdy_session.cc
@@ -2285,6 +2285,10 @@ void SpdySession::OnGoAway(SpdyStreamId last_accepted_stream_id,
active_streams_.size(),
unclaimed_pushed_streams_.size(),
status));
+ GoAway(last_accepted_stream_id, ERR_ABORTED);
+}
+
+void SpdySession::GoAway(SpdyStreamId last_accepted_stream_id, Error err) {
if (availability_state_ < STATE_GOING_AWAY) {
availability_state_ = STATE_GOING_AWAY;
// |pool_| will be NULL when |InitializeWithSocket()| is in the
@@ -2292,7 +2296,7 @@ void SpdySession::OnGoAway(SpdyStreamId last_accepted_stream_id,
if (pool_)
pool_->MakeSessionUnavailable(GetWeakPtr());
}
- StartGoingAway(last_accepted_stream_id, ERR_ABORTED);
+ StartGoingAway(last_accepted_stream_id, err);
// This is to handle the case when we already don't have any active
// streams (i.e., StartGoingAway() did nothing). Otherwise, we have
// active streams and so the last one being closed will finish the
@@ -2300,6 +2304,13 @@ void SpdySession::OnGoAway(SpdyStreamId last_accepted_stream_id,
MaybeFinishGoingAway();
}
+void SpdySession::Deprecate(Error err) {
+ SpdyStreamId highest_active_stream_id = 0;
+ if (active_streams_.size())
+ highest_active_stream_id = active_streams_.rbegin()->first;
+ GoAway(highest_active_stream_id, err);
+}
+
void SpdySession::OnPing(uint32 unique_id) {
CHECK(in_io_loop_);

Powered by Google App Engine
This is Rietveld 408576698