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 18 matching lines...) Expand all Loading... |
29 #include "chrome/browser/io_thread.h" | 29 #include "chrome/browser/io_thread.h" |
30 #include "chrome/browser/net/chrome_cookie_notification_details.h" | 30 #include "chrome/browser/net/chrome_cookie_notification_details.h" |
31 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h" | 31 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h" |
32 #include "chrome/browser/net/chrome_net_log.h" | 32 #include "chrome/browser/net/chrome_net_log.h" |
33 #include "chrome/browser/net/chrome_network_delegate.h" | 33 #include "chrome/browser/net/chrome_network_delegate.h" |
34 #include "chrome/browser/net/http_server_properties_manager.h" | 34 #include "chrome/browser/net/http_server_properties_manager.h" |
35 #include "chrome/browser/net/proxy_service_factory.h" | 35 #include "chrome/browser/net/proxy_service_factory.h" |
36 #include "chrome/browser/net/transport_security_persister.h" | 36 #include "chrome/browser/net/transport_security_persister.h" |
37 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 37 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
38 #include "chrome/browser/policy/url_blacklist_manager.h" | 38 #include "chrome/browser/policy/url_blacklist_manager.h" |
| 39 #include "chrome/browser/predictors/resource_prefetch_predictor.h" |
| 40 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h" |
39 #include "chrome/browser/prefs/pref_service.h" | 41 #include "chrome/browser/prefs/pref_service.h" |
40 #include "chrome/browser/profiles/profile.h" | 42 #include "chrome/browser/profiles/profile.h" |
41 #include "chrome/browser/profiles/profile_manager.h" | 43 #include "chrome/browser/profiles/profile_manager.h" |
42 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" | 44 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" |
43 #include "chrome/common/chrome_notification_types.h" | 45 #include "chrome/common/chrome_notification_types.h" |
44 #include "chrome/common/chrome_switches.h" | 46 #include "chrome/common/chrome_switches.h" |
45 #include "chrome/common/pref_names.h" | 47 #include "chrome/common/pref_names.h" |
46 #include "chrome/common/url_constants.h" | 48 #include "chrome/common/url_constants.h" |
47 #include "content/public/browser/browser_thread.h" | 49 #include "content/public/browser/browser_thread.h" |
48 #include "content/public/browser/host_zoom_map.h" | 50 #include "content/public/browser/host_zoom_map.h" |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 params->protocol_handler_registry = profile->GetProtocolHandlerRegistry(); | 210 params->protocol_handler_registry = profile->GetProtocolHandlerRegistry(); |
209 | 211 |
210 ChromeProxyConfigService* proxy_config_service = | 212 ChromeProxyConfigService* proxy_config_service = |
211 ProxyServiceFactory::CreateProxyConfigService(true); | 213 ProxyServiceFactory::CreateProxyConfigService(true); |
212 params->proxy_config_service.reset(proxy_config_service); | 214 params->proxy_config_service.reset(proxy_config_service); |
213 profile->GetProxyConfigTracker()->SetChromeProxyConfigService( | 215 profile->GetProxyConfigTracker()->SetChromeProxyConfigService( |
214 proxy_config_service); | 216 proxy_config_service); |
215 params->profile = profile; | 217 params->profile = profile; |
216 profile_params_.reset(params.release()); | 218 profile_params_.reset(params.release()); |
217 | 219 |
| 220 params->resource_prefetch_predictor_ = |
| 221 predictors::ResourcePrefetchPredictorFactory::GetForProfile(profile); |
| 222 |
218 // The URLBlacklistManager has to be created on the UI thread to register | 223 // The URLBlacklistManager has to be created on the UI thread to register |
219 // observers of |pref_service|, and it also has to clean up on | 224 // observers of |pref_service|, and it also has to clean up on |
220 // ShutdownOnUIThread to release these observers on the right thread. | 225 // ShutdownOnUIThread to release these observers on the right thread. |
221 // Don't pass it in |profile_params_| to make sure it is correctly cleaned up, | 226 // Don't pass it in |profile_params_| to make sure it is correctly cleaned up, |
222 // in particular when this ProfileIOData isn't |initialized_| during deletion. | 227 // in particular when this ProfileIOData isn't |initialized_| during deletion. |
223 #if defined(ENABLE_CONFIGURATION_POLICY) | 228 #if defined(ENABLE_CONFIGURATION_POLICY) |
224 url_blacklist_manager_.reset(new policy::URLBlacklistManager(pref_service)); | 229 url_blacklist_manager_.reset(new policy::URLBlacklistManager(pref_service)); |
225 #endif | 230 #endif |
226 | 231 |
227 initialized_on_UI_thread_ = true; | 232 initialized_on_UI_thread_ = true; |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 extensions_request_context_.reset(new ChromeURLRequestContext); | 478 extensions_request_context_.reset(new ChromeURLRequestContext); |
474 | 479 |
475 chrome_url_data_manager_backend_.reset(new ChromeURLDataManagerBackend); | 480 chrome_url_data_manager_backend_.reset(new ChromeURLDataManagerBackend); |
476 | 481 |
477 network_delegate_.reset(new ChromeNetworkDelegate( | 482 network_delegate_.reset(new ChromeNetworkDelegate( |
478 io_thread_globals->extension_event_router_forwarder.get(), | 483 io_thread_globals->extension_event_router_forwarder.get(), |
479 profile_params_->extension_info_map, | 484 profile_params_->extension_info_map, |
480 url_blacklist_manager_.get(), | 485 url_blacklist_manager_.get(), |
481 profile_params_->profile, | 486 profile_params_->profile, |
482 profile_params_->cookie_settings, | 487 profile_params_->cookie_settings, |
| 488 profile_params_->resource_prefetch_predictor_, |
483 &enable_referrers_)); | 489 &enable_referrers_)); |
484 | 490 |
485 fraudulent_certificate_reporter_.reset( | 491 fraudulent_certificate_reporter_.reset( |
486 new chrome_browser_net::ChromeFraudulentCertificateReporter( | 492 new chrome_browser_net::ChromeFraudulentCertificateReporter( |
487 main_request_context_.get())); | 493 main_request_context_.get())); |
488 | 494 |
489 proxy_service_.reset( | 495 proxy_service_.reset( |
490 ProxyServiceFactory::CreateProxyService( | 496 ProxyServiceFactory::CreateProxyService( |
491 io_thread->net_log(), | 497 io_thread->net_log(), |
492 io_thread_globals->proxy_script_fetcher_context.get(), | 498 io_thread_globals->proxy_script_fetcher_context.get(), |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 } | 593 } |
588 | 594 |
589 void ProfileIOData::set_server_bound_cert_service( | 595 void ProfileIOData::set_server_bound_cert_service( |
590 net::ServerBoundCertService* server_bound_cert_service) const { | 596 net::ServerBoundCertService* server_bound_cert_service) const { |
591 server_bound_cert_service_.reset(server_bound_cert_service); | 597 server_bound_cert_service_.reset(server_bound_cert_service); |
592 } | 598 } |
593 | 599 |
594 void ProfileIOData::DestroyResourceContext() { | 600 void ProfileIOData::DestroyResourceContext() { |
595 resource_context_.reset(); | 601 resource_context_.reset(); |
596 } | 602 } |
OLD | NEW |