| 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" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 : http_server_properties_(http_server_properties), | 47 : http_server_properties_(http_server_properties), |
| 48 transport_security_state_(transport_security_state), | 48 transport_security_state_(transport_security_state), |
| 49 ssl_config_service_(ssl_config_service), | 49 ssl_config_service_(ssl_config_service), |
| 50 resolver_(resolver), | 50 resolver_(resolver), |
| 51 enable_sending_initial_data_(true), | 51 enable_sending_initial_data_(true), |
| 52 enable_ping_based_connection_checking_( | 52 enable_ping_based_connection_checking_( |
| 53 enable_ping_based_connection_checking), | 53 enable_ping_based_connection_checking), |
| 54 session_max_recv_window_size_(session_max_recv_window_size), | 54 session_max_recv_window_size_(session_max_recv_window_size), |
| 55 stream_max_recv_window_size_(stream_max_recv_window_size), | 55 stream_max_recv_window_size_(stream_max_recv_window_size), |
| 56 time_func_(time_func), | 56 time_func_(time_func), |
| 57 push_delegate_(nullptr), |
| 57 proxy_delegate_(proxy_delegate) { | 58 proxy_delegate_(proxy_delegate) { |
| 58 NetworkChangeNotifier::AddIPAddressObserver(this); | 59 NetworkChangeNotifier::AddIPAddressObserver(this); |
| 59 if (ssl_config_service_.get()) | 60 if (ssl_config_service_.get()) |
| 60 ssl_config_service_->AddObserver(this); | 61 ssl_config_service_->AddObserver(this); |
| 61 CertDatabase::GetInstance()->AddObserver(this); | 62 CertDatabase::GetInstance()->AddObserver(this); |
| 62 } | 63 } |
| 63 | 64 |
| 64 SpdySessionPool::~SpdySessionPool() { | 65 SpdySessionPool::~SpdySessionPool() { |
| 65 CloseAllSessions(); | 66 CloseAllSessions(); |
| 66 | 67 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 83 bool is_secure) { | 84 bool is_secure) { |
| 84 TRACE_EVENT0("net", "SpdySessionPool::CreateAvailableSessionFromSocket"); | 85 TRACE_EVENT0("net", "SpdySessionPool::CreateAvailableSessionFromSocket"); |
| 85 | 86 |
| 86 UMA_HISTOGRAM_ENUMERATION( | 87 UMA_HISTOGRAM_ENUMERATION( |
| 87 "Net.SpdySessionGet", IMPORTED_FROM_SOCKET, SPDY_SESSION_GET_MAX); | 88 "Net.SpdySessionGet", IMPORTED_FROM_SOCKET, SPDY_SESSION_GET_MAX); |
| 88 | 89 |
| 89 std::unique_ptr<SpdySession> new_session(new SpdySession( | 90 std::unique_ptr<SpdySession> new_session(new SpdySession( |
| 90 key, http_server_properties_, transport_security_state_, | 91 key, http_server_properties_, transport_security_state_, |
| 91 enable_sending_initial_data_, enable_ping_based_connection_checking_, | 92 enable_sending_initial_data_, enable_ping_based_connection_checking_, |
| 92 session_max_recv_window_size_, stream_max_recv_window_size_, time_func_, | 93 session_max_recv_window_size_, stream_max_recv_window_size_, time_func_, |
| 93 proxy_delegate_, net_log.net_log())); | 94 push_delegate_, proxy_delegate_, net_log.net_log())); |
| 94 | 95 |
| 95 new_session->InitializeWithSocket(std::move(connection), this, is_secure); | 96 new_session->InitializeWithSocket(std::move(connection), this, is_secure); |
| 96 | 97 |
| 97 base::WeakPtr<SpdySession> available_session = new_session->GetWeakPtr(); | 98 base::WeakPtr<SpdySession> available_session = new_session->GetWeakPtr(); |
| 98 sessions_.insert(new_session.release()); | 99 sessions_.insert(new_session.release()); |
| 99 MapKeyToAvailableSession(key, available_session); | 100 MapKeyToAvailableSession(key, available_session); |
| 100 | 101 |
| 101 net_log.AddEvent( | 102 net_log.AddEvent( |
| 102 NetLogEventType::HTTP2_SESSION_POOL_IMPORTED_SESSION_FROM_SOCKET, | 103 NetLogEventType::HTTP2_SESSION_POOL_IMPORTED_SESSION_FROM_SOCKET, |
| 103 available_session->net_log().source().ToEventParametersCallback()); | 104 available_session->net_log().source().ToEventParametersCallback()); |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 | 428 |
| 428 if (idle_only && (*it)->is_active()) | 429 if (idle_only && (*it)->is_active()) |
| 429 continue; | 430 continue; |
| 430 | 431 |
| 431 (*it)->CloseSessionOnError(error, description); | 432 (*it)->CloseSessionOnError(error, description); |
| 432 DCHECK(!IsSessionAvailable(*it)); | 433 DCHECK(!IsSessionAvailable(*it)); |
| 433 } | 434 } |
| 434 } | 435 } |
| 435 | 436 |
| 436 } // namespace net | 437 } // namespace net |
| OLD | NEW |