| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| 11 #include "base/profiler/scoped_tracker.h" | 11 #include "base/profiler/scoped_tracker.h" |
| 12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
| 13 #include "base/trace_event/trace_event.h" |
| 13 #include "base/values.h" | 14 #include "base/values.h" |
| 14 #include "net/base/address_list.h" | 15 #include "net/base/address_list.h" |
| 15 #include "net/http/http_network_session.h" | 16 #include "net/http/http_network_session.h" |
| 16 #include "net/http/http_server_properties.h" | 17 #include "net/http/http_server_properties.h" |
| 17 #include "net/spdy/spdy_session.h" | 18 #include "net/spdy/spdy_session.h" |
| 18 | 19 |
| 19 namespace net { | 20 namespace net { |
| 20 | 21 |
| 21 namespace { | 22 namespace { |
| 22 | 23 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 NetworkChangeNotifier::RemoveIPAddressObserver(this); | 82 NetworkChangeNotifier::RemoveIPAddressObserver(this); |
| 82 CertDatabase::GetInstance()->RemoveObserver(this); | 83 CertDatabase::GetInstance()->RemoveObserver(this); |
| 83 } | 84 } |
| 84 | 85 |
| 85 base::WeakPtr<SpdySession> SpdySessionPool::CreateAvailableSessionFromSocket( | 86 base::WeakPtr<SpdySession> SpdySessionPool::CreateAvailableSessionFromSocket( |
| 86 const SpdySessionKey& key, | 87 const SpdySessionKey& key, |
| 87 scoped_ptr<ClientSocketHandle> connection, | 88 scoped_ptr<ClientSocketHandle> connection, |
| 88 const BoundNetLog& net_log, | 89 const BoundNetLog& net_log, |
| 89 int certificate_error_code, | 90 int certificate_error_code, |
| 90 bool is_secure) { | 91 bool is_secure) { |
| 92 TRACE_EVENT0("net", "SpdySessionPool::CreateAvailableSessionFromSocket"); |
| 91 DCHECK_GE(default_protocol_, kProtoSPDYMinimumVersion); | 93 DCHECK_GE(default_protocol_, kProtoSPDYMinimumVersion); |
| 92 DCHECK_LE(default_protocol_, kProtoSPDYMaximumVersion); | 94 DCHECK_LE(default_protocol_, kProtoSPDYMaximumVersion); |
| 93 | 95 |
| 94 UMA_HISTOGRAM_ENUMERATION( | 96 UMA_HISTOGRAM_ENUMERATION( |
| 95 "Net.SpdySessionGet", IMPORTED_FROM_SOCKET, SPDY_SESSION_GET_MAX); | 97 "Net.SpdySessionGet", IMPORTED_FROM_SOCKET, SPDY_SESSION_GET_MAX); |
| 96 | 98 |
| 97 scoped_ptr<SpdySession> new_session(new SpdySession( | 99 scoped_ptr<SpdySession> new_session(new SpdySession( |
| 98 key, http_server_properties_, transport_security_state_, | 100 key, http_server_properties_, transport_security_state_, |
| 99 verify_domain_authentication_, enable_sending_initial_data_, | 101 verify_domain_authentication_, enable_sending_initial_data_, |
| 100 enable_ping_based_connection_checking_, enable_priority_dependencies_, | 102 enable_ping_based_connection_checking_, enable_priority_dependencies_, |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 | 448 |
| 447 if (idle_only && (*it)->is_active()) | 449 if (idle_only && (*it)->is_active()) |
| 448 continue; | 450 continue; |
| 449 | 451 |
| 450 (*it)->CloseSessionOnError(error, description); | 452 (*it)->CloseSessionOnError(error, description); |
| 451 DCHECK(!IsSessionAvailable(*it)); | 453 DCHECK(!IsSessionAvailable(*it)); |
| 452 } | 454 } |
| 453 } | 455 } |
| 454 | 456 |
| 455 } // namespace net | 457 } // namespace net |
| OLD | NEW |