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 #include "net/socket/client_socket_pool_manager_impl.h" | 5 #include "net/socket/client_socket_pool_manager_impl.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "net/http/http_network_session.h" | 9 #include "net/http/http_network_session.h" |
10 #include "net/http/http_proxy_client_socket_pool.h" | 10 #include "net/http/http_proxy_client_socket_pool.h" |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 new TransportClientSocketPool( | 270 new TransportClientSocketPool( |
271 max_sockets_per_proxy_server(pool_type_), | 271 max_sockets_per_proxy_server(pool_type_), |
272 max_sockets_per_group(pool_type_), | 272 max_sockets_per_group(pool_type_), |
273 &transport_for_https_proxy_pool_histograms_, | 273 &transport_for_https_proxy_pool_histograms_, |
274 host_resolver_, | 274 host_resolver_, |
275 socket_factory_, | 275 socket_factory_, |
276 net_log_))); | 276 net_log_))); |
277 DCHECK(tcp_https_ret.second); | 277 DCHECK(tcp_https_ret.second); |
278 | 278 |
279 std::pair<SSLSocketPoolMap::iterator, bool> ssl_https_ret = | 279 std::pair<SSLSocketPoolMap::iterator, bool> ssl_https_ret = |
280 ssl_socket_pools_for_https_proxies_.insert( | 280 ssl_socket_pools_for_https_proxies_.insert(std::make_pair( |
281 std::make_pair( | 281 http_proxy, |
282 http_proxy, | 282 new SSLClientSocketPool(max_sockets_per_proxy_server(pool_type_), |
283 new SSLClientSocketPool( | 283 max_sockets_per_group(pool_type_), |
284 max_sockets_per_proxy_server(pool_type_), | 284 &ssl_for_https_proxy_pool_histograms_, |
285 max_sockets_per_group(pool_type_), | 285 host_resolver_, |
286 &ssl_for_https_proxy_pool_histograms_, | 286 cert_verifier_, |
287 host_resolver_, | 287 server_bound_cert_service_, |
288 cert_verifier_, | 288 transport_security_state_, |
289 server_bound_cert_service_, | 289 ssl_session_cache_shard_, |
290 transport_security_state_, | 290 socket_factory_, |
291 ssl_session_cache_shard_, | 291 tcp_https_ret.first->second /* https proxy */, |
292 socket_factory_, | 292 NULL /* no socks proxy */, |
293 tcp_https_ret.first->second /* https proxy */, | 293 NULL /* no http proxy */, |
294 NULL /* no socks proxy */, | 294 ssl_config_service_.get(), |
295 NULL /* no http proxy */, | 295 net_log_))); |
296 ssl_config_service_, net_log_))); | |
297 DCHECK(tcp_https_ret.second); | 296 DCHECK(tcp_https_ret.second); |
298 | 297 |
299 std::pair<HTTPProxySocketPoolMap::iterator, bool> ret = | 298 std::pair<HTTPProxySocketPoolMap::iterator, bool> ret = |
300 http_proxy_socket_pools_.insert( | 299 http_proxy_socket_pools_.insert( |
301 std::make_pair( | 300 std::make_pair( |
302 http_proxy, | 301 http_proxy, |
303 new HttpProxyClientSocketPool( | 302 new HttpProxyClientSocketPool( |
304 max_sockets_per_proxy_server(pool_type_), | 303 max_sockets_per_proxy_server(pool_type_), |
305 max_sockets_per_group(pool_type_), | 304 max_sockets_per_group(pool_type_), |
306 &http_proxy_pool_histograms_, | 305 &http_proxy_pool_histograms_, |
(...skipping 18 matching lines...) Expand all Loading... |
325 &ssl_pool_histograms_, | 324 &ssl_pool_histograms_, |
326 host_resolver_, | 325 host_resolver_, |
327 cert_verifier_, | 326 cert_verifier_, |
328 server_bound_cert_service_, | 327 server_bound_cert_service_, |
329 transport_security_state_, | 328 transport_security_state_, |
330 ssl_session_cache_shard_, | 329 ssl_session_cache_shard_, |
331 socket_factory_, | 330 socket_factory_, |
332 NULL, /* no tcp pool, we always go through a proxy */ | 331 NULL, /* no tcp pool, we always go through a proxy */ |
333 GetSocketPoolForSOCKSProxy(proxy_server), | 332 GetSocketPoolForSOCKSProxy(proxy_server), |
334 GetSocketPoolForHTTPProxy(proxy_server), | 333 GetSocketPoolForHTTPProxy(proxy_server), |
335 ssl_config_service_, | 334 ssl_config_service_.get(), |
336 net_log_); | 335 net_log_); |
337 | 336 |
338 std::pair<SSLSocketPoolMap::iterator, bool> ret = | 337 std::pair<SSLSocketPoolMap::iterator, bool> ret = |
339 ssl_socket_pools_for_proxies_.insert(std::make_pair(proxy_server, | 338 ssl_socket_pools_for_proxies_.insert(std::make_pair(proxy_server, |
340 new_pool)); | 339 new_pool)); |
341 | 340 |
342 return ret.first->second; | 341 return ret.first->second; |
343 } | 342 } |
344 | 343 |
345 Value* ClientSocketPoolManagerImpl::SocketPoolInfoToValue() const { | 344 Value* ClientSocketPoolManagerImpl::SocketPoolInfoToValue() const { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 // We should not flush the socket pools if we added trust to a | 383 // We should not flush the socket pools if we added trust to a |
385 // cert. | 384 // cert. |
386 // | 385 // |
387 // Since the OnCertTrustChanged method doesn't tell us what | 386 // Since the OnCertTrustChanged method doesn't tell us what |
388 // kind of trust change it is, we have to flush the socket | 387 // kind of trust change it is, we have to flush the socket |
389 // pools to be safe. | 388 // pools to be safe. |
390 FlushSocketPoolsWithError(ERR_NETWORK_CHANGED); | 389 FlushSocketPoolsWithError(ERR_NETWORK_CHANGED); |
391 } | 390 } |
392 | 391 |
393 } // namespace net | 392 } // namespace net |
OLD | NEW |