OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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/profiles/profile_io_data.h" | 5 #include "chrome/browser/profiles/profile_io_data.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "chrome/browser/content_settings/host_content_settings_map.h" | 21 #include "chrome/browser/content_settings/host_content_settings_map.h" |
22 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 22 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
23 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" | 23 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" |
24 #include "chrome/browser/download/download_service.h" | 24 #include "chrome/browser/download/download_service.h" |
25 #include "chrome/browser/download/download_service_factory.h" | 25 #include "chrome/browser/download/download_service_factory.h" |
26 #include "chrome/browser/extensions/extension_info_map.h" | 26 #include "chrome/browser/extensions/extension_info_map.h" |
27 #include "chrome/browser/extensions/extension_protocols.h" | 27 #include "chrome/browser/extensions/extension_protocols.h" |
28 #include "chrome/browser/extensions/extension_resource_protocols.h" | 28 #include "chrome/browser/extensions/extension_resource_protocols.h" |
29 #include "chrome/browser/extensions/extension_system.h" | 29 #include "chrome/browser/extensions/extension_system.h" |
30 #include "chrome/browser/io_thread.h" | 30 #include "chrome/browser/io_thread.h" |
31 #include "chrome/browser/net/cache_stats.h" | |
32 #include "chrome/browser/net/chrome_cookie_notification_details.h" | 31 #include "chrome/browser/net/chrome_cookie_notification_details.h" |
33 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h" | 32 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h" |
34 #include "chrome/browser/net/chrome_net_log.h" | 33 #include "chrome/browser/net/chrome_net_log.h" |
35 #include "chrome/browser/net/chrome_network_delegate.h" | 34 #include "chrome/browser/net/chrome_network_delegate.h" |
36 #include "chrome/browser/net/http_server_properties_manager.h" | 35 #include "chrome/browser/net/http_server_properties_manager.h" |
| 36 #include "chrome/browser/net/load_time_stats.h" |
37 #include "chrome/browser/net/proxy_service_factory.h" | 37 #include "chrome/browser/net/proxy_service_factory.h" |
38 #include "chrome/browser/net/resource_prefetch_predictor_observer.h" | 38 #include "chrome/browser/net/resource_prefetch_predictor_observer.h" |
39 #include "chrome/browser/net/transport_security_persister.h" | 39 #include "chrome/browser/net/transport_security_persister.h" |
40 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 40 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
41 #include "chrome/browser/policy/url_blacklist_manager.h" | 41 #include "chrome/browser/policy/url_blacklist_manager.h" |
42 #include "chrome/browser/predictors/resource_prefetch_predictor.h" | 42 #include "chrome/browser/predictors/resource_prefetch_predictor.h" |
43 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h" | 43 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h" |
44 #include "chrome/browser/prefs/pref_service.h" | 44 #include "chrome/browser/prefs/pref_service.h" |
45 #include "chrome/browser/profiles/profile.h" | 45 #include "chrome/browser/profiles/profile.h" |
46 #include "chrome/browser/profiles/profile_manager.h" | 46 #include "chrome/browser/profiles/profile_manager.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 | 215 |
216 initialized_on_UI_thread_ = true; | 216 initialized_on_UI_thread_ = true; |
217 | 217 |
218 // We need to make sure that content initializes its own data structures that | 218 // We need to make sure that content initializes its own data structures that |
219 // are associated with each ResourceContext because we might post this | 219 // are associated with each ResourceContext because we might post this |
220 // object to the IO thread after this function. | 220 // object to the IO thread after this function. |
221 BrowserContext::EnsureResourceContextInitialized(profile); | 221 BrowserContext::EnsureResourceContextInitialized(profile); |
222 } | 222 } |
223 | 223 |
224 ProfileIOData::AppRequestContext::AppRequestContext( | 224 ProfileIOData::AppRequestContext::AppRequestContext( |
225 chrome_browser_net::CacheStats* cache_stats) | 225 chrome_browser_net::LoadTimeStats* load_time_stats) |
226 : ChromeURLRequestContext(ChromeURLRequestContext::CONTEXT_TYPE_APP, | 226 : ChromeURLRequestContext(ChromeURLRequestContext::CONTEXT_TYPE_APP, |
227 cache_stats) { | 227 load_time_stats) { |
228 } | 228 } |
229 | 229 |
230 void ProfileIOData::AppRequestContext::SetCookieStore( | 230 void ProfileIOData::AppRequestContext::SetCookieStore( |
231 net::CookieStore* cookie_store) { | 231 net::CookieStore* cookie_store) { |
232 cookie_store_ = cookie_store; | 232 cookie_store_ = cookie_store; |
233 set_cookie_store(cookie_store); | 233 set_cookie_store(cookie_store); |
234 } | 234 } |
235 | 235 |
236 void ProfileIOData::AppRequestContext::SetHttpTransactionFactory( | 236 void ProfileIOData::AppRequestContext::SetHttpTransactionFactory( |
237 net::HttpTransactionFactory* http_factory) { | 237 net::HttpTransactionFactory* http_factory) { |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 | 455 |
456 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. | 456 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. |
457 CHECK(initialized_on_UI_thread_); | 457 CHECK(initialized_on_UI_thread_); |
458 | 458 |
459 // TODO(jhawkins): Return to DCHECK once crbug.com/102004 is fixed. | 459 // TODO(jhawkins): Return to DCHECK once crbug.com/102004 is fixed. |
460 CHECK(profile_params_.get()); | 460 CHECK(profile_params_.get()); |
461 | 461 |
462 IOThread* const io_thread = profile_params_->io_thread; | 462 IOThread* const io_thread = profile_params_->io_thread; |
463 IOThread::Globals* const io_thread_globals = io_thread->globals(); | 463 IOThread::Globals* const io_thread_globals = io_thread->globals(); |
464 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 464 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
465 cache_stats_ = GetCacheStats(io_thread_globals); | 465 load_time_stats_ = GetLoadTimeStats(io_thread_globals); |
466 | 466 |
467 // Create the common request contexts. | 467 // Create the common request contexts. |
468 main_request_context_.reset( | 468 main_request_context_.reset( |
469 new ChromeURLRequestContext(ChromeURLRequestContext::CONTEXT_TYPE_MAIN, | 469 new ChromeURLRequestContext(ChromeURLRequestContext::CONTEXT_TYPE_MAIN, |
470 cache_stats_)); | 470 load_time_stats_)); |
471 extensions_request_context_.reset( | 471 extensions_request_context_.reset( |
472 new ChromeURLRequestContext( | 472 new ChromeURLRequestContext( |
473 ChromeURLRequestContext::CONTEXT_TYPE_EXTENSIONS, | 473 ChromeURLRequestContext::CONTEXT_TYPE_EXTENSIONS, |
474 cache_stats_)); | 474 load_time_stats_)); |
475 | 475 |
476 chrome_url_data_manager_backend_.reset(new ChromeURLDataManagerBackend); | 476 chrome_url_data_manager_backend_.reset(new ChromeURLDataManagerBackend); |
477 | 477 |
478 network_delegate_.reset(new ChromeNetworkDelegate( | 478 network_delegate_.reset(new ChromeNetworkDelegate( |
479 io_thread_globals->extension_event_router_forwarder.get(), | 479 io_thread_globals->extension_event_router_forwarder.get(), |
480 profile_params_->extension_info_map, | 480 profile_params_->extension_info_map, |
481 url_blacklist_manager_.get(), | 481 url_blacklist_manager_.get(), |
482 profile_params_->profile, | 482 profile_params_->profile, |
483 profile_params_->cookie_settings, | 483 profile_params_->cookie_settings, |
484 &enable_referrers_, | 484 &enable_referrers_, |
485 cache_stats_)); | 485 load_time_stats_)); |
486 | 486 |
487 fraudulent_certificate_reporter_.reset( | 487 fraudulent_certificate_reporter_.reset( |
488 new chrome_browser_net::ChromeFraudulentCertificateReporter( | 488 new chrome_browser_net::ChromeFraudulentCertificateReporter( |
489 main_request_context_.get())); | 489 main_request_context_.get())); |
490 | 490 |
491 proxy_service_.reset( | 491 proxy_service_.reset( |
492 ProxyServiceFactory::CreateProxyService( | 492 ProxyServiceFactory::CreateProxyService( |
493 io_thread->net_log(), | 493 io_thread->net_log(), |
494 io_thread_globals->proxy_script_fetcher_context.get(), | 494 io_thread_globals->proxy_script_fetcher_context.get(), |
495 profile_params_->proxy_config_service.release(), | 495 profile_params_->proxy_config_service.release(), |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 } | 600 } |
601 | 601 |
602 void ProfileIOData::set_server_bound_cert_service( | 602 void ProfileIOData::set_server_bound_cert_service( |
603 net::ServerBoundCertService* server_bound_cert_service) const { | 603 net::ServerBoundCertService* server_bound_cert_service) const { |
604 server_bound_cert_service_.reset(server_bound_cert_service); | 604 server_bound_cert_service_.reset(server_bound_cert_service); |
605 } | 605 } |
606 | 606 |
607 void ProfileIOData::DestroyResourceContext() { | 607 void ProfileIOData::DestroyResourceContext() { |
608 resource_context_.reset(); | 608 resource_context_.reset(); |
609 } | 609 } |
OLD | NEW |