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 24 matching lines...) Expand all Loading... |
35 #include "chrome/browser/io_thread.h" | 35 #include "chrome/browser/io_thread.h" |
36 #include "chrome/browser/media/media_device_id_salt.h" | 36 #include "chrome/browser/media/media_device_id_salt.h" |
37 #include "chrome/browser/net/about_protocol_handler.h" | 37 #include "chrome/browser/net/about_protocol_handler.h" |
38 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h" | 38 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h" |
39 #include "chrome/browser/net/chrome_http_user_agent_settings.h" | 39 #include "chrome/browser/net/chrome_http_user_agent_settings.h" |
40 #include "chrome/browser/net/chrome_net_log.h" | 40 #include "chrome/browser/net/chrome_net_log.h" |
41 #include "chrome/browser/net/chrome_network_delegate.h" | 41 #include "chrome/browser/net/chrome_network_delegate.h" |
42 #include "chrome/browser/net/chrome_url_request_context_getter.h" | 42 #include "chrome/browser/net/chrome_url_request_context_getter.h" |
43 #include "chrome/browser/net/cookie_store_util.h" | 43 #include "chrome/browser/net/cookie_store_util.h" |
44 #include "chrome/browser/net/proxy_service_factory.h" | 44 #include "chrome/browser/net/proxy_service_factory.h" |
| 45 #include "chrome/browser/net/resource_prefetch_predictor_observer.h" |
| 46 #include "chrome/browser/predictors/resource_prefetch_predictor.h" |
| 47 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h" |
45 #include "chrome/browser/profiles/profile.h" | 48 #include "chrome/browser/profiles/profile.h" |
46 #include "chrome/browser/profiles/profile_manager.h" | 49 #include "chrome/browser/profiles/profile_manager.h" |
47 #include "chrome/browser/signin/signin_names_io_thread.h" | 50 #include "chrome/browser/signin/signin_names_io_thread.h" |
48 #include "chrome/common/chrome_paths.h" | 51 #include "chrome/common/chrome_paths.h" |
49 #include "chrome/common/chrome_switches.h" | 52 #include "chrome/common/chrome_switches.h" |
50 #include "chrome/common/pref_names.h" | 53 #include "chrome/common/pref_names.h" |
51 #include "chrome/common/url_constants.h" | 54 #include "chrome/common/url_constants.h" |
52 #include "components/dom_distiller/core/url_constants.h" | 55 #include "components/dom_distiller/core/url_constants.h" |
53 #include "components/startup_metric_utils/startup_metric_utils.h" | 56 #include "components/startup_metric_utils/startup_metric_utils.h" |
54 #include "components/sync_driver/pref_names.h" | 57 #include "components/sync_driver/pref_names.h" |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 params->cookie_settings = CookieSettings::Factory::GetForProfile(profile); | 353 params->cookie_settings = CookieSettings::Factory::GetForProfile(profile); |
351 params->host_content_settings_map = profile->GetHostContentSettingsMap(); | 354 params->host_content_settings_map = profile->GetHostContentSettingsMap(); |
352 params->ssl_config_service = profile->GetSSLConfigService(); | 355 params->ssl_config_service = profile->GetSSLConfigService(); |
353 params->cookie_monster_delegate = | 356 params->cookie_monster_delegate = |
354 chrome_browser_net::CreateCookieDelegate(profile); | 357 chrome_browser_net::CreateCookieDelegate(profile); |
355 #if defined(ENABLE_EXTENSIONS) | 358 #if defined(ENABLE_EXTENSIONS) |
356 params->extension_info_map = | 359 params->extension_info_map = |
357 extensions::ExtensionSystem::Get(profile)->info_map(); | 360 extensions::ExtensionSystem::Get(profile)->info_map(); |
358 #endif | 361 #endif |
359 | 362 |
| 363 if (predictors::ResourcePrefetchPredictor* predictor = |
| 364 predictors::ResourcePrefetchPredictorFactory::GetForProfile( |
| 365 profile)) { |
| 366 resource_prefetch_predictor_observer_.reset( |
| 367 new chrome_browser_net::ResourcePrefetchPredictorObserver(predictor)); |
| 368 } |
| 369 |
360 ProtocolHandlerRegistry* protocol_handler_registry = | 370 ProtocolHandlerRegistry* protocol_handler_registry = |
361 ProtocolHandlerRegistryFactory::GetForBrowserContext(profile); | 371 ProtocolHandlerRegistryFactory::GetForBrowserContext(profile); |
362 DCHECK(protocol_handler_registry); | 372 DCHECK(protocol_handler_registry); |
363 | 373 |
364 // The profile instance is only available here in the InitializeOnUIThread | 374 // The profile instance is only available here in the InitializeOnUIThread |
365 // method, so we create the url job factory here, then save it for | 375 // method, so we create the url job factory here, then save it for |
366 // later delivery to the job factory in Init(). | 376 // later delivery to the job factory in Init(). |
367 params->protocol_handler_interceptor = | 377 params->protocol_handler_interceptor = |
368 protocol_handler_registry->CreateJobInterceptorFactory(); | 378 protocol_handler_registry->CreateJobInterceptorFactory(); |
369 | 379 |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1069 // Take ownership over these parameters. | 1079 // Take ownership over these parameters. |
1070 cookie_settings_ = profile_params_->cookie_settings; | 1080 cookie_settings_ = profile_params_->cookie_settings; |
1071 host_content_settings_map_ = profile_params_->host_content_settings_map; | 1081 host_content_settings_map_ = profile_params_->host_content_settings_map; |
1072 #if defined(ENABLE_EXTENSIONS) | 1082 #if defined(ENABLE_EXTENSIONS) |
1073 extension_info_map_ = profile_params_->extension_info_map; | 1083 extension_info_map_ = profile_params_->extension_info_map; |
1074 #endif | 1084 #endif |
1075 | 1085 |
1076 resource_context_->host_resolver_ = io_thread_globals->host_resolver.get(); | 1086 resource_context_->host_resolver_ = io_thread_globals->host_resolver.get(); |
1077 resource_context_->request_context_ = main_request_context_.get(); | 1087 resource_context_->request_context_ = main_request_context_.get(); |
1078 | 1088 |
| 1089 if (profile_params_->resource_prefetch_predictor_observer_) { |
| 1090 resource_prefetch_predictor_observer_.reset( |
| 1091 profile_params_->resource_prefetch_predictor_observer_.release()); |
| 1092 } |
| 1093 |
1079 #if defined(ENABLE_MANAGED_USERS) | 1094 #if defined(ENABLE_MANAGED_USERS) |
1080 supervised_user_url_filter_ = profile_params_->supervised_user_url_filter; | 1095 supervised_user_url_filter_ = profile_params_->supervised_user_url_filter; |
1081 #endif | 1096 #endif |
1082 | 1097 |
1083 #if defined(OS_CHROMEOS) | 1098 #if defined(OS_CHROMEOS) |
1084 username_hash_ = profile_params_->username_hash; | 1099 username_hash_ = profile_params_->username_hash; |
1085 use_system_key_slot_ = profile_params_->use_system_key_slot; | 1100 use_system_key_slot_ = profile_params_->use_system_key_slot; |
1086 if (use_system_key_slot_) | 1101 if (use_system_key_slot_) |
1087 EnableNSSSystemKeySlotForResourceContext(resource_context_.get()); | 1102 EnableNSSSystemKeySlotForResourceContext(resource_context_.get()); |
1088 | 1103 |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1300 void ProfileIOData::SetCookieSettingsForTesting( | 1315 void ProfileIOData::SetCookieSettingsForTesting( |
1301 CookieSettings* cookie_settings) { | 1316 CookieSettings* cookie_settings) { |
1302 DCHECK(!cookie_settings_.get()); | 1317 DCHECK(!cookie_settings_.get()); |
1303 cookie_settings_ = cookie_settings; | 1318 cookie_settings_ = cookie_settings; |
1304 } | 1319 } |
1305 | 1320 |
1306 void ProfileIOData::set_signin_names_for_testing( | 1321 void ProfileIOData::set_signin_names_for_testing( |
1307 SigninNamesOnIOThread* signin_names) { | 1322 SigninNamesOnIOThread* signin_names) { |
1308 signin_names_.reset(signin_names); | 1323 signin_names_.reset(signin_names); |
1309 } | 1324 } |
OLD | NEW |