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" |
11 #include "net/socket/socks_client_socket_pool.h" | 11 #include "net/socket/socks_client_socket_pool.h" |
12 #include "net/socket/ssl_client_socket_pool.h" | 12 #include "net/socket/ssl_client_socket_pool.h" |
13 #include "net/socket/transport_client_socket_pool.h" | 13 #include "net/socket/transport_client_socket_pool.h" |
14 #include "net/socket/websocket_transport_client_socket_pool.h" | |
14 #include "net/ssl/ssl_config_service.h" | 15 #include "net/ssl/ssl_config_service.h" |
15 | 16 |
16 namespace net { | 17 namespace net { |
17 | 18 |
18 namespace { | 19 namespace { |
19 | 20 |
20 // Appends information about all |socket_pools| to the end of |list|. | 21 // Appends information about all |socket_pools| to the end of |list|. |
21 template <class MapType> | 22 template <class MapType> |
22 void AddSocketPoolsToList(base::ListValue* list, | 23 void AddSocketPoolsToList(base::ListValue* list, |
23 const MapType& socket_pools, | 24 const MapType& socket_pools, |
(...skipping 26 matching lines...) Expand all Loading... | |
50 host_resolver_(host_resolver), | 51 host_resolver_(host_resolver), |
51 cert_verifier_(cert_verifier), | 52 cert_verifier_(cert_verifier), |
52 server_bound_cert_service_(server_bound_cert_service), | 53 server_bound_cert_service_(server_bound_cert_service), |
53 transport_security_state_(transport_security_state), | 54 transport_security_state_(transport_security_state), |
54 cert_transparency_verifier_(cert_transparency_verifier), | 55 cert_transparency_verifier_(cert_transparency_verifier), |
55 ssl_session_cache_shard_(ssl_session_cache_shard), | 56 ssl_session_cache_shard_(ssl_session_cache_shard), |
56 proxy_service_(proxy_service), | 57 proxy_service_(proxy_service), |
57 ssl_config_service_(ssl_config_service), | 58 ssl_config_service_(ssl_config_service), |
58 pool_type_(pool_type), | 59 pool_type_(pool_type), |
59 transport_pool_histograms_("TCP"), | 60 transport_pool_histograms_("TCP"), |
60 transport_socket_pool_(new TransportClientSocketPool( | 61 transport_socket_pool_( |
61 max_sockets_per_pool(pool_type), max_sockets_per_group(pool_type), | 62 pool_type == HttpNetworkSession::WEBSOCKET_SOCKET_POOL |
62 &transport_pool_histograms_, | 63 ? static_cast<TransportClientSocketPool*>( |
63 host_resolver, | 64 new WebSocketTransportClientSocketPool( |
64 socket_factory_, | 65 max_sockets_per_pool(pool_type), |
65 net_log)), | 66 max_sockets_per_group(pool_type), |
67 &transport_pool_histograms_, | |
68 host_resolver, | |
69 socket_factory_, | |
70 net_log)) | |
71 : new TransportClientSocketPool(max_sockets_per_pool(pool_type), | |
72 max_sockets_per_group(pool_type), | |
73 &transport_pool_histograms_, | |
74 host_resolver, | |
75 socket_factory_, | |
76 net_log)), | |
66 ssl_pool_histograms_("SSL2"), | 77 ssl_pool_histograms_("SSL2"), |
67 ssl_socket_pool_(new SSLClientSocketPool( | 78 ssl_socket_pool_(new SSLClientSocketPool(max_sockets_per_pool(pool_type), |
68 max_sockets_per_pool(pool_type), max_sockets_per_group(pool_type), | 79 max_sockets_per_group(pool_type), |
69 &ssl_pool_histograms_, | 80 &ssl_pool_histograms_, |
70 host_resolver, | 81 host_resolver, |
71 cert_verifier, | 82 cert_verifier, |
72 server_bound_cert_service, | 83 server_bound_cert_service, |
73 transport_security_state, | 84 transport_security_state, |
74 cert_transparency_verifier, | 85 cert_transparency_verifier, |
75 ssl_session_cache_shard, | 86 ssl_session_cache_shard, |
76 socket_factory, | 87 socket_factory, |
77 transport_socket_pool_.get(), | 88 transport_socket_pool_.get(), |
78 NULL /* no socks proxy */, | 89 NULL /* no socks proxy */, |
79 NULL /* no http proxy */, | 90 NULL /* no http proxy */, |
80 ssl_config_service, | 91 ssl_config_service, |
81 net_log)), | 92 net_log)), |
tyoshino (SeeGerritForStatus)
2014/05/22 05:20:03
please revert style only change so that reviewers
Adam Rice
2014/05/22 06:49:07
Done.
| |
82 transport_for_socks_pool_histograms_("TCPforSOCKS"), | 93 transport_for_socks_pool_histograms_("TCPforSOCKS"), |
83 socks_pool_histograms_("SOCK"), | 94 socks_pool_histograms_("SOCK"), |
84 transport_for_http_proxy_pool_histograms_("TCPforHTTPProxy"), | 95 transport_for_http_proxy_pool_histograms_("TCPforHTTPProxy"), |
85 transport_for_https_proxy_pool_histograms_("TCPforHTTPSProxy"), | 96 transport_for_https_proxy_pool_histograms_("TCPforHTTPSProxy"), |
86 ssl_for_https_proxy_pool_histograms_("SSLforHTTPSProxy"), | 97 ssl_for_https_proxy_pool_histograms_("SSLforHTTPSProxy"), |
87 http_proxy_pool_histograms_("HTTPProxy"), | 98 http_proxy_pool_histograms_("HTTPProxy"), |
88 ssl_socket_pool_for_proxies_histograms_("SSLForProxies") { | 99 ssl_socket_pool_for_proxies_histograms_("SSLForProxies") { |
89 CertDatabase::GetInstance()->AddObserver(this); | 100 CertDatabase::GetInstance()->AddObserver(this); |
90 } | 101 } |
91 | 102 |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
388 // We should not flush the socket pools if we added trust to a | 399 // We should not flush the socket pools if we added trust to a |
389 // cert. | 400 // cert. |
390 // | 401 // |
391 // Since the OnCACertChanged method doesn't tell us what | 402 // Since the OnCACertChanged method doesn't tell us what |
392 // kind of change it is, we have to flush the socket | 403 // kind of change it is, we have to flush the socket |
393 // pools to be safe. | 404 // pools to be safe. |
394 FlushSocketPoolsWithError(ERR_NETWORK_CHANGED); | 405 FlushSocketPoolsWithError(ERR_NETWORK_CHANGED); |
395 } | 406 } |
396 | 407 |
397 } // namespace net | 408 } // namespace net |
OLD | NEW |