| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 namespace net { | 30 namespace net { |
| 31 | 31 |
| 32 class AddressList; | 32 class AddressList; |
| 33 class BoundNetLog; | 33 class BoundNetLog; |
| 34 class ClientSocketHandle; | 34 class ClientSocketHandle; |
| 35 class HostResolver; | 35 class HostResolver; |
| 36 class HttpServerProperties; | 36 class HttpServerProperties; |
| 37 class SpdySession; | 37 class SpdySession; |
| 38 class TransportSecurityState; | 38 class TransportSecurityState; |
| 39 class TrustedSpdyProxyProvider; |
| 39 | 40 |
| 40 // This is a very simple pool for open SpdySessions. | 41 // This is a very simple pool for open SpdySessions. |
| 41 class NET_EXPORT SpdySessionPool | 42 class NET_EXPORT SpdySessionPool |
| 42 : public NetworkChangeNotifier::IPAddressObserver, | 43 : public NetworkChangeNotifier::IPAddressObserver, |
| 43 public SSLConfigService::Observer, | 44 public SSLConfigService::Observer, |
| 44 public CertDatabase::Observer { | 45 public CertDatabase::Observer { |
| 45 public: | 46 public: |
| 46 typedef base::TimeTicks (*TimeFunc)(void); | 47 typedef base::TimeTicks (*TimeFunc)(void); |
| 47 | 48 |
| 48 // |default_protocol| may be kProtoUnknown (e.g., if SPDY is | 49 // |default_protocol| may be kProtoUnknown (e.g., if SPDY is |
| 49 // disabled), in which case it's set to a default value. Otherwise, | 50 // disabled), in which case it's set to a default value. Otherwise, |
| 50 // it must be a SPDY protocol. | 51 // it must be a SPDY protocol. |
| 51 SpdySessionPool( | 52 SpdySessionPool( |
| 52 HostResolver* host_resolver, | 53 HostResolver* host_resolver, |
| 53 SSLConfigService* ssl_config_service, | 54 SSLConfigService* ssl_config_service, |
| 54 const base::WeakPtr<HttpServerProperties>& http_server_properties, | 55 const base::WeakPtr<HttpServerProperties>& http_server_properties, |
| 55 TransportSecurityState* transport_security_state, | 56 TransportSecurityState* transport_security_state, |
| 56 bool enable_compression, | 57 bool enable_compression, |
| 57 bool enable_ping_based_connection_checking, | 58 bool enable_ping_based_connection_checking, |
| 58 NextProto default_protocol, | 59 NextProto default_protocol, |
| 59 size_t session_max_recv_window_size, | 60 size_t session_max_recv_window_size, |
| 60 size_t stream_max_recv_window_size, | 61 size_t stream_max_recv_window_size, |
| 61 size_t initial_max_concurrent_streams, | 62 size_t initial_max_concurrent_streams, |
| 62 SpdySessionPool::TimeFunc time_func, | 63 SpdySessionPool::TimeFunc time_func, |
| 63 const std::string& trusted_spdy_proxy); | 64 const base::WeakPtr<TrustedSpdyProxyProvider>& |
| 65 trusted_spdy_proxy_provider); |
| 64 ~SpdySessionPool() override; | 66 ~SpdySessionPool() override; |
| 65 | 67 |
| 66 // In the functions below, a session is "available" if this pool has | 68 // In the functions below, a session is "available" if this pool has |
| 67 // a reference to it and there is some SpdySessionKey for which | 69 // a reference to it and there is some SpdySessionKey for which |
| 68 // FindAvailableSession() will return it. A session is "unavailable" | 70 // FindAvailableSession() will return it. A session is "unavailable" |
| 69 // if this pool has a reference to it but it won't be returned by | 71 // if this pool has a reference to it but it won't be returned by |
| 70 // FindAvailableSession() for any SpdySessionKey; for example, this | 72 // FindAvailableSession() for any SpdySessionKey; for example, this |
| 71 // can happen when a session receives a GOAWAY frame and is still | 73 // can happen when a session receives a GOAWAY frame and is still |
| 72 // processing existing streams. | 74 // processing existing streams. |
| 73 | 75 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 bool verify_domain_authentication_; | 212 bool verify_domain_authentication_; |
| 211 bool enable_sending_initial_data_; | 213 bool enable_sending_initial_data_; |
| 212 bool enable_compression_; | 214 bool enable_compression_; |
| 213 bool enable_ping_based_connection_checking_; | 215 bool enable_ping_based_connection_checking_; |
| 214 const NextProto default_protocol_; | 216 const NextProto default_protocol_; |
| 215 size_t session_max_recv_window_size_; | 217 size_t session_max_recv_window_size_; |
| 216 size_t stream_max_recv_window_size_; | 218 size_t stream_max_recv_window_size_; |
| 217 size_t initial_max_concurrent_streams_; | 219 size_t initial_max_concurrent_streams_; |
| 218 TimeFunc time_func_; | 220 TimeFunc time_func_; |
| 219 | 221 |
| 220 // This SPDY proxy is allowed to push resources from origins that are | 222 // Returns the trusted SPDY proxy which is allowed to push resources from |
| 221 // different from those of their associated streams. | 223 // origins that are different from those of their associated streams in |
| 222 HostPortPair trusted_spdy_proxy_; | 224 // non-incognito sessions. |
| 225 const base::WeakPtr<TrustedSpdyProxyProvider> trusted_spdy_proxy_provider_; |
| 223 | 226 |
| 224 DISALLOW_COPY_AND_ASSIGN(SpdySessionPool); | 227 DISALLOW_COPY_AND_ASSIGN(SpdySessionPool); |
| 225 }; | 228 }; |
| 226 | 229 |
| 227 } // namespace net | 230 } // namespace net |
| 228 | 231 |
| 229 #endif // NET_SPDY_SPDY_SESSION_POOL_H_ | 232 #endif // NET_SPDY_SPDY_SESSION_POOL_H_ |
| OLD | NEW |