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

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

Powered by Google App Engine
This is Rietveld 408576698