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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
271 // host_port_proxy_pair (not an alias). | 271 // host_port_proxy_pair (not an alias). |
272 const SpdySessionKey& key = it->first; | 272 const SpdySessionKey& key = it->first; |
273 const SpdySessionKey& session_key = it->second->spdy_session_key(); | 273 const SpdySessionKey& session_key = it->second->spdy_session_key(); |
274 if (key.Equals(session_key)) | 274 if (key.Equals(session_key)) |
275 list->Append(it->second->GetInfoAsValue()); | 275 list->Append(it->second->GetInfoAsValue()); |
276 } | 276 } |
277 return list; | 277 return list; |
278 } | 278 } |
279 | 279 |
280 void SpdySessionPool::OnIPAddressChanged() { | 280 void SpdySessionPool::OnIPAddressChanged() { |
281 CloseCurrentSessions(ERR_NETWORK_CHANGED); | 281 WeakSessionList current_sessions = GetCurrentSessions(); |
282 for (WeakSessionList::const_iterator it = current_sessions.begin(); | |
283 it != current_sessions.end(); ++it) { | |
284 if (!*it) | |
285 continue; | |
286 | |
287 (*it)->Deprecate(ERR_NETWORK_CHANGED); | |
Johnny
2014/01/23 16:14:31
Possible to call SpdySessionPool::MakeSessionUnava
| |
288 DCHECK(!IsSessionAvailable(*it)); | |
289 } | |
282 http_server_properties_->ClearAllSpdySettings(); | 290 http_server_properties_->ClearAllSpdySettings(); |
283 } | 291 } |
284 | 292 |
285 void SpdySessionPool::OnSSLConfigChanged() { | 293 void SpdySessionPool::OnSSLConfigChanged() { |
286 CloseCurrentSessions(ERR_NETWORK_CHANGED); | 294 CloseCurrentSessions(ERR_NETWORK_CHANGED); |
287 } | 295 } |
288 | 296 |
289 void SpdySessionPool::OnCertAdded(const X509Certificate* cert) { | 297 void SpdySessionPool::OnCertAdded(const X509Certificate* cert) { |
290 CloseCurrentSessions(ERR_CERT_DATABASE_CHANGED); | 298 CloseCurrentSessions(ERR_CERT_DATABASE_CHANGED); |
291 } | 299 } |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
382 if (idle_only && (*it)->is_active()) | 390 if (idle_only && (*it)->is_active()) |
383 continue; | 391 continue; |
384 | 392 |
385 (*it)->CloseSessionOnError(error, description); | 393 (*it)->CloseSessionOnError(error, description); |
386 DCHECK(!IsSessionAvailable(*it)); | 394 DCHECK(!IsSessionAvailable(*it)); |
387 DCHECK(!*it); | 395 DCHECK(!*it); |
388 } | 396 } |
389 } | 397 } |
390 | 398 |
391 } // namespace net | 399 } // namespace net |
OLD | NEW |