| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // ClientSocketPoolManager manages access to all ClientSocketPools. It's a | 5 // ClientSocketPoolManager manages access to all ClientSocketPools. It's a |
| 6 // simple container for all of them. Most importantly, it handles the lifetime | 6 // simple container for all of them. Most importantly, it handles the lifetime |
| 7 // and destruction order properly. | 7 // and destruction order properly. |
| 8 | 8 |
| 9 #ifndef NET_SOCKET_CLIENT_SOCKET_POOL_MANAGER_ | 9 #ifndef NET_SOCKET_CLIENT_SOCKET_POOL_MANAGER_ |
| 10 #define NET_SOCKET_CLIENT_SOCKET_POOL_MANAGER_ | 10 #define NET_SOCKET_CLIENT_SOCKET_POOL_MANAGER_ |
| 11 #pragma once | 11 #pragma once |
| 12 | 12 |
| 13 #include <map> | 13 #include <map> |
| 14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
| 15 #include "base/non_thread_safe.h" | 15 #include "base/non_thread_safe.h" |
| 16 #include "base/ref_counted.h" | 16 #include "base/ref_counted.h" |
| 17 #include "base/scoped_ptr.h" | 17 #include "base/scoped_ptr.h" |
| 18 #include "base/template_util.h" | 18 #include "base/template_util.h" |
| 19 #include "base/stl_util-inl.h" | 19 #include "base/stl_util-inl.h" |
| 20 #include "net/socket/client_socket_pool_histograms.h" | 20 #include "net/socket/client_socket_pool_histograms.h" |
| 21 | 21 |
| 22 class Value; | 22 class Value; |
| 23 | 23 |
| 24 namespace net { | 24 namespace net { |
| 25 | 25 |
| 26 class ClientSocketFactory; | 26 class ClientSocketFactory; |
| 27 class ClientSocketPoolHistograms; | 27 class ClientSocketPoolHistograms; |
| 28 class DnsRRResolver; |
| 28 class HostPortPair; | 29 class HostPortPair; |
| 29 class HttpProxyClientSocketPool; | 30 class HttpProxyClientSocketPool; |
| 30 class HostResolver; | 31 class HostResolver; |
| 31 class NetLog; | 32 class NetLog; |
| 32 class ProxyService; | 33 class ProxyService; |
| 33 class SOCKSClientSocketPool; | 34 class SOCKSClientSocketPool; |
| 34 class SSLClientSocketPool; | 35 class SSLClientSocketPool; |
| 35 class SSLConfigService; | 36 class SSLConfigService; |
| 36 class TCPClientSocketPool; | 37 class TCPClientSocketPool; |
| 37 | 38 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 51 } | 52 } |
| 52 }; | 53 }; |
| 53 | 54 |
| 54 } // internal | 55 } // internal |
| 55 | 56 |
| 56 class ClientSocketPoolManager : public NonThreadSafe { | 57 class ClientSocketPoolManager : public NonThreadSafe { |
| 57 public: | 58 public: |
| 58 ClientSocketPoolManager(NetLog* net_log, | 59 ClientSocketPoolManager(NetLog* net_log, |
| 59 ClientSocketFactory* socket_factory, | 60 ClientSocketFactory* socket_factory, |
| 60 HostResolver* host_resolver, | 61 HostResolver* host_resolver, |
| 62 DnsRRResolver* dnsrr_resolver, |
| 61 ProxyService* proxy_service, | 63 ProxyService* proxy_service, |
| 62 SSLConfigService* ssl_config_service); | 64 SSLConfigService* ssl_config_service); |
| 63 ~ClientSocketPoolManager(); | 65 ~ClientSocketPoolManager(); |
| 64 | 66 |
| 65 void FlushSocketPools(); | 67 void FlushSocketPools(); |
| 66 | 68 |
| 67 TCPClientSocketPool* tcp_socket_pool() { return tcp_socket_pool_.get(); } | 69 TCPClientSocketPool* tcp_socket_pool() { return tcp_socket_pool_.get(); } |
| 68 | 70 |
| 69 SSLClientSocketPool* ssl_socket_pool() { return ssl_socket_pool_.get(); } | 71 SSLClientSocketPool* ssl_socket_pool() { return ssl_socket_pool_.get(); } |
| 70 | 72 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 93 typedef internal::OwnedPoolMap<HostPortPair, SOCKSClientSocketPool*> | 95 typedef internal::OwnedPoolMap<HostPortPair, SOCKSClientSocketPool*> |
| 94 SOCKSSocketPoolMap; | 96 SOCKSSocketPoolMap; |
| 95 typedef internal::OwnedPoolMap<HostPortPair, HttpProxyClientSocketPool*> | 97 typedef internal::OwnedPoolMap<HostPortPair, HttpProxyClientSocketPool*> |
| 96 HTTPProxySocketPoolMap; | 98 HTTPProxySocketPoolMap; |
| 97 typedef internal::OwnedPoolMap<HostPortPair, SSLClientSocketPool*> | 99 typedef internal::OwnedPoolMap<HostPortPair, SSLClientSocketPool*> |
| 98 SSLSocketPoolMap; | 100 SSLSocketPoolMap; |
| 99 | 101 |
| 100 NetLog* const net_log_; | 102 NetLog* const net_log_; |
| 101 ClientSocketFactory* const socket_factory_; | 103 ClientSocketFactory* const socket_factory_; |
| 102 HostResolver* const host_resolver_; | 104 HostResolver* const host_resolver_; |
| 105 DnsRRResolver* dnsrr_resolver_; |
| 103 const scoped_refptr<ProxyService> proxy_service_; | 106 const scoped_refptr<ProxyService> proxy_service_; |
| 104 const scoped_refptr<SSLConfigService> ssl_config_service_; | 107 const scoped_refptr<SSLConfigService> ssl_config_service_; |
| 105 | 108 |
| 106 // Note: this ordering is important. | 109 // Note: this ordering is important. |
| 107 | 110 |
| 108 ClientSocketPoolHistograms tcp_pool_histograms_; | 111 ClientSocketPoolHistograms tcp_pool_histograms_; |
| 109 scoped_ptr<TCPClientSocketPool> tcp_socket_pool_; | 112 scoped_ptr<TCPClientSocketPool> tcp_socket_pool_; |
| 110 | 113 |
| 111 ClientSocketPoolHistograms ssl_pool_histograms_; | 114 ClientSocketPoolHistograms ssl_pool_histograms_; |
| 112 scoped_ptr<SSLClientSocketPool> ssl_socket_pool_; | 115 scoped_ptr<SSLClientSocketPool> ssl_socket_pool_; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 131 | 134 |
| 132 ClientSocketPoolHistograms ssl_socket_pool_for_proxies_histograms_; | 135 ClientSocketPoolHistograms ssl_socket_pool_for_proxies_histograms_; |
| 133 SSLSocketPoolMap ssl_socket_pools_for_proxies_; | 136 SSLSocketPoolMap ssl_socket_pools_for_proxies_; |
| 134 | 137 |
| 135 DISALLOW_COPY_AND_ASSIGN(ClientSocketPoolManager); | 138 DISALLOW_COPY_AND_ASSIGN(ClientSocketPoolManager); |
| 136 }; | 139 }; |
| 137 | 140 |
| 138 } // namespace net | 141 } // namespace net |
| 139 | 142 |
| 140 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_MANAGER_ | 143 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_MANAGER_ |
| OLD | NEW |