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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 | 219 |
220 initialized_on_UI_thread_ = true; | 220 initialized_on_UI_thread_ = true; |
221 | 221 |
222 // We need to make sure that content initializes its own data structures that | 222 // We need to make sure that content initializes its own data structures that |
223 // are associated with each ResourceContext because we might post this | 223 // are associated with each ResourceContext because we might post this |
224 // object to the IO thread after this function. | 224 // object to the IO thread after this function. |
225 BrowserContext::EnsureResourceContextInitialized(profile); | 225 BrowserContext::EnsureResourceContextInitialized(profile); |
226 } | 226 } |
227 | 227 |
228 ProfileIOData::AppRequestContext::AppRequestContext( | 228 ProfileIOData::AppRequestContext::AppRequestContext( |
229 chrome_browser_net::CacheStats* cache_stats) | 229 chrome_browser_net::LoadTimeStats* load_time_stats) |
230 : ChromeURLRequestContext(ChromeURLRequestContext::CONTEXT_TYPE_APP, | 230 : ChromeURLRequestContext(ChromeURLRequestContext::CONTEXT_TYPE_APP, |
231 cache_stats) { | 231 load_time_stats) { |
232 } | 232 } |
233 | 233 |
234 void ProfileIOData::AppRequestContext::SetCookieStore( | 234 void ProfileIOData::AppRequestContext::SetCookieStore( |
235 net::CookieStore* cookie_store) { | 235 net::CookieStore* cookie_store) { |
236 cookie_store_ = cookie_store; | 236 cookie_store_ = cookie_store; |
237 set_cookie_store(cookie_store); | 237 set_cookie_store(cookie_store); |
238 } | 238 } |
239 | 239 |
240 void ProfileIOData::AppRequestContext::SetHttpTransactionFactory( | 240 void ProfileIOData::AppRequestContext::SetHttpTransactionFactory( |
241 net::HttpTransactionFactory* http_factory) { | 241 net::HttpTransactionFactory* http_factory) { |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 | 459 |
460 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. | 460 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. |
461 CHECK(initialized_on_UI_thread_); | 461 CHECK(initialized_on_UI_thread_); |
462 | 462 |
463 // TODO(jhawkins): Return to DCHECK once crbug.com/102004 is fixed. | 463 // TODO(jhawkins): Return to DCHECK once crbug.com/102004 is fixed. |
464 CHECK(profile_params_.get()); | 464 CHECK(profile_params_.get()); |
465 | 465 |
466 IOThread* const io_thread = profile_params_->io_thread; | 466 IOThread* const io_thread = profile_params_->io_thread; |
467 IOThread::Globals* const io_thread_globals = io_thread->globals(); | 467 IOThread::Globals* const io_thread_globals = io_thread->globals(); |
468 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 468 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
469 cache_stats_ = GetCacheStats(io_thread_globals); | 469 load_time_stats_ = GetLoadTimeStats(io_thread_globals); |
470 | 470 |
471 // Create the common request contexts. | 471 // Create the common request contexts. |
472 main_request_context_.reset( | 472 main_request_context_.reset( |
473 new ChromeURLRequestContext(ChromeURLRequestContext::CONTEXT_TYPE_MAIN, | 473 new ChromeURLRequestContext(ChromeURLRequestContext::CONTEXT_TYPE_MAIN, |
474 cache_stats_)); | 474 load_time_stats_)); |
475 extensions_request_context_.reset( | 475 extensions_request_context_.reset( |
476 new ChromeURLRequestContext( | 476 new ChromeURLRequestContext( |
477 ChromeURLRequestContext::CONTEXT_TYPE_EXTENSIONS, | 477 ChromeURLRequestContext::CONTEXT_TYPE_EXTENSIONS, |
478 cache_stats_)); | 478 load_time_stats_)); |
479 | 479 |
480 chrome_url_data_manager_backend_.reset(new ChromeURLDataManagerBackend); | 480 chrome_url_data_manager_backend_.reset(new ChromeURLDataManagerBackend); |
481 | 481 |
482 network_delegate_.reset(new ChromeNetworkDelegate( | 482 network_delegate_.reset(new ChromeNetworkDelegate( |
483 io_thread_globals->extension_event_router_forwarder.get(), | 483 io_thread_globals->extension_event_router_forwarder.get(), |
484 profile_params_->extension_info_map, | 484 profile_params_->extension_info_map, |
485 url_blacklist_manager_.get(), | 485 url_blacklist_manager_.get(), |
486 #if !defined(OS_ANDROID) | 486 #if !defined(OS_ANDROID) |
487 ManagedMode::GetURLFilter(), | 487 ManagedMode::GetURLFilter(), |
488 #else | 488 #else |
489 NULL, | 489 NULL, |
490 #endif | 490 #endif |
491 profile_params_->profile, | 491 profile_params_->profile, |
492 profile_params_->cookie_settings, | 492 profile_params_->cookie_settings, |
493 &enable_referrers_, | 493 &enable_referrers_, |
494 cache_stats_)); | 494 load_time_stats_)); |
495 | 495 |
496 fraudulent_certificate_reporter_.reset( | 496 fraudulent_certificate_reporter_.reset( |
497 new chrome_browser_net::ChromeFraudulentCertificateReporter( | 497 new chrome_browser_net::ChromeFraudulentCertificateReporter( |
498 main_request_context_.get())); | 498 main_request_context_.get())); |
499 | 499 |
500 proxy_service_.reset( | 500 proxy_service_.reset( |
501 ProxyServiceFactory::CreateProxyService( | 501 ProxyServiceFactory::CreateProxyService( |
502 io_thread->net_log(), | 502 io_thread->net_log(), |
503 io_thread_globals->proxy_script_fetcher_context.get(), | 503 io_thread_globals->proxy_script_fetcher_context.get(), |
504 profile_params_->proxy_config_service.release(), | 504 profile_params_->proxy_config_service.release(), |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 } | 609 } |
610 | 610 |
611 void ProfileIOData::set_server_bound_cert_service( | 611 void ProfileIOData::set_server_bound_cert_service( |
612 net::ServerBoundCertService* server_bound_cert_service) const { | 612 net::ServerBoundCertService* server_bound_cert_service) const { |
613 server_bound_cert_service_.reset(server_bound_cert_service); | 613 server_bound_cert_service_.reset(server_bound_cert_service); |
614 } | 614 } |
615 | 615 |
616 void ProfileIOData::DestroyResourceContext() { | 616 void ProfileIOData::DestroyResourceContext() { |
617 resource_context_.reset(); | 617 resource_context_.reset(); |
618 } | 618 } |
OLD | NEW |