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 #ifndef NET_SPDY_SPDY_SESSION_POOL_H_ | 5 #ifndef NET_SPDY_SPDY_SESSION_POOL_H_ |
6 #define NET_SPDY_SPDY_SESSION_POOL_H_ | 6 #define NET_SPDY_SPDY_SESSION_POOL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "net/ssl/ssl_config_service.h" | 27 #include "net/ssl/ssl_config_service.h" |
28 | 28 |
29 namespace net { | 29 namespace net { |
30 | 30 |
31 class AddressList; | 31 class AddressList; |
32 class BoundNetLog; | 32 class BoundNetLog; |
33 class ClientSocketHandle; | 33 class ClientSocketHandle; |
34 class HostResolver; | 34 class HostResolver; |
35 class HttpServerProperties; | 35 class HttpServerProperties; |
36 class SpdySession; | 36 class SpdySession; |
37 class TransportSecurityState; | |
38 | 37 |
39 // This is a very simple pool for open SpdySessions. | 38 // This is a very simple pool for open SpdySessions. |
40 class NET_EXPORT SpdySessionPool | 39 class NET_EXPORT SpdySessionPool |
41 : public NetworkChangeNotifier::IPAddressObserver, | 40 : public NetworkChangeNotifier::IPAddressObserver, |
42 public SSLConfigService::Observer, | 41 public SSLConfigService::Observer, |
43 public CertDatabase::Observer { | 42 public CertDatabase::Observer { |
44 public: | 43 public: |
45 typedef base::TimeTicks (*TimeFunc)(void); | 44 typedef base::TimeTicks (*TimeFunc)(void); |
46 | 45 |
47 // |default_protocol| may be kProtoUnknown (e.g., if SPDY is | 46 // |default_protocol| may be kProtoUnknown (e.g., if SPDY is |
48 // disabled), in which case it's set to a default value. Otherwise, | 47 // disabled), in which case it's set to a default value. Otherwise, |
49 // it must be a SPDY protocol. | 48 // it must be a SPDY protocol. |
50 SpdySessionPool( | 49 SpdySessionPool( |
51 HostResolver* host_resolver, | 50 HostResolver* host_resolver, |
52 SSLConfigService* ssl_config_service, | 51 SSLConfigService* ssl_config_service, |
53 const base::WeakPtr<HttpServerProperties>& http_server_properties, | 52 const base::WeakPtr<HttpServerProperties>& http_server_properties, |
54 TransportSecurityState* transport_security_state, | |
55 bool force_single_domain, | 53 bool force_single_domain, |
56 bool enable_compression, | 54 bool enable_compression, |
57 bool enable_ping_based_connection_checking, | 55 bool enable_ping_based_connection_checking, |
58 NextProto default_protocol, | 56 NextProto default_protocol, |
59 size_t stream_initial_recv_window_size, | 57 size_t stream_initial_recv_window_size, |
60 size_t initial_max_concurrent_streams, | 58 size_t initial_max_concurrent_streams, |
61 size_t max_concurrent_streams_limit, | 59 size_t max_concurrent_streams_limit, |
62 SpdySessionPool::TimeFunc time_func, | 60 SpdySessionPool::TimeFunc time_func, |
63 const std::string& trusted_spdy_proxy); | 61 const std::string& trusted_spdy_proxy); |
64 virtual ~SpdySessionPool(); | 62 virtual ~SpdySessionPool(); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 // Close only the currently existing SpdySessions with |error|. Let | 184 // Close only the currently existing SpdySessions with |error|. Let |
187 // any new ones created while this method is running continue to | 185 // any new ones created while this method is running continue to |
188 // live. If |idle_only| is true only idle sessions are closed. | 186 // live. If |idle_only| is true only idle sessions are closed. |
189 void CloseCurrentSessionsHelper( | 187 void CloseCurrentSessionsHelper( |
190 Error error, | 188 Error error, |
191 const std::string& description, | 189 const std::string& description, |
192 bool idle_only); | 190 bool idle_only); |
193 | 191 |
194 const base::WeakPtr<HttpServerProperties> http_server_properties_; | 192 const base::WeakPtr<HttpServerProperties> http_server_properties_; |
195 | 193 |
196 TransportSecurityState* transport_security_state_; | |
197 | |
198 // The set of all sessions. This is a superset of the sessions in | 194 // The set of all sessions. This is a superset of the sessions in |
199 // |available_sessions_|. | 195 // |available_sessions_|. |
200 // | 196 // |
201 // |sessions_| owns all its SpdySession objects. | 197 // |sessions_| owns all its SpdySession objects. |
202 SessionSet sessions_; | 198 SessionSet sessions_; |
203 | 199 |
204 // This is a map of available sessions by key. A session may appear | 200 // This is a map of available sessions by key. A session may appear |
205 // more than once in this map if it has aliases. | 201 // more than once in this map if it has aliases. |
206 AvailableSessionMap available_sessions_; | 202 AvailableSessionMap available_sessions_; |
207 | 203 |
(...skipping 20 matching lines...) Expand all Loading... |
228 // This SPDY proxy is allowed to push resources from origins that are | 224 // This SPDY proxy is allowed to push resources from origins that are |
229 // different from those of their associated streams. | 225 // different from those of their associated streams. |
230 HostPortPair trusted_spdy_proxy_; | 226 HostPortPair trusted_spdy_proxy_; |
231 | 227 |
232 DISALLOW_COPY_AND_ASSIGN(SpdySessionPool); | 228 DISALLOW_COPY_AND_ASSIGN(SpdySessionPool); |
233 }; | 229 }; |
234 | 230 |
235 } // namespace net | 231 } // namespace net |
236 | 232 |
237 #endif // NET_SPDY_SPDY_SESSION_POOL_H_ | 233 #endif // NET_SPDY_SPDY_SESSION_POOL_H_ |
OLD | NEW |