| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <list> | 10 #include <list> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "net/base/cert_database.h" | 17 #include "net/base/cert_database.h" |
| 18 #include "net/base/host_port_pair.h" | 18 #include "net/base/host_port_pair.h" |
| 19 #include "net/base/ip_endpoint.h" | 19 #include "net/base/ip_endpoint.h" |
| 20 #include "net/base/net_errors.h" | 20 #include "net/base/net_errors.h" |
| 21 #include "net/base/net_export.h" | 21 #include "net/base/net_export.h" |
| 22 #include "net/base/network_change_notifier.h" | 22 #include "net/base/network_change_notifier.h" |
| 23 #include "net/base/ssl_config_service.h" | 23 #include "net/base/ssl_config_service.h" |
| 24 #include "net/proxy/proxy_config.h" | 24 #include "net/proxy/proxy_config.h" |
| 25 #include "net/proxy/proxy_server.h" | 25 #include "net/proxy/proxy_server.h" |
| 26 #include "net/spdy/spdy_config_service.h" |
| 26 #include "net/spdy/spdy_settings_storage.h" | 27 #include "net/spdy/spdy_settings_storage.h" |
| 27 | 28 |
| 28 namespace net { | 29 namespace net { |
| 29 | 30 |
| 30 class AddressList; | 31 class AddressList; |
| 31 class BoundNetLog; | 32 class BoundNetLog; |
| 32 class ClientSocketHandle; | 33 class ClientSocketHandle; |
| 33 class HostResolver; | 34 class HostResolver; |
| 34 class HttpNetworkSession; | 35 class HttpNetworkSession; |
| 35 class SpdySession; | 36 class SpdySession; |
| 36 | 37 |
| 37 // This is a very simple pool for open SpdySessions. | 38 // This is a very simple pool for open SpdySessions. |
| 38 class NET_EXPORT SpdySessionPool | 39 class NET_EXPORT SpdySessionPool |
| 39 : public NetworkChangeNotifier::IPAddressObserver, | 40 : public NetworkChangeNotifier::IPAddressObserver, |
| 40 public SSLConfigService::Observer, | 41 public SSLConfigService::Observer, |
| 41 public CertDatabase::Observer { | 42 public CertDatabase::Observer { |
| 42 public: | 43 public: |
| 43 SpdySessionPool(HostResolver* host_resolver, | 44 SpdySessionPool(HostResolver* host_resolver, |
| 45 SpdyConfigService* spdy_config_service, |
| 44 SSLConfigService* ssl_config_service); | 46 SSLConfigService* ssl_config_service); |
| 45 virtual ~SpdySessionPool(); | 47 virtual ~SpdySessionPool(); |
| 46 | 48 |
| 47 // Either returns an existing SpdySession or creates a new SpdySession for | 49 // Either returns an existing SpdySession or creates a new SpdySession for |
| 48 // use. | 50 // use. |
| 49 scoped_refptr<SpdySession> Get( | 51 scoped_refptr<SpdySession> Get( |
| 50 const HostPortProxyPair& host_port_proxy_pair, | 52 const HostPortProxyPair& host_port_proxy_pair, |
| 51 const BoundNetLog& net_log); | 53 const BoundNetLog& net_log); |
| 52 | 54 |
| 53 // Only returns a SpdySession if it already exists. | 55 // Only returns a SpdySession if it already exists. |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 | 175 |
| 174 // This is our weak session pool - one session per domain. | 176 // This is our weak session pool - one session per domain. |
| 175 SpdySessionsMap sessions_; | 177 SpdySessionsMap sessions_; |
| 176 // A map of IPEndPoint aliases for sessions. | 178 // A map of IPEndPoint aliases for sessions. |
| 177 SpdyAliasMap aliases_; | 179 SpdyAliasMap aliases_; |
| 178 | 180 |
| 179 static size_t g_max_sessions_per_domain; | 181 static size_t g_max_sessions_per_domain; |
| 180 static bool g_force_single_domain; | 182 static bool g_force_single_domain; |
| 181 static bool g_enable_ip_pooling; | 183 static bool g_enable_ip_pooling; |
| 182 | 184 |
| 185 const scoped_refptr<SpdyConfigService> spdy_config_service_; |
| 183 const scoped_refptr<SSLConfigService> ssl_config_service_; | 186 const scoped_refptr<SSLConfigService> ssl_config_service_; |
| 184 HostResolver* const resolver_; | 187 HostResolver* const resolver_; |
| 185 | 188 |
| 186 // Defaults to true. May be controlled via SpdySessionPoolPeer for tests. | 189 // Defaults to true. May be controlled via SpdySessionPoolPeer for tests. |
| 187 bool verify_domain_authentication_; | 190 bool verify_domain_authentication_; |
| 188 | 191 |
| 189 DISALLOW_COPY_AND_ASSIGN(SpdySessionPool); | 192 DISALLOW_COPY_AND_ASSIGN(SpdySessionPool); |
| 190 }; | 193 }; |
| 191 | 194 |
| 192 } // namespace net | 195 } // namespace net |
| 193 | 196 |
| 194 #endif // NET_SPDY_SPDY_SESSION_POOL_H_ | 197 #endif // NET_SPDY_SPDY_SESSION_POOL_H_ |
| OLD | NEW |