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

Side by Side Diff: chrome/browser/io_thread.cc

Issue 7493025: Instantiate OriginBoundCertService in relevant places and do plumbing to pass it down to HttpNetw... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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 | 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/debug/leak_tracker.h" 10 #include "base/debug/leak_tracker.h"
(...skipping 18 matching lines...) Expand all
29 #include "chrome/browser/net/proxy_service_factory.h" 29 #include "chrome/browser/net/proxy_service_factory.h"
30 #include "chrome/browser/prefs/pref_service.h" 30 #include "chrome/browser/prefs/pref_service.h"
31 #include "chrome/common/chrome_switches.h" 31 #include "chrome/common/chrome_switches.h"
32 #include "chrome/common/pref_names.h" 32 #include "chrome/common/pref_names.h"
33 #include "content/browser/browser_thread.h" 33 #include "content/browser/browser_thread.h"
34 #include "content/browser/gpu/gpu_process_host.h" 34 #include "content/browser/gpu/gpu_process_host.h"
35 #include "content/browser/in_process_webkit/indexed_db_key_utility_client.h" 35 #include "content/browser/in_process_webkit/indexed_db_key_utility_client.h"
36 #include "content/common/url_fetcher.h" 36 #include "content/common/url_fetcher.h"
37 #include "net/base/cert_verifier.h" 37 #include "net/base/cert_verifier.h"
38 #include "net/base/cookie_monster.h" 38 #include "net/base/cookie_monster.h"
39 #include "net/base/default_origin_bound_cert_store.h"
39 #include "net/base/dnsrr_resolver.h" 40 #include "net/base/dnsrr_resolver.h"
40 #include "net/base/host_cache.h" 41 #include "net/base/host_cache.h"
41 #include "net/base/host_resolver.h" 42 #include "net/base/host_resolver.h"
42 #include "net/base/host_resolver_impl.h" 43 #include "net/base/host_resolver_impl.h"
43 #include "net/base/mapped_host_resolver.h" 44 #include "net/base/mapped_host_resolver.h"
44 #include "net/base/net_util.h" 45 #include "net/base/net_util.h"
46 #include "net/base/origin_bound_cert_service.h"
45 #include "net/dns/async_host_resolver.h" 47 #include "net/dns/async_host_resolver.h"
46 #include "net/ftp/ftp_network_layer.h" 48 #include "net/ftp/ftp_network_layer.h"
47 #include "net/http/http_auth_filter.h" 49 #include "net/http/http_auth_filter.h"
48 #include "net/http/http_auth_handler_factory.h" 50 #include "net/http/http_auth_handler_factory.h"
49 #include "net/http/http_network_layer.h" 51 #include "net/http/http_network_layer.h"
50 #include "net/http/http_network_session.h" 52 #include "net/http/http_network_session.h"
51 #include "net/proxy/proxy_config_service.h" 53 #include "net/proxy/proxy_config_service.h"
52 #include "net/proxy/proxy_script_fetcher_impl.h" 54 #include "net/proxy/proxy_script_fetcher_impl.h"
53 #include "net/proxy/proxy_service.h" 55 #include "net/proxy/proxy_service.h"
54 #include "net/socket/dns_cert_provenance_checker.h" 56 #include "net/socket/dns_cert_provenance_checker.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 context->set_cert_verifier(globals->cert_verifier.get()); 249 context->set_cert_verifier(globals->cert_verifier.get());
248 context->set_dnsrr_resolver(globals->dnsrr_resolver.get()); 250 context->set_dnsrr_resolver(globals->dnsrr_resolver.get());
249 context->set_http_auth_handler_factory( 251 context->set_http_auth_handler_factory(
250 globals->http_auth_handler_factory.get()); 252 globals->http_auth_handler_factory.get());
251 context->set_proxy_service(globals->proxy_script_fetcher_proxy_service.get()); 253 context->set_proxy_service(globals->proxy_script_fetcher_proxy_service.get());
252 context->set_http_transaction_factory( 254 context->set_http_transaction_factory(
253 globals->proxy_script_fetcher_http_transaction_factory.get()); 255 globals->proxy_script_fetcher_http_transaction_factory.get());
254 context->set_ftp_transaction_factory( 256 context->set_ftp_transaction_factory(
255 globals->proxy_script_fetcher_ftp_transaction_factory.get()); 257 globals->proxy_script_fetcher_ftp_transaction_factory.get());
256 // In-memory cookie store. 258 // In-memory cookie store.
257 context->set_cookie_store(new net::CookieMonster(NULL, NULL)); 259 context->set_cookie_store(new net::CookieMonster(NULL, NULL));
wtc 2011/08/08 22:49:20 Similarly, I think the proxy script fetcher contex
260 // In-memory origin-bound cert store.
261 context->set_origin_bound_cert_service(
262 globals->proxy_origin_bound_cert_service.get());
258 context->set_network_delegate(globals->system_network_delegate.get()); 263 context->set_network_delegate(globals->system_network_delegate.get());
259 return context; 264 return context;
260 } 265 }
261 266
262 scoped_refptr<net::URLRequestContext> 267 scoped_refptr<net::URLRequestContext>
263 ConstructSystemRequestContext(IOThread::Globals* globals, 268 ConstructSystemRequestContext(IOThread::Globals* globals,
264 net::NetLog* net_log) { 269 net::NetLog* net_log) {
265 scoped_refptr<net::URLRequestContext> context( 270 scoped_refptr<net::URLRequestContext> context(
266 new SystemURLRequestContext); 271 new SystemURLRequestContext);
267 context->set_net_log(net_log); 272 context->set_net_log(net_log);
268 context->set_host_resolver(globals->host_resolver.get()); 273 context->set_host_resolver(globals->host_resolver.get());
269 context->set_cert_verifier(globals->cert_verifier.get()); 274 context->set_cert_verifier(globals->cert_verifier.get());
270 context->set_dnsrr_resolver(globals->dnsrr_resolver.get()); 275 context->set_dnsrr_resolver(globals->dnsrr_resolver.get());
271 context->set_http_auth_handler_factory( 276 context->set_http_auth_handler_factory(
272 globals->http_auth_handler_factory.get()); 277 globals->http_auth_handler_factory.get());
273 context->set_proxy_service(globals->system_proxy_service.get()); 278 context->set_proxy_service(globals->system_proxy_service.get());
274 context->set_http_transaction_factory( 279 context->set_http_transaction_factory(
275 globals->system_http_transaction_factory.get()); 280 globals->system_http_transaction_factory.get());
276 context->set_ftp_transaction_factory( 281 context->set_ftp_transaction_factory(
277 globals->system_ftp_transaction_factory.get()); 282 globals->system_ftp_transaction_factory.get());
278 // In-memory cookie store. 283 // In-memory cookie store.
279 context->set_cookie_store(new net::CookieMonster(NULL, NULL)); 284 context->set_cookie_store(new net::CookieMonster(NULL, NULL));
285 // In-memory origin bound cert-store.
286 context->set_origin_bound_cert_service(
287 globals->system_origin_bound_cert_service.get());
280 return context; 288 return context;
281 } 289 }
282 290
283 } // namespace 291 } // namespace
284 292
285 class SystemURLRequestContextGetter : public net::URLRequestContextGetter { 293 class SystemURLRequestContextGetter : public net::URLRequestContextGetter {
286 public: 294 public:
287 explicit SystemURLRequestContextGetter(IOThread* io_thread); 295 explicit SystemURLRequestContextGetter(IOThread* io_thread);
288 virtual ~SystemURLRequestContextGetter(); 296 virtual ~SystemURLRequestContextGetter();
289 297
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 globals_->extension_event_router_forwarder = 486 globals_->extension_event_router_forwarder =
479 extension_event_router_forwarder_; 487 extension_event_router_forwarder_;
480 globals_->system_network_delegate.reset(new ChromeNetworkDelegate( 488 globals_->system_network_delegate.reset(new ChromeNetworkDelegate(
481 extension_event_router_forwarder_, 489 extension_event_router_forwarder_,
482 NULL, 490 NULL,
483 NULL, 491 NULL,
484 &system_enable_referrers_)); 492 &system_enable_referrers_));
485 globals_->host_resolver.reset( 493 globals_->host_resolver.reset(
486 CreateGlobalHostResolver(net_log_)); 494 CreateGlobalHostResolver(net_log_));
487 globals_->cert_verifier.reset(new net::CertVerifier); 495 globals_->cert_verifier.reset(new net::CertVerifier);
496 globals_->proxy_origin_bound_cert_service.reset(
497 new net::OriginBoundCertService(
498 new net::DefaultOriginBoundCertStore(NULL)));
499 globals_->system_origin_bound_cert_service.reset(
500 new net::OriginBoundCertService(
501 new net::DefaultOriginBoundCertStore(NULL)));
wtc 2011/08/08 22:49:20 We should use globals_->system_origin_bound_cert_s
488 globals_->dnsrr_resolver.reset(new net::DnsRRResolver); 502 globals_->dnsrr_resolver.reset(new net::DnsRRResolver);
489 globals_->ssl_config_service = GetSSLConfigService(); 503 globals_->ssl_config_service = GetSSLConfigService();
490 globals_->http_auth_handler_factory.reset(CreateDefaultAuthHandlerFactory( 504 globals_->http_auth_handler_factory.reset(CreateDefaultAuthHandlerFactory(
491 globals_->host_resolver.get())); 505 globals_->host_resolver.get()));
492 // For the ProxyScriptFetcher, we use a direct ProxyService. 506 // For the ProxyScriptFetcher, we use a direct ProxyService.
493 globals_->proxy_script_fetcher_proxy_service.reset( 507 globals_->proxy_script_fetcher_proxy_service.reset(
494 net::ProxyService::CreateDirectWithNetLog(net_log_)); 508 net::ProxyService::CreateDirectWithNetLog(net_log_));
495 net::HttpNetworkSession::Params session_params; 509 net::HttpNetworkSession::Params session_params;
496 session_params.host_resolver = globals_->host_resolver.get(); 510 session_params.host_resolver = globals_->host_resolver.get();
497 session_params.cert_verifier = globals_->cert_verifier.get(); 511 session_params.cert_verifier = globals_->cert_verifier.get();
512 session_params.origin_bound_cert_service =
513 globals_->proxy_origin_bound_cert_service.get();
498 session_params.proxy_service = 514 session_params.proxy_service =
499 globals_->proxy_script_fetcher_proxy_service.get(); 515 globals_->proxy_script_fetcher_proxy_service.get();
500 session_params.http_auth_handler_factory = 516 session_params.http_auth_handler_factory =
501 globals_->http_auth_handler_factory.get(); 517 globals_->http_auth_handler_factory.get();
502 session_params.network_delegate = globals_->system_network_delegate.get(); 518 session_params.network_delegate = globals_->system_network_delegate.get();
503 session_params.net_log = net_log_; 519 session_params.net_log = net_log_;
504 session_params.ssl_config_service = globals_->ssl_config_service; 520 session_params.ssl_config_service = globals_->ssl_config_service;
505 scoped_refptr<net::HttpNetworkSession> network_session( 521 scoped_refptr<net::HttpNetworkSession> network_session(
506 new net::HttpNetworkSession(session_params)); 522 new net::HttpNetworkSession(session_params));
507 globals_->proxy_script_fetcher_http_transaction_factory.reset( 523 globals_->proxy_script_fetcher_http_transaction_factory.reset(
508 new net::HttpNetworkLayer(network_session)); 524 new net::HttpNetworkLayer(network_session));
509 globals_->proxy_script_fetcher_ftp_transaction_factory.reset( 525 globals_->proxy_script_fetcher_ftp_transaction_factory.reset(
510 new net::FtpNetworkLayer(globals_->host_resolver.get())); 526 new net::FtpNetworkLayer(globals_->host_resolver.get()));
wtc 2011/08/08 22:49:20 I think the proxy script fetcher and system contex
511 527
512 scoped_refptr<net::URLRequestContext> proxy_script_fetcher_context = 528 scoped_refptr<net::URLRequestContext> proxy_script_fetcher_context =
513 ConstructProxyScriptFetcherContext(globals_, net_log_); 529 ConstructProxyScriptFetcherContext(globals_, net_log_);
wtc 2011/08/08 22:49:20 Remove this proxy_script_fetcher_context local var
514 globals_->proxy_script_fetcher_context = proxy_script_fetcher_context; 530 globals_->proxy_script_fetcher_context = proxy_script_fetcher_context;
515 } 531 }
516 532
517 void IOThread::CleanUp() { 533 void IOThread::CleanUp() {
518 // Step 1: Kill all things that might be holding onto 534 // Step 1: Kill all things that might be holding onto
519 // net::URLRequest/net::URLRequestContexts. 535 // net::URLRequest/net::URLRequestContexts.
520 536
521 #if defined(USE_NSS) 537 #if defined(USE_NSS)
522 net::ShutdownOCSP(); 538 net::ShutdownOCSP();
523 #endif // defined(USE_NSS) 539 #endif // defined(USE_NSS)
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 system_params.network_delegate = globals_->system_network_delegate.get(); 744 system_params.network_delegate = globals_->system_network_delegate.get();
729 system_params.net_log = net_log_; 745 system_params.net_log = net_log_;
730 globals_->system_http_transaction_factory.reset( 746 globals_->system_http_transaction_factory.reset(
731 new net::HttpNetworkLayer( 747 new net::HttpNetworkLayer(
732 new net::HttpNetworkSession(system_params))); 748 new net::HttpNetworkSession(system_params)));
733 globals_->system_ftp_transaction_factory.reset( 749 globals_->system_ftp_transaction_factory.reset(
734 new net::FtpNetworkLayer(globals_->host_resolver.get())); 750 new net::FtpNetworkLayer(globals_->host_resolver.get()));
735 globals_->system_request_context = 751 globals_->system_request_context =
736 ConstructSystemRequestContext(globals_, net_log_); 752 ConstructSystemRequestContext(globals_, net_log_);
737 } 753 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698