| 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 // 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_H_ | 9 #ifndef NET_SOCKET_CLIENT_SOCKET_POOL_MANAGER_H_ |
| 10 #define NET_SOCKET_CLIENT_SOCKET_POOL_MANAGER_H_ | 10 #define NET_SOCKET_CLIENT_SOCKET_POOL_MANAGER_H_ |
| 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/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 "base/stl_util-inl.h" | 17 #include "base/stl_util-inl.h" |
| 18 #include "base/template_util.h" | 18 #include "base/template_util.h" |
| 19 #include "base/threading/non_thread_safe.h" | 19 #include "base/threading/non_thread_safe.h" |
| 20 #include "net/base/cert_database.h" | 20 #include "net/base/cert_database.h" |
| 21 #include "net/base/completion_callback.h" | 21 #include "net/base/completion_callback.h" |
| 22 #include "net/base/net_api.h" | 22 #include "net/base/net_api.h" |
| 23 #include "net/base/request_priority.h" | 23 #include "net/base/request_priority.h" |
| 24 #include "net/socket/client_socket_pool_histograms.h" | 24 #include "net/socket/client_socket_pool_histograms.h" |
| 25 | 25 |
| 26 class GURL; | 26 class GURL; |
| 27 |
| 28 namespace base { |
| 27 class Value; | 29 class Value; |
| 30 } |
| 28 | 31 |
| 29 namespace net { | 32 namespace net { |
| 30 | 33 |
| 31 class BoundNetLog; | 34 class BoundNetLog; |
| 32 class CertVerifier; | 35 class CertVerifier; |
| 33 class ClientSocketFactory; | 36 class ClientSocketFactory; |
| 34 class ClientSocketHandle; | 37 class ClientSocketHandle; |
| 35 class ClientSocketPoolHistograms; | 38 class ClientSocketPoolHistograms; |
| 36 class DnsCertProvenanceChecker; | 39 class DnsCertProvenanceChecker; |
| 37 class DnsRRResolver; | 40 class DnsRRResolver; |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 const ProxyInfo& proxy_info, | 156 const ProxyInfo& proxy_info, |
| 154 bool force_spdy_over_ssl, | 157 bool force_spdy_over_ssl, |
| 155 bool want_spdy_over_npn, | 158 bool want_spdy_over_npn, |
| 156 const SSLConfig& ssl_config_for_origin, | 159 const SSLConfig& ssl_config_for_origin, |
| 157 const SSLConfig& ssl_config_for_proxy, | 160 const SSLConfig& ssl_config_for_proxy, |
| 158 const BoundNetLog& net_log, | 161 const BoundNetLog& net_log, |
| 159 int num_preconnect_streams); | 162 int num_preconnect_streams); |
| 160 | 163 |
| 161 // Creates a Value summary of the state of the socket pools. The caller is | 164 // Creates a Value summary of the state of the socket pools. The caller is |
| 162 // responsible for deleting the returned value. | 165 // responsible for deleting the returned value. |
| 163 Value* SocketPoolInfoToValue() const; | 166 base::Value* SocketPoolInfoToValue() const; |
| 164 | 167 |
| 165 // CertDatabase::Observer methods: | 168 // CertDatabase::Observer methods: |
| 166 virtual void OnUserCertAdded(const X509Certificate* cert); | 169 virtual void OnUserCertAdded(const X509Certificate* cert); |
| 167 virtual void OnCertTrustChanged(const X509Certificate* cert); | 170 virtual void OnCertTrustChanged(const X509Certificate* cert); |
| 168 | 171 |
| 169 private: | 172 private: |
| 170 friend class HttpNetworkSessionPeer; | 173 friend class HttpNetworkSessionPeer; |
| 171 | 174 |
| 172 typedef internal::OwnedPoolMap<HostPortPair, TransportClientSocketPool*> | 175 typedef internal::OwnedPoolMap<HostPortPair, TransportClientSocketPool*> |
| 173 TransportSocketPoolMap; | 176 TransportSocketPoolMap; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 | 219 |
| 217 ClientSocketPoolHistograms ssl_socket_pool_for_proxies_histograms_; | 220 ClientSocketPoolHistograms ssl_socket_pool_for_proxies_histograms_; |
| 218 SSLSocketPoolMap ssl_socket_pools_for_proxies_; | 221 SSLSocketPoolMap ssl_socket_pools_for_proxies_; |
| 219 | 222 |
| 220 DISALLOW_COPY_AND_ASSIGN(ClientSocketPoolManager); | 223 DISALLOW_COPY_AND_ASSIGN(ClientSocketPoolManager); |
| 221 }; | 224 }; |
| 222 | 225 |
| 223 } // namespace net | 226 } // namespace net |
| 224 | 227 |
| 225 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_MANAGER_H_ | 228 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_MANAGER_H_ |
| OLD | NEW |