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

Side by Side 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: Rename MakeUnavailable and update comment 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/spdy/spdy_session.h" 5 #include "net/spdy/spdy_session.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 2267 matching lines...) Expand 10 before | Expand all | Expand 10 after
2278 2278
2279 if (availability_state_ == STATE_CLOSED) 2279 if (availability_state_ == STATE_CLOSED)
2280 return; 2280 return;
2281 2281
2282 net_log_.AddEvent(NetLog::TYPE_SPDY_SESSION_GOAWAY, 2282 net_log_.AddEvent(NetLog::TYPE_SPDY_SESSION_GOAWAY,
2283 base::Bind(&NetLogSpdyGoAwayCallback, 2283 base::Bind(&NetLogSpdyGoAwayCallback,
2284 last_accepted_stream_id, 2284 last_accepted_stream_id,
2285 active_streams_.size(), 2285 active_streams_.size(),
2286 unclaimed_pushed_streams_.size(), 2286 unclaimed_pushed_streams_.size(),
2287 status)); 2287 status));
2288 MakeUnavailable();
2289 StartGoingAway(last_accepted_stream_id, ERR_ABORTED);
2290 // This is to handle the case when we already don't have any active
2291 // streams (i.e., StartGoingAway() did nothing). Otherwise, we have
2292 // active streams and so the last one being closed will finish the
2293 // going away process (see DeleteStream()).
2294 MaybeFinishGoingAway();
2295 }
2296
2297 void SpdySession::MakeUnavailable() {
akalin 2014/01/29 23:26:18 move this under CloseSessionAndError to match head
2288 if (availability_state_ < STATE_GOING_AWAY) { 2298 if (availability_state_ < STATE_GOING_AWAY) {
2289 availability_state_ = STATE_GOING_AWAY; 2299 availability_state_ = STATE_GOING_AWAY;
2290 // |pool_| will be NULL when |InitializeWithSocket()| is in the 2300 // |pool_| will be NULL when |InitializeWithSocket()| is in the
2291 // call stack. 2301 // call stack.
2292 if (pool_) 2302 if (pool_)
2293 pool_->MakeSessionUnavailable(GetWeakPtr()); 2303 pool_->MakeSessionUnavailable(GetWeakPtr());
2294 } 2304 }
2295 StartGoingAway(last_accepted_stream_id, ERR_ABORTED);
2296 // This is to handle the case when we already don't have any active
2297 // streams (i.e., StartGoingAway() did nothing). Otherwise, we have
2298 // active streams and so the last one being closed will finish the
2299 // going away process (see DeleteStream()).
2300 MaybeFinishGoingAway();
2301 } 2305 }
2302 2306
2303 void SpdySession::OnPing(uint32 unique_id) { 2307 void SpdySession::OnPing(uint32 unique_id) {
2304 CHECK(in_io_loop_); 2308 CHECK(in_io_loop_);
2305 2309
2306 if (availability_state_ == STATE_CLOSED) 2310 if (availability_state_ == STATE_CLOSED)
2307 return; 2311 return;
2308 2312
2309 net_log_.AddEvent( 2313 net_log_.AddEvent(
2310 NetLog::TYPE_SPDY_SESSION_PING, 2314 NetLog::TYPE_SPDY_SESSION_PING,
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
2946 if (!queue->empty()) { 2950 if (!queue->empty()) {
2947 SpdyStreamId stream_id = queue->front(); 2951 SpdyStreamId stream_id = queue->front();
2948 queue->pop_front(); 2952 queue->pop_front();
2949 return stream_id; 2953 return stream_id;
2950 } 2954 }
2951 } 2955 }
2952 return 0; 2956 return 0;
2953 } 2957 }
2954 2958
2955 } // namespace net 2959 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698