OLD | NEW |
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_pool.h" | 5 #include "net/spdy/spdy_session_pool.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "net/base/address_list.h" | 10 #include "net/base/address_list.h" |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 it != current_sessions.end(); ++it) { | 277 it != current_sessions.end(); ++it) { |
278 if (!*it) | 278 if (!*it) |
279 continue; | 279 continue; |
280 | 280 |
281 // For OSs that terminate TCP connections upon relevant network changes, | 281 // For OSs that terminate TCP connections upon relevant network changes, |
282 // attempt to preserve active streams by marking all sessions as going | 282 // attempt to preserve active streams by marking all sessions as going |
283 // away, rather than explicitly closing them. Streams may still fail due | 283 // away, rather than explicitly closing them. Streams may still fail due |
284 // to a generated TCP reset. | 284 // to a generated TCP reset. |
285 #if defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_IOS) | 285 #if defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_IOS) |
286 (*it)->MakeUnavailable(); | 286 (*it)->MakeUnavailable(); |
287 (*it)->StartGoingAway(kLastStreamId, OK); | 287 (*it)->StartGoingAway(kLastStreamId, ERR_NETWORK_CHANGED); |
288 (*it)->MaybeFinishGoingAway(); | 288 (*it)->MaybeFinishGoingAway(); |
289 #else | 289 #else |
290 (*it)->CloseSessionOnError(ERR_NETWORK_CHANGED, | 290 (*it)->CloseSessionOnError(ERR_NETWORK_CHANGED, |
291 "Closing current sessions."); | 291 "Closing current sessions."); |
292 DCHECK((*it)->IsDraining()); | 292 DCHECK((*it)->IsDraining()); |
293 #endif // defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_IOS) | 293 #endif // defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_IOS) |
294 DCHECK(!IsSessionAvailable(*it)); | 294 DCHECK(!IsSessionAvailable(*it)); |
295 } | 295 } |
296 http_server_properties_->ClearAllSpdySettings(); | 296 http_server_properties_->ClearAllSpdySettings(); |
297 } | 297 } |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 | 395 |
396 if (idle_only && (*it)->is_active()) | 396 if (idle_only && (*it)->is_active()) |
397 continue; | 397 continue; |
398 | 398 |
399 (*it)->CloseSessionOnError(error, description); | 399 (*it)->CloseSessionOnError(error, description); |
400 DCHECK(!IsSessionAvailable(*it)); | 400 DCHECK(!IsSessionAvailable(*it)); |
401 } | 401 } |
402 } | 402 } |
403 | 403 |
404 } // namespace net | 404 } // namespace net |
OLD | NEW |