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
3 // found in the LICENSE file.
5 #include "net/socket/ssl_client_socket_pool.h"
8 #include "base/bind_helpers.h"
9 #include "base/metrics/field_trial.h"
10 #include "base/metrics/histogram.h"
11 #include "base/metrics/sparse_histogram.h"
12 #include "base/values.h"
13 #include "net/base/host_port_pair.h"
14 #include "net/base/net_errors.h"
15 #include "net/http/http_proxy_client_socket.h"
16 #include "net/http/http_proxy_client_socket_pool.h"
17 #include "net/socket/client_socket_factory.h"
18 #include "net/socket/client_socket_handle.h"
19 #include "net/socket/socks_client_socket_pool.h"
20 #include "net/socket/ssl_client_socket.h"
21 #include "net/socket/transport_client_socket_pool.h"
22 #include "net/ssl/ssl_cert_request_info.h"
23 #include "net/ssl/ssl_connection_status_flags.h"
24 #include "net/ssl/ssl_info.h"
28 SSLSocketParams::SSLSocketParams(
29 const scoped_refptr
<TransportSocketParams
>& direct_params
,
30 const scoped_refptr
<SOCKSSocketParams
>& socks_proxy_params
,
31 const scoped_refptr
<HttpProxySocketParams
>& http_proxy_params
,
32 const HostPortPair
& host_and_port
,
33 const SSLConfig
& ssl_config
,
34 PrivacyMode privacy_mode
,
36 bool force_spdy_over_ssl
,
37 bool want_spdy_over_npn
)
38 : direct_params_(direct_params
),
39 socks_proxy_params_(socks_proxy_params
),
40 http_proxy_params_(http_proxy_params
),
41 host_and_port_(host_and_port
),
42 ssl_config_(ssl_config
),
43 privacy_mode_(privacy_mode
),
44 load_flags_(load_flags
),
45 force_spdy_over_ssl_(force_spdy_over_ssl
),
46 want_spdy_over_npn_(want_spdy_over_npn
),
47 ignore_limits_(false) {
48 if (direct_params_
.get()) {
49 DCHECK(!socks_proxy_params_
.get());
50 DCHECK(!http_proxy_params_
.get());
51 ignore_limits_
= direct_params_
->ignore_limits();
52 } else if (socks_proxy_params_
.get()) {
53 DCHECK(!http_proxy_params_
.get());
54 ignore_limits_
= socks_proxy_params_
->ignore_limits();
56 DCHECK(http_proxy_params_
.get());
57 ignore_limits_
= http_proxy_params_
->ignore_limits();
61 SSLSocketParams::~SSLSocketParams() {}
63 SSLSocketParams::ConnectionType
SSLSocketParams::GetConnectionType() const {
64 if (direct_params_
.get()) {
65 DCHECK(!socks_proxy_params_
.get());
66 DCHECK(!http_proxy_params_
.get());
70 if (socks_proxy_params_
.get()) {
71 DCHECK(!http_proxy_params_
.get());
75 DCHECK(http_proxy_params_
.get());
79 const scoped_refptr
<TransportSocketParams
>&
80 SSLSocketParams::GetDirectConnectionParams() const {
81 DCHECK_EQ(GetConnectionType(), DIRECT
);
82 return direct_params_
;
85 const scoped_refptr
<SOCKSSocketParams
>&
86 SSLSocketParams::GetSocksProxyConnectionParams() const {
87 DCHECK_EQ(GetConnectionType(), SOCKS_PROXY
);
88 return socks_proxy_params_
;
91 const scoped_refptr
<HttpProxySocketParams
>&
92 SSLSocketParams::GetHttpProxyConnectionParams() const {
93 DCHECK_EQ(GetConnectionType(), HTTP_PROXY
);
94 return http_proxy_params_
;
97 // Timeout for the SSL handshake portion of the connect.
98 static const int kSSLHandshakeTimeoutInSeconds
= 30;
100 SSLConnectJob::SSLConnectJob(const std::string
& group_name
,
101 RequestPriority priority
,
102 const scoped_refptr
<SSLSocketParams
>& params
,
103 const base::TimeDelta
& timeout_duration
,
104 TransportClientSocketPool
* transport_pool
,
105 SOCKSClientSocketPool
* socks_pool
,
106 HttpProxyClientSocketPool
* http_proxy_pool
,
107 ClientSocketFactory
* client_socket_factory
,
108 const SSLClientSocketContext
& context
,
111 : ConnectJob(group_name
,
115 BoundNetLog::Make(net_log
, NetLog::SOURCE_CONNECT_JOB
)),
117 transport_pool_(transport_pool
),
118 socks_pool_(socks_pool
),
119 http_proxy_pool_(http_proxy_pool
),
120 client_socket_factory_(client_socket_factory
),
121 context_(context
.cert_verifier
,
122 context
.channel_id_service
,
123 context
.transport_security_state
,
124 context
.cert_transparency_verifier
,
125 context
.cert_policy_enforcer
,
126 (params
->privacy_mode() == PRIVACY_MODE_ENABLED
127 ? "pm/" + context
.ssl_session_cache_shard
128 : context
.ssl_session_cache_shard
)),
130 base::Bind(&SSLConnectJob::OnIOComplete
, base::Unretained(this))) {
133 SSLConnectJob::~SSLConnectJob() {
136 LoadState
SSLConnectJob::GetLoadState() const {
137 switch (next_state_
) {
138 case STATE_TUNNEL_CONNECT_COMPLETE
:
139 if (transport_socket_handle_
->socket())
140 return LOAD_STATE_ESTABLISHING_PROXY_TUNNEL
;
141 // else, fall through.
142 case STATE_TRANSPORT_CONNECT
:
143 case STATE_TRANSPORT_CONNECT_COMPLETE
:
144 case STATE_SOCKS_CONNECT
:
145 case STATE_SOCKS_CONNECT_COMPLETE
:
146 case STATE_TUNNEL_CONNECT
:
147 return transport_socket_handle_
->GetLoadState();
148 case STATE_SSL_CONNECT
:
149 case STATE_SSL_CONNECT_COMPLETE
:
150 return LOAD_STATE_SSL_HANDSHAKE
;
153 return LOAD_STATE_IDLE
;
157 void SSLConnectJob::GetAdditionalErrorState(ClientSocketHandle
* handle
) {
158 // Headers in |error_response_info_| indicate a proxy tunnel setup
159 // problem. See DoTunnelConnectComplete.
160 if (error_response_info_
.headers
.get()) {
161 handle
->set_pending_http_proxy_connection(
162 transport_socket_handle_
.release());
164 handle
->set_ssl_error_response_info(error_response_info_
);
165 if (!connect_timing_
.ssl_start
.is_null())
166 handle
->set_is_ssl_error(true);
169 void SSLConnectJob::OnIOComplete(int result
) {
170 int rv
= DoLoop(result
);
171 if (rv
!= ERR_IO_PENDING
)
172 NotifyDelegateOfCompletion(rv
); // Deletes |this|.
175 int SSLConnectJob::DoLoop(int result
) {
176 DCHECK_NE(next_state_
, STATE_NONE
);
180 State state
= next_state_
;
181 next_state_
= STATE_NONE
;
183 case STATE_TRANSPORT_CONNECT
:
185 rv
= DoTransportConnect();
187 case STATE_TRANSPORT_CONNECT_COMPLETE
:
188 rv
= DoTransportConnectComplete(rv
);
190 case STATE_SOCKS_CONNECT
:
192 rv
= DoSOCKSConnect();
194 case STATE_SOCKS_CONNECT_COMPLETE
:
195 rv
= DoSOCKSConnectComplete(rv
);
197 case STATE_TUNNEL_CONNECT
:
199 rv
= DoTunnelConnect();
201 case STATE_TUNNEL_CONNECT_COMPLETE
:
202 rv
= DoTunnelConnectComplete(rv
);
204 case STATE_SSL_CONNECT
:
208 case STATE_SSL_CONNECT_COMPLETE
:
209 rv
= DoSSLConnectComplete(rv
);
212 NOTREACHED() << "bad state";
216 } while (rv
!= ERR_IO_PENDING
&& next_state_
!= STATE_NONE
);
221 int SSLConnectJob::DoTransportConnect() {
222 DCHECK(transport_pool_
);
224 next_state_
= STATE_TRANSPORT_CONNECT_COMPLETE
;
225 transport_socket_handle_
.reset(new ClientSocketHandle());
226 scoped_refptr
<TransportSocketParams
> direct_params
=
227 params_
->GetDirectConnectionParams();
228 return transport_socket_handle_
->Init(group_name(), direct_params
, priority(),
229 callback_
, transport_pool_
, net_log());
232 int SSLConnectJob::DoTransportConnectComplete(int result
) {
234 next_state_
= STATE_SSL_CONNECT
;
239 int SSLConnectJob::DoSOCKSConnect() {
241 next_state_
= STATE_SOCKS_CONNECT_COMPLETE
;
242 transport_socket_handle_
.reset(new ClientSocketHandle());
243 scoped_refptr
<SOCKSSocketParams
> socks_proxy_params
=
244 params_
->GetSocksProxyConnectionParams();
245 return transport_socket_handle_
->Init(group_name(), socks_proxy_params
,
246 priority(), callback_
, socks_pool_
,
250 int SSLConnectJob::DoSOCKSConnectComplete(int result
) {
252 next_state_
= STATE_SSL_CONNECT
;
257 int SSLConnectJob::DoTunnelConnect() {
258 DCHECK(http_proxy_pool_
);
259 next_state_
= STATE_TUNNEL_CONNECT_COMPLETE
;
261 transport_socket_handle_
.reset(new ClientSocketHandle());
262 scoped_refptr
<HttpProxySocketParams
> http_proxy_params
=
263 params_
->GetHttpProxyConnectionParams();
264 return transport_socket_handle_
->Init(group_name(), http_proxy_params
,
265 priority(), callback_
, http_proxy_pool_
,
269 int SSLConnectJob::DoTunnelConnectComplete(int result
) {
270 // Extract the information needed to prompt for appropriate proxy
271 // authentication so that when ClientSocketPoolBaseHelper calls
272 // |GetAdditionalErrorState|, we can easily set the state.
273 if (result
== ERR_SSL_CLIENT_AUTH_CERT_NEEDED
) {
274 error_response_info_
= transport_socket_handle_
->ssl_error_response_info();
275 } else if (result
== ERR_PROXY_AUTH_REQUESTED
||
276 result
== ERR_HTTPS_PROXY_TUNNEL_RESPONSE
) {
277 StreamSocket
* socket
= transport_socket_handle_
->socket();
278 ProxyClientSocket
* tunnel_socket
= static_cast<ProxyClientSocket
*>(socket
);
279 error_response_info_
= *tunnel_socket
->GetConnectResponseInfo();
284 next_state_
= STATE_SSL_CONNECT
;
288 int SSLConnectJob::DoSSLConnect() {
289 // TODO(pkasting): Remove ScopedTracker below once crbug.com/462815 is fixed.
290 tracked_objects::ScopedTracker
tracking_profile(
291 FROM_HERE_WITH_EXPLICIT_FUNCTION("462815 SSLConnectJob::DoSSLConnect"));
293 next_state_
= STATE_SSL_CONNECT_COMPLETE
;
295 // Reset the timeout to just the time allowed for the SSL handshake.
296 ResetTimer(base::TimeDelta::FromSeconds(kSSLHandshakeTimeoutInSeconds
));
298 // If the handle has a fresh socket, get its connect start and DNS times.
299 // This should always be the case.
300 const LoadTimingInfo::ConnectTiming
& socket_connect_timing
=
301 transport_socket_handle_
->connect_timing();
302 if (!transport_socket_handle_
->is_reused() &&
303 !socket_connect_timing
.connect_start
.is_null()) {
304 // Overwriting |connect_start| serves two purposes - it adjusts timing so
305 // |connect_start| doesn't include dns times, and it adjusts the time so
306 // as not to include time spent waiting for an idle socket.
307 connect_timing_
.connect_start
= socket_connect_timing
.connect_start
;
308 connect_timing_
.dns_start
= socket_connect_timing
.dns_start
;
309 connect_timing_
.dns_end
= socket_connect_timing
.dns_end
;
312 connect_timing_
.ssl_start
= base::TimeTicks::Now();
314 ssl_socket_
= client_socket_factory_
->CreateSSLClientSocket(
315 transport_socket_handle_
.Pass(),
316 params_
->host_and_port(),
317 params_
->ssl_config(),
319 return ssl_socket_
->Connect(callback_
);
322 int SSLConnectJob::DoSSLConnectComplete(int result
) {
323 connect_timing_
.ssl_end
= base::TimeTicks::Now();
325 SSLClientSocket::NextProtoStatus status
=
326 SSLClientSocket::kNextProtoUnsupported
;
328 // GetNextProto will fail and and trigger a NOTREACHED if we pass in a socket
329 // that hasn't had SSL_ImportFD called on it. If we get a certificate error
330 // here, then we know that we called SSL_ImportFD.
331 if (result
== OK
|| IsCertificateError(result
)) {
332 status
= ssl_socket_
->GetNextProto(&proto
);
333 ssl_socket_
->RecordNegotiationExtension();
336 // If we want spdy over npn, make sure it succeeded.
337 if (status
== SSLClientSocket::kNextProtoNegotiated
) {
338 ssl_socket_
->set_was_npn_negotiated(true);
339 NextProto protocol_negotiated
=
340 SSLClientSocket::NextProtoFromString(proto
);
341 ssl_socket_
->set_protocol_negotiated(protocol_negotiated
);
342 // If we negotiated a SPDY version, it must have been present in
343 // SSLConfig::next_protos.
344 // TODO(mbelshe): Verify this.
345 if (protocol_negotiated
>= kProtoSPDYMinimumVersion
&&
346 protocol_negotiated
<= kProtoSPDYMaximumVersion
) {
347 ssl_socket_
->set_was_spdy_negotiated(true);
350 if (params_
->want_spdy_over_npn() && !ssl_socket_
->was_spdy_negotiated())
351 return ERR_NPN_NEGOTIATION_FAILED
;
353 // Spdy might be turned on by default, or it might be over npn.
354 bool using_spdy
= params_
->force_spdy_over_ssl() ||
355 params_
->want_spdy_over_npn();
358 ssl_socket_
->IgnoreCertError(result
, params_
->load_flags())) {
359 DCHECK(!connect_timing_
.ssl_start
.is_null());
360 base::TimeDelta connect_duration
=
361 connect_timing_
.ssl_end
- connect_timing_
.ssl_start
;
363 UMA_HISTOGRAM_CUSTOM_TIMES("Net.SpdyConnectionLatency_2",
365 base::TimeDelta::FromMilliseconds(1),
366 base::TimeDelta::FromMinutes(1),
370 UMA_HISTOGRAM_CUSTOM_TIMES("Net.SSL_Connection_Latency_2",
372 base::TimeDelta::FromMilliseconds(1),
373 base::TimeDelta::FromMinutes(1),
377 bool has_ssl_info
= ssl_socket_
->GetSSLInfo(&ssl_info
);
378 DCHECK(has_ssl_info
);
380 UMA_HISTOGRAM_ENUMERATION("Net.SSLVersion", SSLConnectionStatusToVersion(
381 ssl_info
.connection_status
),
382 SSL_CONNECTION_VERSION_MAX
);
384 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSL_CipherSuite",
385 SSLConnectionStatusToCipherSuite(
386 ssl_info
.connection_status
));
388 UMA_HISTOGRAM_BOOLEAN(
389 "Net.RenegotiationExtensionSupported",
390 (ssl_info
.connection_status
&
391 SSL_CONNECTION_NO_RENEGOTIATION_EXTENSION
) == 0);
393 if (ssl_info
.handshake_type
== SSLInfo::HANDSHAKE_RESUME
) {
394 UMA_HISTOGRAM_CUSTOM_TIMES("Net.SSL_Connection_Latency_Resume_Handshake",
396 base::TimeDelta::FromMilliseconds(1),
397 base::TimeDelta::FromMinutes(1),
399 } else if (ssl_info
.handshake_type
== SSLInfo::HANDSHAKE_FULL
) {
400 UMA_HISTOGRAM_CUSTOM_TIMES("Net.SSL_Connection_Latency_Full_Handshake",
402 base::TimeDelta::FromMilliseconds(1),
403 base::TimeDelta::FromMinutes(1),
407 const std::string
& host
= params_
->host_and_port().host();
409 host
== "google.com" ||
410 (host
.size() > 11 && host
.rfind(".google.com") == host
.size() - 11);
412 UMA_HISTOGRAM_CUSTOM_TIMES("Net.SSL_Connection_Latency_Google2",
414 base::TimeDelta::FromMilliseconds(1),
415 base::TimeDelta::FromMinutes(1),
417 if (ssl_info
.handshake_type
== SSLInfo::HANDSHAKE_RESUME
) {
418 UMA_HISTOGRAM_CUSTOM_TIMES("Net.SSL_Connection_Latency_Google_"
421 base::TimeDelta::FromMilliseconds(1),
422 base::TimeDelta::FromMinutes(1),
424 } else if (ssl_info
.handshake_type
== SSLInfo::HANDSHAKE_FULL
) {
425 UMA_HISTOGRAM_CUSTOM_TIMES("Net.SSL_Connection_Latency_Google_"
428 base::TimeDelta::FromMilliseconds(1),
429 base::TimeDelta::FromMinutes(1),
435 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSL_Connection_Error", std::abs(result
));
436 if (params_
->ssl_config().fastradio_padding_eligible
) {
437 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSL_Connection_Error_FastRadioPadding",
441 if (result
== OK
|| IsCertificateError(result
)) {
442 SetSocket(ssl_socket_
.Pass());
443 } else if (result
== ERR_SSL_CLIENT_AUTH_CERT_NEEDED
) {
444 error_response_info_
.cert_request_info
= new SSLCertRequestInfo
;
445 ssl_socket_
->GetSSLCertRequestInfo(
446 error_response_info_
.cert_request_info
.get());
452 SSLConnectJob::State
SSLConnectJob::GetInitialState(
453 SSLSocketParams::ConnectionType connection_type
) {
454 switch (connection_type
) {
455 case SSLSocketParams::DIRECT
:
456 return STATE_TRANSPORT_CONNECT
;
457 case SSLSocketParams::HTTP_PROXY
:
458 return STATE_TUNNEL_CONNECT
;
459 case SSLSocketParams::SOCKS_PROXY
:
460 return STATE_SOCKS_CONNECT
;
466 int SSLConnectJob::ConnectInternal() {
467 next_state_
= GetInitialState(params_
->GetConnectionType());
471 SSLClientSocketPool::SSLConnectJobFactory::SSLConnectJobFactory(
472 TransportClientSocketPool
* transport_pool
,
473 SOCKSClientSocketPool
* socks_pool
,
474 HttpProxyClientSocketPool
* http_proxy_pool
,
475 ClientSocketFactory
* client_socket_factory
,
476 const SSLClientSocketContext
& context
,
478 : transport_pool_(transport_pool
),
479 socks_pool_(socks_pool
),
480 http_proxy_pool_(http_proxy_pool
),
481 client_socket_factory_(client_socket_factory
),
484 base::TimeDelta max_transport_timeout
= base::TimeDelta();
485 base::TimeDelta pool_timeout
;
487 max_transport_timeout
= transport_pool_
->ConnectionTimeout();
489 pool_timeout
= socks_pool_
->ConnectionTimeout();
490 if (pool_timeout
> max_transport_timeout
)
491 max_transport_timeout
= pool_timeout
;
493 if (http_proxy_pool_
) {
494 pool_timeout
= http_proxy_pool_
->ConnectionTimeout();
495 if (pool_timeout
> max_transport_timeout
)
496 max_transport_timeout
= pool_timeout
;
498 timeout_
= max_transport_timeout
+
499 base::TimeDelta::FromSeconds(kSSLHandshakeTimeoutInSeconds
);
502 SSLClientSocketPool::SSLConnectJobFactory::~SSLConnectJobFactory() {
505 SSLClientSocketPool::SSLClientSocketPool(
507 int max_sockets_per_group
,
508 ClientSocketPoolHistograms
* histograms
,
509 CertVerifier
* cert_verifier
,
510 ChannelIDService
* channel_id_service
,
511 TransportSecurityState
* transport_security_state
,
512 CTVerifier
* cert_transparency_verifier
,
513 CertPolicyEnforcer
* cert_policy_enforcer
,
514 const std::string
& ssl_session_cache_shard
,
515 ClientSocketFactory
* client_socket_factory
,
516 TransportClientSocketPool
* transport_pool
,
517 SOCKSClientSocketPool
* socks_pool
,
518 HttpProxyClientSocketPool
* http_proxy_pool
,
519 SSLConfigService
* ssl_config_service
,
521 : transport_pool_(transport_pool
),
522 socks_pool_(socks_pool
),
523 http_proxy_pool_(http_proxy_pool
),
526 max_sockets_per_group
,
528 ClientSocketPool::unused_idle_socket_timeout(),
529 ClientSocketPool::used_idle_socket_timeout(),
530 new SSLConnectJobFactory(
534 client_socket_factory
,
535 SSLClientSocketContext(cert_verifier
,
537 transport_security_state
,
538 cert_transparency_verifier
,
539 cert_policy_enforcer
,
540 ssl_session_cache_shard
),
542 ssl_config_service_(ssl_config_service
) {
543 if (ssl_config_service_
.get())
544 ssl_config_service_
->AddObserver(this);
546 base_
.AddLowerLayeredPool(transport_pool_
);
548 base_
.AddLowerLayeredPool(socks_pool_
);
549 if (http_proxy_pool_
)
550 base_
.AddLowerLayeredPool(http_proxy_pool_
);
553 SSLClientSocketPool::~SSLClientSocketPool() {
554 if (ssl_config_service_
.get())
555 ssl_config_service_
->RemoveObserver(this);
558 scoped_ptr
<ConnectJob
> SSLClientSocketPool::SSLConnectJobFactory::NewConnectJob(
559 const std::string
& group_name
,
560 const PoolBase::Request
& request
,
561 ConnectJob::Delegate
* delegate
) const {
562 return scoped_ptr
<ConnectJob
>(new SSLConnectJob(group_name
,
569 client_socket_factory_
,
575 base::TimeDelta
SSLClientSocketPool::SSLConnectJobFactory::ConnectionTimeout()
580 int SSLClientSocketPool::RequestSocket(const std::string
& group_name
,
581 const void* socket_params
,
582 RequestPriority priority
,
583 ClientSocketHandle
* handle
,
584 const CompletionCallback
& callback
,
585 const BoundNetLog
& net_log
) {
586 const scoped_refptr
<SSLSocketParams
>* casted_socket_params
=
587 static_cast<const scoped_refptr
<SSLSocketParams
>*>(socket_params
);
589 return base_
.RequestSocket(group_name
, *casted_socket_params
, priority
,
590 handle
, callback
, net_log
);
593 void SSLClientSocketPool::RequestSockets(
594 const std::string
& group_name
,
597 const BoundNetLog
& net_log
) {
598 const scoped_refptr
<SSLSocketParams
>* casted_params
=
599 static_cast<const scoped_refptr
<SSLSocketParams
>*>(params
);
601 base_
.RequestSockets(group_name
, *casted_params
, num_sockets
, net_log
);
604 void SSLClientSocketPool::CancelRequest(const std::string
& group_name
,
605 ClientSocketHandle
* handle
) {
606 base_
.CancelRequest(group_name
, handle
);
609 void SSLClientSocketPool::ReleaseSocket(const std::string
& group_name
,
610 scoped_ptr
<StreamSocket
> socket
,
612 base_
.ReleaseSocket(group_name
, socket
.Pass(), id
);
615 void SSLClientSocketPool::FlushWithError(int error
) {
616 base_
.FlushWithError(error
);
619 void SSLClientSocketPool::CloseIdleSockets() {
620 base_
.CloseIdleSockets();
623 int SSLClientSocketPool::IdleSocketCount() const {
624 return base_
.idle_socket_count();
627 int SSLClientSocketPool::IdleSocketCountInGroup(
628 const std::string
& group_name
) const {
629 return base_
.IdleSocketCountInGroup(group_name
);
632 LoadState
SSLClientSocketPool::GetLoadState(
633 const std::string
& group_name
, const ClientSocketHandle
* handle
) const {
634 return base_
.GetLoadState(group_name
, handle
);
637 base::DictionaryValue
* SSLClientSocketPool::GetInfoAsValue(
638 const std::string
& name
,
639 const std::string
& type
,
640 bool include_nested_pools
) const {
641 base::DictionaryValue
* dict
= base_
.GetInfoAsValue(name
, type
);
642 if (include_nested_pools
) {
643 base::ListValue
* list
= new base::ListValue();
644 if (transport_pool_
) {
645 list
->Append(transport_pool_
->GetInfoAsValue("transport_socket_pool",
646 "transport_socket_pool",
650 list
->Append(socks_pool_
->GetInfoAsValue("socks_pool",
654 if (http_proxy_pool_
) {
655 list
->Append(http_proxy_pool_
->GetInfoAsValue("http_proxy_pool",
659 dict
->Set("nested_pools", list
);
664 base::TimeDelta
SSLClientSocketPool::ConnectionTimeout() const {
665 return base_
.ConnectionTimeout();
668 ClientSocketPoolHistograms
* SSLClientSocketPool::histograms() const {
669 return base_
.histograms();
672 bool SSLClientSocketPool::IsStalled() const {
673 return base_
.IsStalled();
676 void SSLClientSocketPool::AddHigherLayeredPool(HigherLayeredPool
* higher_pool
) {
677 base_
.AddHigherLayeredPool(higher_pool
);
680 void SSLClientSocketPool::RemoveHigherLayeredPool(
681 HigherLayeredPool
* higher_pool
) {
682 base_
.RemoveHigherLayeredPool(higher_pool
);
685 bool SSLClientSocketPool::CloseOneIdleConnection() {
686 if (base_
.CloseOneIdleSocket())
688 return base_
.CloseOneIdleConnectionInHigherLayeredPool();
691 void SSLClientSocketPool::OnSSLConfigChanged() {
692 FlushWithError(ERR_NETWORK_CHANGED
);