Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(585)

Side by Side Diff: net/socket/client_socket_pool_manager_impl.cc

Issue 240873003: Create WebSocketTransportClientSocketPool (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 ? new WebSocketTransportClientSocketPool(
63 host_resolver, 64 max_sockets_per_pool(pool_type),
64 socket_factory_, 65 max_sockets_per_group(pool_type),
65 net_log)), 66 &transport_pool_histograms_,
67 host_resolver,
68 socket_factory_,
69 net_log)
70 : new TransportClientSocketPool(max_sockets_per_pool(pool_type),
71 max_sockets_per_group(pool_type),
72 &transport_pool_histograms_,
73 host_resolver,
74 socket_factory_,
75 net_log)),
66 ssl_pool_histograms_("SSL2"), 76 ssl_pool_histograms_("SSL2"),
67 ssl_socket_pool_(new SSLClientSocketPool( 77 ssl_socket_pool_(new SSLClientSocketPool(
68 max_sockets_per_pool(pool_type), max_sockets_per_group(pool_type), 78 max_sockets_per_pool(pool_type), max_sockets_per_group(pool_type),
69 &ssl_pool_histograms_, 79 &ssl_pool_histograms_,
70 host_resolver, 80 host_resolver,
71 cert_verifier, 81 cert_verifier,
72 server_bound_cert_service, 82 server_bound_cert_service,
73 transport_security_state, 83 transport_security_state,
74 cert_transparency_verifier, 84 cert_transparency_verifier,
75 ssl_session_cache_shard, 85 ssl_session_cache_shard,
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 // We should not flush the socket pools if we added trust to a 398 // We should not flush the socket pools if we added trust to a
389 // cert. 399 // cert.
390 // 400 //
391 // Since the OnCACertChanged method doesn't tell us what 401 // Since the OnCACertChanged method doesn't tell us what
392 // kind of change it is, we have to flush the socket 402 // kind of change it is, we have to flush the socket
393 // pools to be safe. 403 // pools to be safe.
394 FlushSocketPoolsWithError(ERR_NETWORK_CHANGED); 404 FlushSocketPoolsWithError(ERR_NETWORK_CHANGED);
395 } 405 }
396 406
397 } // namespace net 407 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698