| 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 // 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 | 11 |
| 12 #include "net/base/completion_callback.h" | 12 #include "net/base/completion_callback.h" |
| 13 #include "net/base/net_export.h" | 13 #include "net/base/net_export.h" |
| 14 #include "net/base/request_priority.h" | 14 #include "net/base/request_priority.h" |
| 15 #include "net/http/http_network_session.h" | 15 #include "net/http/http_network_session.h" |
| 16 | 16 |
| 17 class GURL; | 17 class GURL; |
| 18 | 18 |
| 19 namespace base { | 19 namespace base { |
| 20 class Value; | 20 class Value; |
| 21 namespace trace_event { |
| 22 class MemoryAllocatorDump; |
| 23 } |
| 21 } | 24 } |
| 22 | 25 |
| 23 namespace net { | 26 namespace net { |
| 24 | 27 |
| 25 typedef base::Callback<int(const AddressList&, const NetLogWithSource& net_log)> | 28 typedef base::Callback<int(const AddressList&, const NetLogWithSource& net_log)> |
| 26 OnHostResolutionCallback; | 29 OnHostResolutionCallback; |
| 27 | 30 |
| 28 class ClientSocketHandle; | 31 class ClientSocketHandle; |
| 29 class HostPortPair; | 32 class HostPortPair; |
| 30 class HttpNetworkSession; | 33 class HttpNetworkSession; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 virtual TransportClientSocketPool* GetTransportSocketPool() = 0; | 81 virtual TransportClientSocketPool* GetTransportSocketPool() = 0; |
| 79 virtual SSLClientSocketPool* GetSSLSocketPool() = 0; | 82 virtual SSLClientSocketPool* GetSSLSocketPool() = 0; |
| 80 virtual SOCKSClientSocketPool* GetSocketPoolForSOCKSProxy( | 83 virtual SOCKSClientSocketPool* GetSocketPoolForSOCKSProxy( |
| 81 const HostPortPair& socks_proxy) = 0; | 84 const HostPortPair& socks_proxy) = 0; |
| 82 virtual HttpProxyClientSocketPool* GetSocketPoolForHTTPProxy( | 85 virtual HttpProxyClientSocketPool* GetSocketPoolForHTTPProxy( |
| 83 const HostPortPair& http_proxy) = 0; | 86 const HostPortPair& http_proxy) = 0; |
| 84 virtual SSLClientSocketPool* GetSocketPoolForSSLWithProxy( | 87 virtual SSLClientSocketPool* GetSocketPoolForSSLWithProxy( |
| 85 const HostPortPair& proxy_server) = 0; | 88 const HostPortPair& proxy_server) = 0; |
| 86 // Creates a Value summary of the state of the socket pools. | 89 // Creates a Value summary of the state of the socket pools. |
| 87 virtual std::unique_ptr<base::Value> SocketPoolInfoToValue() const = 0; | 90 virtual std::unique_ptr<base::Value> SocketPoolInfoToValue() const = 0; |
| 91 virtual void PopulateAllocatorDump( |
| 92 base::trace_event::MemoryAllocatorDump* dump) const = 0; |
| 88 }; | 93 }; |
| 89 | 94 |
| 90 // A helper method that uses the passed in proxy information to initialize a | 95 // A helper method that uses the passed in proxy information to initialize a |
| 91 // ClientSocketHandle with the relevant socket pool. Use this method for | 96 // ClientSocketHandle with the relevant socket pool. Use this method for |
| 92 // HTTP/HTTPS requests. |ssl_config_for_origin| is only used if the request | 97 // HTTP/HTTPS requests. |ssl_config_for_origin| is only used if the request |
| 93 // uses SSL and |ssl_config_for_proxy| is used if the proxy server is HTTPS. | 98 // uses SSL and |ssl_config_for_proxy| is used if the proxy server is HTTPS. |
| 94 // |resolution_callback| will be invoked after the the hostname is | 99 // |resolution_callback| will be invoked after the the hostname is |
| 95 // resolved. If |resolution_callback| does not return OK, then the | 100 // resolved. If |resolution_callback| does not return OK, then the |
| 96 // connection will be aborted with that value. | 101 // connection will be aborted with that value. |
| 97 // If |expect_spdy| is true, then after the SSL handshake is complete, | 102 // If |expect_spdy| is true, then after the SSL handshake is complete, |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 bool expect_spdy, | 187 bool expect_spdy, |
| 183 const SSLConfig& ssl_config_for_origin, | 188 const SSLConfig& ssl_config_for_origin, |
| 184 const SSLConfig& ssl_config_for_proxy, | 189 const SSLConfig& ssl_config_for_proxy, |
| 185 PrivacyMode privacy_mode, | 190 PrivacyMode privacy_mode, |
| 186 const NetLogWithSource& net_log, | 191 const NetLogWithSource& net_log, |
| 187 int num_preconnect_streams); | 192 int num_preconnect_streams); |
| 188 | 193 |
| 189 } // namespace net | 194 } // namespace net |
| 190 | 195 |
| 191 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_MANAGER_H_ | 196 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_MANAGER_H_ |
| OLD | NEW |