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

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: sync (r249187) Created 6 years, 10 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_pool.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 ae3053f7c1a9de5cdf2e4157ffd882e84f5fe6e5..7603a5e86028ba4f09c08f0757fb35664d04f093 100644
--- a/net/spdy/spdy_session.cc
+++ b/net/spdy/spdy_session.cc
@@ -1615,6 +1615,16 @@ void SpdySession::CloseSessionOnError(Error err,
ignore_result(DoCloseSession(err, description));
}
+void SpdySession::MakeUnavailable() {
+ if (availability_state_ < STATE_GOING_AWAY) {
+ availability_state_ = STATE_GOING_AWAY;
+ // |pool_| will be NULL when |InitializeWithSocket()| is in the
+ // call stack.
+ if (pool_)
+ pool_->MakeSessionUnavailable(GetWeakPtr());
+ }
+}
+
base::Value* SpdySession::GetInfoAsValue() const {
base::DictionaryValue* dict = new base::DictionaryValue();
@@ -2371,13 +2381,7 @@ void SpdySession::OnGoAway(SpdyStreamId last_accepted_stream_id,
active_streams_.size(),
unclaimed_pushed_streams_.size(),
status));
- if (availability_state_ < STATE_GOING_AWAY) {
- availability_state_ = STATE_GOING_AWAY;
- // |pool_| will be NULL when |InitializeWithSocket()| is in the
- // call stack.
- if (pool_)
- pool_->MakeSessionUnavailable(GetWeakPtr());
- }
+ MakeUnavailable();
StartGoingAway(last_accepted_stream_id, ERR_ABORTED);
// This is to handle the case when we already don't have any active
// streams (i.e., StartGoingAway() did nothing). Otherwise, we have
« no previous file with comments | « net/spdy/spdy_session.h ('k') | net/spdy/spdy_session_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698