| 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 "net/base/completion_callback.h" | 13 #include "net/base/completion_callback.h" |
| 14 #include "net/base/net_export.h" | 14 #include "net/base/net_export.h" |
| 15 #include "net/base/request_priority.h" | 15 #include "net/base/request_priority.h" |
| 16 #include "net/http/http_network_session.h" |
| 16 | 17 |
| 17 class GURL; | 18 class GURL; |
| 18 | 19 |
| 19 namespace base { | 20 namespace base { |
| 20 class Value; | 21 class Value; |
| 21 } | 22 } |
| 22 | 23 |
| 23 namespace net { | 24 namespace net { |
| 24 | 25 |
| 25 class BoundNetLog; | 26 class BoundNetLog; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 40 enum DefaultMaxValues { kDefaultMaxSocketsPerProxyServer = 32 }; | 41 enum DefaultMaxValues { kDefaultMaxSocketsPerProxyServer = 32 }; |
| 41 | 42 |
| 42 class NET_EXPORT_PRIVATE ClientSocketPoolManager { | 43 class NET_EXPORT_PRIVATE ClientSocketPoolManager { |
| 43 public: | 44 public: |
| 44 ClientSocketPoolManager(); | 45 ClientSocketPoolManager(); |
| 45 virtual ~ClientSocketPoolManager(); | 46 virtual ~ClientSocketPoolManager(); |
| 46 | 47 |
| 47 // The setter methods below affect only newly created socket pools after the | 48 // The setter methods below affect only newly created socket pools after the |
| 48 // methods are called. Normally they should be called at program startup | 49 // methods are called. Normally they should be called at program startup |
| 49 // before any ClientSocketPoolManagerImpl is created. | 50 // before any ClientSocketPoolManagerImpl is created. |
| 50 static int max_sockets_per_pool(); | 51 static int max_sockets_per_pool(HttpNetworkSession::SocketPoolType pool_type); |
| 51 static void set_max_sockets_per_pool(int socket_count); | 52 static void set_max_sockets_per_pool( |
| 53 HttpNetworkSession::SocketPoolType pool_type, |
| 54 int socket_count); |
| 52 | 55 |
| 53 static int max_sockets_per_group(); | 56 static int max_sockets_per_group( |
| 54 static void set_max_sockets_per_group(int socket_count); | 57 HttpNetworkSession::SocketPoolType pool_type); |
| 58 static void set_max_sockets_per_group( |
| 59 HttpNetworkSession::SocketPoolType pool_type, |
| 60 int socket_count); |
| 55 | 61 |
| 56 static int max_sockets_per_proxy_server(); | 62 static int max_sockets_per_proxy_server( |
| 57 static void set_max_sockets_per_proxy_server(int socket_count); | 63 HttpNetworkSession::SocketPoolType pool_type); |
| 64 static void set_max_sockets_per_proxy_server( |
| 65 HttpNetworkSession::SocketPoolType pool_type, |
| 66 int socket_count); |
| 58 | 67 |
| 59 virtual void FlushSocketPools() = 0; | 68 virtual void FlushSocketPools() = 0; |
| 60 virtual void CloseIdleSockets() = 0; | 69 virtual void CloseIdleSockets() = 0; |
| 61 virtual TransportClientSocketPool* GetTransportSocketPool() = 0; | 70 virtual TransportClientSocketPool* GetTransportSocketPool() = 0; |
| 62 virtual SSLClientSocketPool* GetSSLSocketPool() = 0; | 71 virtual SSLClientSocketPool* GetSSLSocketPool() = 0; |
| 63 virtual SOCKSClientSocketPool* GetSocketPoolForSOCKSProxy( | 72 virtual SOCKSClientSocketPool* GetSocketPoolForSOCKSProxy( |
| 64 const HostPortPair& socks_proxy) = 0; | 73 const HostPortPair& socks_proxy) = 0; |
| 65 virtual HttpProxyClientSocketPool* GetSocketPoolForHTTPProxy( | 74 virtual HttpProxyClientSocketPool* GetSocketPoolForHTTPProxy( |
| 66 const HostPortPair& http_proxy) = 0; | 75 const HostPortPair& http_proxy) = 0; |
| 67 virtual SSLClientSocketPool* GetSocketPoolForSSLWithProxy( | 76 virtual SSLClientSocketPool* GetSocketPoolForSSLWithProxy( |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 bool force_spdy_over_ssl, | 125 bool force_spdy_over_ssl, |
| 117 bool want_spdy_over_npn, | 126 bool want_spdy_over_npn, |
| 118 const SSLConfig& ssl_config_for_origin, | 127 const SSLConfig& ssl_config_for_origin, |
| 119 const SSLConfig& ssl_config_for_proxy, | 128 const SSLConfig& ssl_config_for_proxy, |
| 120 const BoundNetLog& net_log, | 129 const BoundNetLog& net_log, |
| 121 int num_preconnect_streams); | 130 int num_preconnect_streams); |
| 122 | 131 |
| 123 } // namespace net | 132 } // namespace net |
| 124 | 133 |
| 125 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_MANAGER_H_ | 134 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_MANAGER_H_ |
| OLD | NEW |