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 25 matching lines...) Expand all Loading... |
36 #include "chrome/browser/io_thread.h" | 36 #include "chrome/browser/io_thread.h" |
37 #include "chrome/browser/media/media_device_id_salt.h" | 37 #include "chrome/browser/media/media_device_id_salt.h" |
38 #include "chrome/browser/net/about_protocol_handler.h" | 38 #include "chrome/browser/net/about_protocol_handler.h" |
39 #include "chrome/browser/net/chrome_cookie_notification_details.h" | 39 #include "chrome/browser/net/chrome_cookie_notification_details.h" |
40 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h" | 40 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h" |
41 #include "chrome/browser/net/chrome_http_user_agent_settings.h" | 41 #include "chrome/browser/net/chrome_http_user_agent_settings.h" |
42 #include "chrome/browser/net/chrome_net_log.h" | 42 #include "chrome/browser/net/chrome_net_log.h" |
43 #include "chrome/browser/net/chrome_network_delegate.h" | 43 #include "chrome/browser/net/chrome_network_delegate.h" |
44 #include "chrome/browser/net/evicted_domain_cookie_counter.h" | 44 #include "chrome/browser/net/evicted_domain_cookie_counter.h" |
45 #include "chrome/browser/net/proxy_service_factory.h" | 45 #include "chrome/browser/net/proxy_service_factory.h" |
46 #include "chrome/browser/net/resource_prefetch_predictor_observer.h" | |
47 #include "chrome/browser/predictors/resource_prefetch_predictor.h" | |
48 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h" | |
49 #include "chrome/browser/profiles/profile.h" | 46 #include "chrome/browser/profiles/profile.h" |
50 #include "chrome/browser/profiles/profile_manager.h" | 47 #include "chrome/browser/profiles/profile_manager.h" |
51 #include "chrome/browser/signin/signin_names_io_thread.h" | 48 #include "chrome/browser/signin/signin_names_io_thread.h" |
52 #include "chrome/common/chrome_paths.h" | 49 #include "chrome/common/chrome_paths.h" |
53 #include "chrome/common/chrome_switches.h" | 50 #include "chrome/common/chrome_switches.h" |
54 #include "chrome/common/net/url_fixer_upper.h" | 51 #include "chrome/common/net/url_fixer_upper.h" |
55 #include "chrome/common/pref_names.h" | 52 #include "chrome/common/pref_names.h" |
56 #include "chrome/common/url_constants.h" | 53 #include "chrome/common/url_constants.h" |
57 #include "components/startup_metric_utils/startup_metric_utils.h" | 54 #include "components/startup_metric_utils/startup_metric_utils.h" |
58 #include "content/public/browser/browser_thread.h" | 55 #include "content/public/browser/browser_thread.h" |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 params->ssl_config_service = profile->GetSSLConfigService(); | 372 params->ssl_config_service = profile->GetSSLConfigService(); |
376 base::Callback<Profile*(void)> profile_getter = | 373 base::Callback<Profile*(void)> profile_getter = |
377 base::Bind(&GetProfileOnUI, g_browser_process->profile_manager(), | 374 base::Bind(&GetProfileOnUI, g_browser_process->profile_manager(), |
378 profile); | 375 profile); |
379 params->cookie_monster_delegate = | 376 params->cookie_monster_delegate = |
380 new chrome_browser_net::EvictedDomainCookieCounter( | 377 new chrome_browser_net::EvictedDomainCookieCounter( |
381 new ChromeCookieMonsterDelegate(profile_getter)); | 378 new ChromeCookieMonsterDelegate(profile_getter)); |
382 params->extension_info_map = | 379 params->extension_info_map = |
383 extensions::ExtensionSystem::Get(profile)->info_map(); | 380 extensions::ExtensionSystem::Get(profile)->info_map(); |
384 | 381 |
385 if (predictors::ResourcePrefetchPredictor* predictor = | |
386 predictors::ResourcePrefetchPredictorFactory::GetForProfile( | |
387 profile)) { | |
388 resource_prefetch_predictor_observer_.reset( | |
389 new chrome_browser_net::ResourcePrefetchPredictorObserver(predictor)); | |
390 } | |
391 | |
392 ProtocolHandlerRegistry* protocol_handler_registry = | 382 ProtocolHandlerRegistry* protocol_handler_registry = |
393 ProtocolHandlerRegistryFactory::GetForProfile(profile); | 383 ProtocolHandlerRegistryFactory::GetForProfile(profile); |
394 DCHECK(protocol_handler_registry); | 384 DCHECK(protocol_handler_registry); |
395 | 385 |
396 // The profile instance is only available here in the InitializeOnUIThread | 386 // The profile instance is only available here in the InitializeOnUIThread |
397 // method, so we create the url job factory here, then save it for | 387 // method, so we create the url job factory here, then save it for |
398 // later delivery to the job factory in Init(). | 388 // later delivery to the job factory in Init(). |
399 params->protocol_handler_interceptor = | 389 params->protocol_handler_interceptor = |
400 protocol_handler_registry->CreateJobInterceptorFactory(); | 390 protocol_handler_registry->CreateJobInterceptorFactory(); |
401 | 391 |
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1012 is_incognito())); | 1002 is_incognito())); |
1013 | 1003 |
1014 // Take ownership over these parameters. | 1004 // Take ownership over these parameters. |
1015 cookie_settings_ = profile_params_->cookie_settings; | 1005 cookie_settings_ = profile_params_->cookie_settings; |
1016 host_content_settings_map_ = profile_params_->host_content_settings_map; | 1006 host_content_settings_map_ = profile_params_->host_content_settings_map; |
1017 extension_info_map_ = profile_params_->extension_info_map; | 1007 extension_info_map_ = profile_params_->extension_info_map; |
1018 | 1008 |
1019 resource_context_->host_resolver_ = io_thread_globals->host_resolver.get(); | 1009 resource_context_->host_resolver_ = io_thread_globals->host_resolver.get(); |
1020 resource_context_->request_context_ = main_request_context_.get(); | 1010 resource_context_->request_context_ = main_request_context_.get(); |
1021 | 1011 |
1022 if (profile_params_->resource_prefetch_predictor_observer_) { | |
1023 resource_prefetch_predictor_observer_.reset( | |
1024 profile_params_->resource_prefetch_predictor_observer_.release()); | |
1025 } | |
1026 | |
1027 #if defined(ENABLE_MANAGED_USERS) | 1012 #if defined(ENABLE_MANAGED_USERS) |
1028 managed_mode_url_filter_ = profile_params_->managed_mode_url_filter; | 1013 managed_mode_url_filter_ = profile_params_->managed_mode_url_filter; |
1029 #endif | 1014 #endif |
1030 | 1015 |
1031 #if defined(OS_CHROMEOS) | 1016 #if defined(OS_CHROMEOS) |
1032 if (cert_verifier_) { | 1017 if (cert_verifier_) { |
1033 cert_verifier_->InitializeOnIOThread(); | 1018 cert_verifier_->InitializeOnIOThread(); |
1034 main_request_context_->set_cert_verifier(cert_verifier_.get()); | 1019 main_request_context_->set_cert_verifier(cert_verifier_.get()); |
1035 } else { | 1020 } else { |
1036 main_request_context_->set_cert_verifier( | 1021 main_request_context_->set_cert_verifier( |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1192 void ProfileIOData::SetCookieSettingsForTesting( | 1177 void ProfileIOData::SetCookieSettingsForTesting( |
1193 CookieSettings* cookie_settings) { | 1178 CookieSettings* cookie_settings) { |
1194 DCHECK(!cookie_settings_.get()); | 1179 DCHECK(!cookie_settings_.get()); |
1195 cookie_settings_ = cookie_settings; | 1180 cookie_settings_ = cookie_settings; |
1196 } | 1181 } |
1197 | 1182 |
1198 void ProfileIOData::set_signin_names_for_testing( | 1183 void ProfileIOData::set_signin_names_for_testing( |
1199 SigninNamesOnIOThread* signin_names) { | 1184 SigninNamesOnIOThread* signin_names) { |
1200 signin_names_.reset(signin_names); | 1185 signin_names_.reset(signin_names); |
1201 } | 1186 } |
OLD | NEW |