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