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 #include "net/socket/client_socket_pool_manager.h" | 9 #include "net/socket/client_socket_pool_manager.h" |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 } | 49 } |
50 } | 50 } |
51 | 51 |
52 } // namespace | 52 } // namespace |
53 | 53 |
54 ClientSocketPoolManager::ClientSocketPoolManager( | 54 ClientSocketPoolManager::ClientSocketPoolManager( |
55 NetLog* net_log, | 55 NetLog* net_log, |
56 ClientSocketFactory* socket_factory, | 56 ClientSocketFactory* socket_factory, |
57 HostResolver* host_resolver, | 57 HostResolver* host_resolver, |
58 DnsRRResolver* dnsrr_resolver, | 58 DnsRRResolver* dnsrr_resolver, |
| 59 SSLHostInfoFactory* ssl_host_info_factory, |
59 ProxyService* proxy_service, | 60 ProxyService* proxy_service, |
60 SSLConfigService* ssl_config_service) | 61 SSLConfigService* ssl_config_service) |
61 : net_log_(net_log), | 62 : net_log_(net_log), |
62 socket_factory_(socket_factory), | 63 socket_factory_(socket_factory), |
63 host_resolver_(host_resolver), | 64 host_resolver_(host_resolver), |
64 dnsrr_resolver_(dnsrr_resolver), | 65 dnsrr_resolver_(dnsrr_resolver), |
| 66 ssl_host_info_factory_(ssl_host_info_factory), |
65 proxy_service_(proxy_service), | 67 proxy_service_(proxy_service), |
66 ssl_config_service_(ssl_config_service), | 68 ssl_config_service_(ssl_config_service), |
67 tcp_pool_histograms_("TCP"), | 69 tcp_pool_histograms_("TCP"), |
68 tcp_socket_pool_(new TCPClientSocketPool( | 70 tcp_socket_pool_(new TCPClientSocketPool( |
69 g_max_sockets, g_max_sockets_per_group, | 71 g_max_sockets, g_max_sockets_per_group, |
70 &tcp_pool_histograms_, | 72 &tcp_pool_histograms_, |
71 host_resolver, | 73 host_resolver, |
72 socket_factory_, | 74 socket_factory_, |
73 net_log)), | 75 net_log)), |
74 ssl_pool_histograms_("SSL2"), | 76 ssl_pool_histograms_("SSL2"), |
75 ssl_socket_pool_(new SSLClientSocketPool( | 77 ssl_socket_pool_(new SSLClientSocketPool( |
76 g_max_sockets, g_max_sockets_per_group, | 78 g_max_sockets, g_max_sockets_per_group, |
77 &ssl_pool_histograms_, | 79 &ssl_pool_histograms_, |
78 host_resolver, | 80 host_resolver, |
79 dnsrr_resolver, | 81 dnsrr_resolver, |
| 82 ssl_host_info_factory, |
80 socket_factory, | 83 socket_factory, |
81 tcp_socket_pool_.get(), | 84 tcp_socket_pool_.get(), |
82 NULL /* no socks proxy */, | 85 NULL /* no socks proxy */, |
83 NULL /* no http proxy */, | 86 NULL /* no http proxy */, |
84 ssl_config_service, | 87 ssl_config_service, |
85 net_log)), | 88 net_log)), |
86 tcp_for_socks_pool_histograms_("TCPforSOCKS"), | 89 tcp_for_socks_pool_histograms_("TCPforSOCKS"), |
87 socks_pool_histograms_("SOCK"), | 90 socks_pool_histograms_("SOCK"), |
88 tcp_for_http_proxy_pool_histograms_("TCPforHTTPProxy"), | 91 tcp_for_http_proxy_pool_histograms_("TCPforHTTPProxy"), |
89 tcp_for_https_proxy_pool_histograms_("TCPforHTTPSProxy"), | 92 tcp_for_https_proxy_pool_histograms_("TCPforHTTPSProxy"), |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 | 221 |
219 std::pair<SSLSocketPoolMap::iterator, bool> ssl_https_ret = | 222 std::pair<SSLSocketPoolMap::iterator, bool> ssl_https_ret = |
220 ssl_socket_pools_for_https_proxies_.insert( | 223 ssl_socket_pools_for_https_proxies_.insert( |
221 std::make_pair( | 224 std::make_pair( |
222 http_proxy, | 225 http_proxy, |
223 new SSLClientSocketPool( | 226 new SSLClientSocketPool( |
224 g_max_sockets_per_proxy_server, g_max_sockets_per_group, | 227 g_max_sockets_per_proxy_server, g_max_sockets_per_group, |
225 &ssl_for_https_proxy_pool_histograms_, | 228 &ssl_for_https_proxy_pool_histograms_, |
226 host_resolver_, | 229 host_resolver_, |
227 dnsrr_resolver_, | 230 dnsrr_resolver_, |
| 231 ssl_host_info_factory_, |
228 socket_factory_, | 232 socket_factory_, |
229 tcp_https_ret.first->second /* https proxy */, | 233 tcp_https_ret.first->second /* https proxy */, |
230 NULL /* no socks proxy */, | 234 NULL /* no socks proxy */, |
231 NULL /* no http proxy */, | 235 NULL /* no http proxy */, |
232 ssl_config_service_, net_log_))); | 236 ssl_config_service_, net_log_))); |
233 DCHECK(tcp_https_ret.second); | 237 DCHECK(tcp_https_ret.second); |
234 | 238 |
235 std::pair<HTTPProxySocketPoolMap::iterator, bool> ret = | 239 std::pair<HTTPProxySocketPoolMap::iterator, bool> ret = |
236 http_proxy_socket_pools_.insert( | 240 http_proxy_socket_pools_.insert( |
237 std::make_pair( | 241 std::make_pair( |
(...skipping 14 matching lines...) Expand all Loading... |
252 SSLSocketPoolMap::const_iterator it = | 256 SSLSocketPoolMap::const_iterator it = |
253 ssl_socket_pools_for_proxies_.find(proxy_server); | 257 ssl_socket_pools_for_proxies_.find(proxy_server); |
254 if (it != ssl_socket_pools_for_proxies_.end()) | 258 if (it != ssl_socket_pools_for_proxies_.end()) |
255 return it->second; | 259 return it->second; |
256 | 260 |
257 SSLClientSocketPool* new_pool = new SSLClientSocketPool( | 261 SSLClientSocketPool* new_pool = new SSLClientSocketPool( |
258 g_max_sockets_per_proxy_server, g_max_sockets_per_group, | 262 g_max_sockets_per_proxy_server, g_max_sockets_per_group, |
259 &ssl_pool_histograms_, | 263 &ssl_pool_histograms_, |
260 host_resolver_, | 264 host_resolver_, |
261 dnsrr_resolver_, | 265 dnsrr_resolver_, |
| 266 ssl_host_info_factory_, |
262 socket_factory_, | 267 socket_factory_, |
263 NULL, /* no tcp pool, we always go through a proxy */ | 268 NULL, /* no tcp pool, we always go through a proxy */ |
264 GetSocketPoolForSOCKSProxy(proxy_server), | 269 GetSocketPoolForSOCKSProxy(proxy_server), |
265 GetSocketPoolForHTTPProxy(proxy_server), | 270 GetSocketPoolForHTTPProxy(proxy_server), |
266 ssl_config_service_, | 271 ssl_config_service_, |
267 net_log_); | 272 net_log_); |
268 | 273 |
269 std::pair<SSLSocketPoolMap::iterator, bool> ret = | 274 std::pair<SSLSocketPoolMap::iterator, bool> ret = |
270 ssl_socket_pools_for_proxies_.insert(std::make_pair(proxy_server, | 275 ssl_socket_pools_for_proxies_.insert(std::make_pair(proxy_server, |
271 new_pool)); | 276 new_pool)); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 // Third parameter is false because |ssl_socket_pools_for_proxies_| use | 327 // Third parameter is false because |ssl_socket_pools_for_proxies_| use |
323 // socket pools in |http_proxy_socket_pools_| and |socks_socket_pools_|. | 328 // socket pools in |http_proxy_socket_pools_| and |socks_socket_pools_|. |
324 AddSocketPoolsToList(list, | 329 AddSocketPoolsToList(list, |
325 ssl_socket_pools_for_proxies_, | 330 ssl_socket_pools_for_proxies_, |
326 "ssl_socket_pool_for_proxies", | 331 "ssl_socket_pool_for_proxies", |
327 false); | 332 false); |
328 return list; | 333 return list; |
329 } | 334 } |
330 | 335 |
331 } // namespace net | 336 } // namespace net |
OLD | NEW |