| 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 13 matching lines...) Expand all Loading... |
| 24 IMPORTED_FROM_SOCKET = 3, | 24 IMPORTED_FROM_SOCKET = 3, |
| 25 SPDY_SESSION_GET_MAX = 4 | 25 SPDY_SESSION_GET_MAX = 4 |
| 26 }; | 26 }; |
| 27 | 27 |
| 28 } // namespace | 28 } // namespace |
| 29 | 29 |
| 30 SpdySessionPool::SpdySessionPool( | 30 SpdySessionPool::SpdySessionPool( |
| 31 HostResolver* resolver, | 31 HostResolver* resolver, |
| 32 SSLConfigService* ssl_config_service, | 32 SSLConfigService* ssl_config_service, |
| 33 const base::WeakPtr<HttpServerProperties>& http_server_properties, | 33 const base::WeakPtr<HttpServerProperties>& http_server_properties, |
| 34 TransportSecurityState* transport_security_state, |
| 34 bool force_single_domain, | 35 bool force_single_domain, |
| 35 bool enable_compression, | 36 bool enable_compression, |
| 36 bool enable_ping_based_connection_checking, | 37 bool enable_ping_based_connection_checking, |
| 37 NextProto default_protocol, | 38 NextProto default_protocol, |
| 38 size_t stream_initial_recv_window_size, | 39 size_t stream_initial_recv_window_size, |
| 39 size_t initial_max_concurrent_streams, | 40 size_t initial_max_concurrent_streams, |
| 40 size_t max_concurrent_streams_limit, | 41 size_t max_concurrent_streams_limit, |
| 41 SpdySessionPool::TimeFunc time_func, | 42 SpdySessionPool::TimeFunc time_func, |
| 42 const std::string& trusted_spdy_proxy) | 43 const std::string& trusted_spdy_proxy) |
| 43 : http_server_properties_(http_server_properties), | 44 : http_server_properties_(http_server_properties), |
| 45 transport_security_state_(transport_security_state), |
| 44 ssl_config_service_(ssl_config_service), | 46 ssl_config_service_(ssl_config_service), |
| 45 resolver_(resolver), | 47 resolver_(resolver), |
| 46 verify_domain_authentication_(true), | 48 verify_domain_authentication_(true), |
| 47 enable_sending_initial_data_(true), | 49 enable_sending_initial_data_(true), |
| 48 force_single_domain_(force_single_domain), | 50 force_single_domain_(force_single_domain), |
| 49 enable_compression_(enable_compression), | 51 enable_compression_(enable_compression), |
| 50 enable_ping_based_connection_checking_( | 52 enable_ping_based_connection_checking_( |
| 51 enable_ping_based_connection_checking), | 53 enable_ping_based_connection_checking), |
| 52 // TODO(akalin): Force callers to have a valid value of | 54 // TODO(akalin): Force callers to have a valid value of |
| 53 // |default_protocol_|. | 55 // |default_protocol_|. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 bool is_secure) { | 93 bool is_secure) { |
| 92 DCHECK_GE(default_protocol_, kProtoSPDYMinimumVersion); | 94 DCHECK_GE(default_protocol_, kProtoSPDYMinimumVersion); |
| 93 DCHECK_LE(default_protocol_, kProtoSPDYMaximumVersion); | 95 DCHECK_LE(default_protocol_, kProtoSPDYMaximumVersion); |
| 94 | 96 |
| 95 UMA_HISTOGRAM_ENUMERATION( | 97 UMA_HISTOGRAM_ENUMERATION( |
| 96 "Net.SpdySessionGet", IMPORTED_FROM_SOCKET, SPDY_SESSION_GET_MAX); | 98 "Net.SpdySessionGet", IMPORTED_FROM_SOCKET, SPDY_SESSION_GET_MAX); |
| 97 | 99 |
| 98 scoped_ptr<SpdySession> new_session( | 100 scoped_ptr<SpdySession> new_session( |
| 99 new SpdySession(key, | 101 new SpdySession(key, |
| 100 http_server_properties_, | 102 http_server_properties_, |
| 103 transport_security_state_, |
| 101 verify_domain_authentication_, | 104 verify_domain_authentication_, |
| 102 enable_sending_initial_data_, | 105 enable_sending_initial_data_, |
| 103 enable_compression_, | 106 enable_compression_, |
| 104 enable_ping_based_connection_checking_, | 107 enable_ping_based_connection_checking_, |
| 105 default_protocol_, | 108 default_protocol_, |
| 106 stream_initial_recv_window_size_, | 109 stream_initial_recv_window_size_, |
| 107 initial_max_concurrent_streams_, | 110 initial_max_concurrent_streams_, |
| 108 max_concurrent_streams_limit_, | 111 max_concurrent_streams_limit_, |
| 109 time_func_, | 112 time_func_, |
| 110 trusted_spdy_proxy_, | 113 trusted_spdy_proxy_, |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 | 398 |
| 396 if (idle_only && (*it)->is_active()) | 399 if (idle_only && (*it)->is_active()) |
| 397 continue; | 400 continue; |
| 398 | 401 |
| 399 (*it)->CloseSessionOnError(error, description); | 402 (*it)->CloseSessionOnError(error, description); |
| 400 DCHECK(!IsSessionAvailable(*it)); | 403 DCHECK(!IsSessionAvailable(*it)); |
| 401 } | 404 } |
| 402 } | 405 } |
| 403 | 406 |
| 404 } // namespace net | 407 } // namespace net |
| OLD | NEW |