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

Side by Side Diff: chrome/browser/io_thread.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 "chrome/browser/io_thread.h" 5 #include "chrome/browser/io_thread.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 // Create a separate request context for PAC fetches to avoid reference cycles. 248 // Create a separate request context for PAC fetches to avoid reference cycles.
249 // See IOThread::Globals for details. 249 // See IOThread::Globals for details.
250 scoped_refptr<net::URLRequestContext> 250 scoped_refptr<net::URLRequestContext>
251 ConstructProxyScriptFetcherContext(IOThread::Globals* globals, 251 ConstructProxyScriptFetcherContext(IOThread::Globals* globals,
252 net::NetLog* net_log) { 252 net::NetLog* net_log) {
253 scoped_refptr<net::URLRequestContext> context( 253 scoped_refptr<net::URLRequestContext> context(
254 new URLRequestContextWithUserAgent); 254 new URLRequestContextWithUserAgent);
255 context->set_net_log(net_log); 255 context->set_net_log(net_log);
256 context->set_host_resolver(globals->host_resolver.get()); 256 context->set_host_resolver(globals->host_resolver.get());
257 context->set_cert_verifier(globals->cert_verifier.get()); 257 context->set_cert_verifier(globals->cert_verifier.get());
258 context->set_dnsrr_resolver(globals->dnsrr_resolver.get()); 258 context->set_transport_security_state(
259 globals->transport_security_state.get());
259 context->set_http_auth_handler_factory( 260 context->set_http_auth_handler_factory(
260 globals->http_auth_handler_factory.get()); 261 globals->http_auth_handler_factory.get());
261 context->set_proxy_service(globals->proxy_script_fetcher_proxy_service.get()); 262 context->set_proxy_service(globals->proxy_script_fetcher_proxy_service.get());
262 context->set_http_transaction_factory( 263 context->set_http_transaction_factory(
263 globals->proxy_script_fetcher_http_transaction_factory.get()); 264 globals->proxy_script_fetcher_http_transaction_factory.get());
264 context->set_ftp_transaction_factory( 265 context->set_ftp_transaction_factory(
265 globals->proxy_script_fetcher_ftp_transaction_factory.get()); 266 globals->proxy_script_fetcher_ftp_transaction_factory.get());
266 context->set_cookie_store(globals->system_cookie_store.get()); 267 context->set_cookie_store(globals->system_cookie_store.get());
267 context->set_origin_bound_cert_service( 268 context->set_origin_bound_cert_service(
268 globals->system_origin_bound_cert_service.get()); 269 globals->system_origin_bound_cert_service.get());
269 context->set_network_delegate(globals->system_network_delegate.get()); 270 context->set_network_delegate(globals->system_network_delegate.get());
270 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the 271 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the
271 // system URLRequestContext too. There's no reason this should be tied to a 272 // system URLRequestContext too. There's no reason this should be tied to a
272 // profile. 273 // profile.
273 return context; 274 return context;
274 } 275 }
275 276
276 scoped_refptr<net::URLRequestContext> 277 scoped_refptr<net::URLRequestContext>
277 ConstructSystemRequestContext(IOThread::Globals* globals, 278 ConstructSystemRequestContext(IOThread::Globals* globals,
278 net::NetLog* net_log) { 279 net::NetLog* net_log) {
279 scoped_refptr<net::URLRequestContext> context( 280 scoped_refptr<net::URLRequestContext> context(
280 new SystemURLRequestContext); 281 new SystemURLRequestContext);
281 context->set_net_log(net_log); 282 context->set_net_log(net_log);
282 context->set_host_resolver(globals->host_resolver.get()); 283 context->set_host_resolver(globals->host_resolver.get());
283 context->set_cert_verifier(globals->cert_verifier.get()); 284 context->set_cert_verifier(globals->cert_verifier.get());
284 context->set_dnsrr_resolver(globals->dnsrr_resolver.get()); 285 context->set_transport_security_state(
286 globals->transport_security_state.get());
285 context->set_http_auth_handler_factory( 287 context->set_http_auth_handler_factory(
286 globals->http_auth_handler_factory.get()); 288 globals->http_auth_handler_factory.get());
287 context->set_proxy_service(globals->system_proxy_service.get()); 289 context->set_proxy_service(globals->system_proxy_service.get());
288 context->set_http_transaction_factory( 290 context->set_http_transaction_factory(
289 globals->system_http_transaction_factory.get()); 291 globals->system_http_transaction_factory.get());
290 context->set_ftp_transaction_factory( 292 context->set_ftp_transaction_factory(
291 globals->system_ftp_transaction_factory.get()); 293 globals->system_ftp_transaction_factory.get());
292 context->set_cookie_store(globals->system_cookie_store.get()); 294 context->set_cookie_store(globals->system_cookie_store.get());
293 context->set_origin_bound_cert_service( 295 context->set_origin_bound_cert_service(
294 globals->system_origin_bound_cert_service.get()); 296 globals->system_origin_bound_cert_service.get());
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 globals_->system_network_delegate.reset(new ChromeNetworkDelegate( 431 globals_->system_network_delegate.reset(new ChromeNetworkDelegate(
430 extension_event_router_forwarder_, 432 extension_event_router_forwarder_,
431 NULL, 433 NULL,
432 NULL, 434 NULL,
433 NULL, 435 NULL,
434 &system_enable_referrers_)); 436 &system_enable_referrers_));
435 globals_->host_resolver.reset( 437 globals_->host_resolver.reset(
436 CreateGlobalHostResolver(net_log_)); 438 CreateGlobalHostResolver(net_log_));
437 globals_->cert_verifier.reset(new net::CertVerifier); 439 globals_->cert_verifier.reset(new net::CertVerifier);
438 globals_->dnsrr_resolver.reset(new net::DnsRRResolver); 440 globals_->dnsrr_resolver.reset(new net::DnsRRResolver);
441 globals_->transport_security_state.reset(new net::TransportSecurityState(""));
439 globals_->ssl_config_service = GetSSLConfigService(); 442 globals_->ssl_config_service = GetSSLConfigService();
440 globals_->http_auth_handler_factory.reset(CreateDefaultAuthHandlerFactory( 443 globals_->http_auth_handler_factory.reset(CreateDefaultAuthHandlerFactory(
441 globals_->host_resolver.get())); 444 globals_->host_resolver.get()));
442 globals_->http_server_properties.reset(new net::HttpServerPropertiesImpl); 445 globals_->http_server_properties.reset(new net::HttpServerPropertiesImpl);
443 // For the ProxyScriptFetcher, we use a direct ProxyService. 446 // For the ProxyScriptFetcher, we use a direct ProxyService.
444 globals_->proxy_script_fetcher_proxy_service.reset( 447 globals_->proxy_script_fetcher_proxy_service.reset(
445 net::ProxyService::CreateDirectWithNetLog(net_log_)); 448 net::ProxyService::CreateDirectWithNetLog(net_log_));
446 // In-memory cookie store. 449 // In-memory cookie store.
447 globals_->system_cookie_store = new net::CookieMonster(NULL, NULL); 450 globals_->system_cookie_store = new net::CookieMonster(NULL, NULL);
448 // In-memory origin-bound cert store. 451 // In-memory origin-bound cert store.
449 globals_->system_origin_bound_cert_service.reset( 452 globals_->system_origin_bound_cert_service.reset(
450 new net::OriginBoundCertService( 453 new net::OriginBoundCertService(
451 new net::DefaultOriginBoundCertStore(NULL))); 454 new net::DefaultOriginBoundCertStore(NULL)));
452 net::HttpNetworkSession::Params session_params; 455 net::HttpNetworkSession::Params session_params;
453 session_params.host_resolver = globals_->host_resolver.get(); 456 session_params.host_resolver = globals_->host_resolver.get();
454 session_params.cert_verifier = globals_->cert_verifier.get(); 457 session_params.cert_verifier = globals_->cert_verifier.get();
455 session_params.origin_bound_cert_service = 458 session_params.origin_bound_cert_service =
456 globals_->system_origin_bound_cert_service.get(); 459 globals_->system_origin_bound_cert_service.get();
460 session_params.transport_security_state =
461 globals_->transport_security_state.get();
457 session_params.proxy_service = 462 session_params.proxy_service =
458 globals_->proxy_script_fetcher_proxy_service.get(); 463 globals_->proxy_script_fetcher_proxy_service.get();
459 session_params.http_auth_handler_factory = 464 session_params.http_auth_handler_factory =
460 globals_->http_auth_handler_factory.get(); 465 globals_->http_auth_handler_factory.get();
461 session_params.network_delegate = globals_->system_network_delegate.get(); 466 session_params.network_delegate = globals_->system_network_delegate.get();
462 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the 467 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the
463 // system URLRequestContext too. There's no reason this should be tied to a 468 // system URLRequestContext too. There's no reason this should be tied to a
464 // profile. 469 // profile.
465 session_params.http_server_properties = 470 session_params.http_server_properties =
466 globals_->http_server_properties.get(); 471 globals_->http_server_properties.get();
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 ProxyServiceFactory::CreateProxyService( 634 ProxyServiceFactory::CreateProxyService(
630 net_log_, 635 net_log_,
631 globals_->proxy_script_fetcher_context, 636 globals_->proxy_script_fetcher_context,
632 system_proxy_config_service_.release(), 637 system_proxy_config_service_.release(),
633 command_line)); 638 command_line));
634 net::HttpNetworkSession::Params system_params; 639 net::HttpNetworkSession::Params system_params;
635 system_params.host_resolver = globals_->host_resolver.get(); 640 system_params.host_resolver = globals_->host_resolver.get();
636 system_params.cert_verifier = globals_->cert_verifier.get(); 641 system_params.cert_verifier = globals_->cert_verifier.get();
637 system_params.origin_bound_cert_service = 642 system_params.origin_bound_cert_service =
638 globals_->system_origin_bound_cert_service.get(); 643 globals_->system_origin_bound_cert_service.get();
639 system_params.dnsrr_resolver = globals_->dnsrr_resolver.get(); 644 system_params.transport_security_state =
645 globals_->transport_security_state.get();
640 system_params.dns_cert_checker = NULL; 646 system_params.dns_cert_checker = NULL;
641 system_params.ssl_host_info_factory = NULL; 647 system_params.ssl_host_info_factory = NULL;
642 system_params.proxy_service = globals_->system_proxy_service.get(); 648 system_params.proxy_service = globals_->system_proxy_service.get();
643 system_params.ssl_config_service = globals_->ssl_config_service.get(); 649 system_params.ssl_config_service = globals_->ssl_config_service.get();
644 system_params.http_auth_handler_factory = 650 system_params.http_auth_handler_factory =
645 globals_->http_auth_handler_factory.get(); 651 globals_->http_auth_handler_factory.get();
646 system_params.http_server_properties = globals_->http_server_properties.get(); 652 system_params.http_server_properties = globals_->http_server_properties.get();
647 system_params.network_delegate = globals_->system_network_delegate.get(); 653 system_params.network_delegate = globals_->system_network_delegate.get();
648 system_params.net_log = net_log_; 654 system_params.net_log = net_log_;
649 globals_->system_http_transaction_factory.reset( 655 globals_->system_http_transaction_factory.reset(
650 new net::HttpNetworkLayer( 656 new net::HttpNetworkLayer(
651 new net::HttpNetworkSession(system_params))); 657 new net::HttpNetworkSession(system_params)));
652 globals_->system_ftp_transaction_factory.reset( 658 globals_->system_ftp_transaction_factory.reset(
653 new net::FtpNetworkLayer(globals_->host_resolver.get())); 659 new net::FtpNetworkLayer(globals_->host_resolver.get()));
654 globals_->system_request_context = 660 globals_->system_request_context =
655 ConstructSystemRequestContext(globals_, net_log_); 661 ConstructSystemRequestContext(globals_, net_log_);
656 } 662 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698