| 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/trace_event/trace_event.h" |
| 14 #include "base/values.h" | 14 #include "base/values.h" |
| 15 #include "net/base/address_list.h" | 15 #include "net/base/address_list.h" |
| 16 #include "net/base/trace_constants.h" |
| 16 #include "net/http/http_network_session.h" | 17 #include "net/http/http_network_session.h" |
| 17 #include "net/http/http_server_properties.h" | 18 #include "net/http/http_server_properties.h" |
| 18 #include "net/log/net_log_event_type.h" | 19 #include "net/log/net_log_event_type.h" |
| 19 #include "net/log/net_log_source.h" | 20 #include "net/log/net_log_source.h" |
| 20 #include "net/log/net_log_with_source.h" | 21 #include "net/log/net_log_with_source.h" |
| 21 #include "net/spdy/spdy_session.h" | 22 #include "net/spdy/spdy_session.h" |
| 22 | 23 |
| 23 namespace net { | 24 namespace net { |
| 24 | 25 |
| 25 namespace { | 26 namespace { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 ssl_config_service_->RemoveObserver(this); | 75 ssl_config_service_->RemoveObserver(this); |
| 75 NetworkChangeNotifier::RemoveIPAddressObserver(this); | 76 NetworkChangeNotifier::RemoveIPAddressObserver(this); |
| 76 CertDatabase::GetInstance()->RemoveObserver(this); | 77 CertDatabase::GetInstance()->RemoveObserver(this); |
| 77 } | 78 } |
| 78 | 79 |
| 79 base::WeakPtr<SpdySession> SpdySessionPool::CreateAvailableSessionFromSocket( | 80 base::WeakPtr<SpdySession> SpdySessionPool::CreateAvailableSessionFromSocket( |
| 80 const SpdySessionKey& key, | 81 const SpdySessionKey& key, |
| 81 std::unique_ptr<ClientSocketHandle> connection, | 82 std::unique_ptr<ClientSocketHandle> connection, |
| 82 const NetLogWithSource& net_log, | 83 const NetLogWithSource& net_log, |
| 83 bool is_secure) { | 84 bool is_secure) { |
| 84 TRACE_EVENT0("net", "SpdySessionPool::CreateAvailableSessionFromSocket"); | 85 TRACE_EVENT0(kNetTracingCategory, |
| 86 "SpdySessionPool::CreateAvailableSessionFromSocket"); |
| 85 | 87 |
| 86 UMA_HISTOGRAM_ENUMERATION( | 88 UMA_HISTOGRAM_ENUMERATION( |
| 87 "Net.SpdySessionGet", IMPORTED_FROM_SOCKET, SPDY_SESSION_GET_MAX); | 89 "Net.SpdySessionGet", IMPORTED_FROM_SOCKET, SPDY_SESSION_GET_MAX); |
| 88 | 90 |
| 89 std::unique_ptr<SpdySession> new_session(new SpdySession( | 91 std::unique_ptr<SpdySession> new_session(new SpdySession( |
| 90 key, http_server_properties_, transport_security_state_, | 92 key, http_server_properties_, transport_security_state_, |
| 91 enable_sending_initial_data_, enable_ping_based_connection_checking_, | 93 enable_sending_initial_data_, enable_ping_based_connection_checking_, |
| 92 session_max_recv_window_size_, stream_max_recv_window_size_, time_func_, | 94 session_max_recv_window_size_, stream_max_recv_window_size_, time_func_, |
| 93 proxy_delegate_, net_log.net_log())); | 95 proxy_delegate_, net_log.net_log())); |
| 94 | 96 |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 | 429 |
| 428 if (idle_only && (*it)->is_active()) | 430 if (idle_only && (*it)->is_active()) |
| 429 continue; | 431 continue; |
| 430 | 432 |
| 431 (*it)->CloseSessionOnError(error, description); | 433 (*it)->CloseSessionOnError(error, description); |
| 432 DCHECK(!IsSessionAvailable(*it)); | 434 DCHECK(!IsSessionAvailable(*it)); |
| 433 } | 435 } |
| 434 } | 436 } |
| 435 | 437 |
| 436 } // namespace net | 438 } // namespace net |
| OLD | NEW |