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

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

Issue 8692012: net: replace DnsRRResoler with TransportSecurityState in plumbing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/ssl_client_socket_pool.h" 5 #include "net/socket/ssl_client_socket_pool.h"
6 6
7 #include "base/metrics/field_trial.h" 7 #include "base/metrics/field_trial.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 DCHECK(transport_pool_); 187 DCHECK(transport_pool_);
188 188
189 if (context_.ssl_host_info_factory) { 189 if (context_.ssl_host_info_factory) {
190 ssl_host_info_.reset( 190 ssl_host_info_.reset(
191 context_.ssl_host_info_factory->GetForHost( 191 context_.ssl_host_info_factory->GetForHost(
192 params_->host_and_port().host(), 192 params_->host_and_port().host(),
193 params_->ssl_config())); 193 params_->ssl_config()));
194 } 194 }
195 195
196 if (ssl_host_info_.get()) { 196 if (ssl_host_info_.get()) {
197 if (context_.dnsrr_resolver)
198 ssl_host_info_->StartDnsLookup(context_.dnsrr_resolver);
199
200 // This starts fetching the SSL host info from the disk cache for early 197 // This starts fetching the SSL host info from the disk cache for early
201 // certificate verification and the TLS cached information extension. 198 // certificate verification and the TLS cached information extension.
202 ssl_host_info_->Start(); 199 ssl_host_info_->Start();
203 } 200 }
204 201
205 next_state_ = STATE_TRANSPORT_CONNECT_COMPLETE; 202 next_state_ = STATE_TRANSPORT_CONNECT_COMPLETE;
206 transport_socket_handle_.reset(new ClientSocketHandle()); 203 transport_socket_handle_.reset(new ClientSocketHandle());
207 scoped_refptr<TransportSocketParams> transport_params = 204 scoped_refptr<TransportSocketParams> transport_params =
208 params_->transport_params(); 205 params_->transport_params();
209 return transport_socket_handle_->Init( 206 return transport_socket_handle_->Init(
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 base::TimeDelta::FromSeconds(kSSLHandshakeTimeoutInSeconds); 436 base::TimeDelta::FromSeconds(kSSLHandshakeTimeoutInSeconds);
440 } 437 }
441 438
442 SSLClientSocketPool::SSLClientSocketPool( 439 SSLClientSocketPool::SSLClientSocketPool(
443 int max_sockets, 440 int max_sockets,
444 int max_sockets_per_group, 441 int max_sockets_per_group,
445 ClientSocketPoolHistograms* histograms, 442 ClientSocketPoolHistograms* histograms,
446 HostResolver* host_resolver, 443 HostResolver* host_resolver,
447 CertVerifier* cert_verifier, 444 CertVerifier* cert_verifier,
448 OriginBoundCertService* origin_bound_cert_service, 445 OriginBoundCertService* origin_bound_cert_service,
449 DnsRRResolver* dnsrr_resolver, 446 TransportSecurityState* transport_security_state,
450 DnsCertProvenanceChecker* dns_cert_checker, 447 DnsCertProvenanceChecker* dns_cert_checker,
451 SSLHostInfoFactory* ssl_host_info_factory, 448 SSLHostInfoFactory* ssl_host_info_factory,
452 ClientSocketFactory* client_socket_factory, 449 ClientSocketFactory* client_socket_factory,
453 TransportClientSocketPool* transport_pool, 450 TransportClientSocketPool* transport_pool,
454 SOCKSClientSocketPool* socks_pool, 451 SOCKSClientSocketPool* socks_pool,
455 HttpProxyClientSocketPool* http_proxy_pool, 452 HttpProxyClientSocketPool* http_proxy_pool,
456 SSLConfigService* ssl_config_service, 453 SSLConfigService* ssl_config_service,
457 NetLog* net_log) 454 NetLog* net_log)
458 : transport_pool_(transport_pool), 455 : transport_pool_(transport_pool),
459 socks_pool_(socks_pool), 456 socks_pool_(socks_pool),
460 http_proxy_pool_(http_proxy_pool), 457 http_proxy_pool_(http_proxy_pool),
461 base_(max_sockets, max_sockets_per_group, histograms, 458 base_(max_sockets, max_sockets_per_group, histograms,
462 ClientSocketPool::unused_idle_socket_timeout(), 459 ClientSocketPool::unused_idle_socket_timeout(),
463 ClientSocketPool::used_idle_socket_timeout(), 460 ClientSocketPool::used_idle_socket_timeout(),
464 new SSLConnectJobFactory(transport_pool, 461 new SSLConnectJobFactory(transport_pool,
465 socks_pool, 462 socks_pool,
466 http_proxy_pool, 463 http_proxy_pool,
467 client_socket_factory, 464 client_socket_factory,
468 host_resolver, 465 host_resolver,
469 SSLClientSocketContext( 466 SSLClientSocketContext(
470 cert_verifier, 467 cert_verifier,
471 origin_bound_cert_service, 468 origin_bound_cert_service,
472 dnsrr_resolver, 469 transport_security_state,
473 dns_cert_checker, 470 dns_cert_checker,
474 ssl_host_info_factory), 471 ssl_host_info_factory),
475 net_log)), 472 net_log)),
476 ssl_config_service_(ssl_config_service) { 473 ssl_config_service_(ssl_config_service) {
477 if (ssl_config_service_) 474 if (ssl_config_service_)
478 ssl_config_service_->AddObserver(this); 475 ssl_config_service_->AddObserver(this);
479 } 476 }
480 477
481 SSLClientSocketPool::~SSLClientSocketPool() { 478 SSLClientSocketPool::~SSLClientSocketPool() {
482 if (ssl_config_service_) 479 if (ssl_config_service_)
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 579
583 ClientSocketPoolHistograms* SSLClientSocketPool::histograms() const { 580 ClientSocketPoolHistograms* SSLClientSocketPool::histograms() const {
584 return base_.histograms(); 581 return base_.histograms();
585 } 582 }
586 583
587 void SSLClientSocketPool::OnSSLConfigChanged() { 584 void SSLClientSocketPool::OnSSLConfigChanged() {
588 Flush(); 585 Flush();
589 } 586 }
590 587
591 } // namespace net 588 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698