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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
48 #include "chrome/browser/profiles/profile_manager.h" | 48 #include "chrome/browser/profiles/profile_manager.h" |
49 #include "chrome/browser/signin/signin_names_io_thread.h" | 49 #include "chrome/browser/signin/signin_names_io_thread.h" |
50 #include "chrome/common/chrome_paths.h" | 50 #include "chrome/common/chrome_paths.h" |
51 #include "chrome/common/chrome_switches.h" | 51 #include "chrome/common/chrome_switches.h" |
52 #include "chrome/common/pref_names.h" | 52 #include "chrome/common/pref_names.h" |
53 #include "chrome/common/url_constants.h" | 53 #include "chrome/common/url_constants.h" |
54 #include "components/content_settings/core/browser/content_settings_provider.h" | 54 #include "components/content_settings/core/browser/content_settings_provider.h" |
55 #include "components/content_settings/core/browser/host_content_settings_map.h" | 55 #include "components/content_settings/core/browser/host_content_settings_map.h" |
56 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf ig_service.h" | 56 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf ig_service.h" |
57 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf igurator.h" | 57 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf igurator.h" |
58 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_netw ork_delegate.h" | |
58 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett ings.h" | 59 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett ings.h" |
59 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_switc hes.h" | 60 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_switc hes.h" |
60 #include "components/dom_distiller/core/url_constants.h" | 61 #include "components/dom_distiller/core/url_constants.h" |
61 #include "components/startup_metric_utils/startup_metric_utils.h" | 62 #include "components/startup_metric_utils/startup_metric_utils.h" |
62 #include "components/sync_driver/pref_names.h" | 63 #include "components/sync_driver/pref_names.h" |
63 #include "components/url_fixer/url_fixer.h" | 64 #include "components/url_fixer/url_fixer.h" |
64 #include "content/public/browser/browser_thread.h" | 65 #include "content/public/browser/browser_thread.h" |
65 #include "content/public/browser/host_zoom_map.h" | 66 #include "content/public/browser/host_zoom_map.h" |
66 #include "content/public/browser/notification_service.h" | 67 #include "content/public/browser/notification_service.h" |
67 #include "content/public/browser/resource_context.h" | 68 #include "content/public/browser/resource_context.h" |
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
999 CHECK(profile_params_.get()); | 1000 CHECK(profile_params_.get()); |
1000 | 1001 |
1001 IOThread* const io_thread = profile_params_->io_thread; | 1002 IOThread* const io_thread = profile_params_->io_thread; |
1002 IOThread::Globals* const io_thread_globals = io_thread->globals(); | 1003 IOThread::Globals* const io_thread_globals = io_thread->globals(); |
1003 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 1004 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
1004 | 1005 |
1005 // Create the common request contexts. | 1006 // Create the common request contexts. |
1006 main_request_context_.reset(new net::URLRequestContext()); | 1007 main_request_context_.reset(new net::URLRequestContext()); |
1007 extensions_request_context_.reset(new net::URLRequestContext()); | 1008 extensions_request_context_.reset(new net::URLRequestContext()); |
1008 | 1009 |
1009 ChromeNetworkDelegate* network_delegate = | 1010 scoped_ptr<ChromeNetworkDelegate> network_delegate = |
1010 new ChromeNetworkDelegate( | 1011 scoped_ptr<ChromeNetworkDelegate>(new ChromeNetworkDelegate( |
1011 #if defined(ENABLE_EXTENSIONS) | 1012 #if defined(ENABLE_EXTENSIONS) |
1012 io_thread_globals->extension_event_router_forwarder.get(), | 1013 io_thread_globals->extension_event_router_forwarder.get(), |
1013 #else | 1014 #else |
1014 NULL, | 1015 NULL, |
1015 #endif | 1016 #endif |
1016 &enable_referrers_); | 1017 &enable_referrers_)); |
1017 if (command_line.HasSwitch(switches::kEnableClientHints)) | 1018 if (command_line.HasSwitch(switches::kEnableClientHints)) |
1018 network_delegate->SetEnableClientHints(); | 1019 network_delegate->SetEnableClientHints(); |
1019 #if defined(ENABLE_EXTENSIONS) | 1020 #if defined(ENABLE_EXTENSIONS) |
1020 network_delegate->set_extension_info_map( | 1021 network_delegate->set_extension_info_map( |
1021 profile_params_->extension_info_map.get()); | 1022 profile_params_->extension_info_map.get()); |
1022 #endif | 1023 #endif |
1023 #if defined(ENABLE_CONFIGURATION_POLICY) | 1024 #if defined(ENABLE_CONFIGURATION_POLICY) |
1024 network_delegate->set_url_blacklist_manager(url_blacklist_manager_.get()); | 1025 network_delegate->set_url_blacklist_manager(url_blacklist_manager_.get()); |
1025 #endif | 1026 #endif |
1026 network_delegate->set_profile(profile_params_->profile); | 1027 network_delegate->set_profile(profile_params_->profile); |
1027 network_delegate->set_profile_path(profile_params_->path); | 1028 network_delegate->set_profile_path(profile_params_->path); |
1028 network_delegate->set_cookie_settings(profile_params_->cookie_settings.get()); | 1029 network_delegate->set_cookie_settings(profile_params_->cookie_settings.get()); |
1029 network_delegate->set_enable_do_not_track(&enable_do_not_track_); | 1030 network_delegate->set_enable_do_not_track(&enable_do_not_track_); |
1030 network_delegate->set_force_google_safe_search(&force_safesearch_); | 1031 network_delegate->set_force_google_safe_search(&force_safesearch_); |
1031 network_delegate->set_prerender_tracker(profile_params_->prerender_tracker); | 1032 network_delegate->set_prerender_tracker(profile_params_->prerender_tracker); |
1032 network_delegate_.reset(network_delegate); | 1033 chrome_network_delegate_ = network_delegate.get(); |
1034 Profile* profile = reinterpret_cast<Profile*>(profile_params_->profile); | |
1035 // Ignore off-the-record data. | |
1036 PrefService* profile_prefs = NULL; | |
1037 scoped_refptr<base::MessageLoopProxy> ui_thread_proxy; | |
1038 if (profile && !profile->IsOffTheRecord()) { | |
bengr
2014/12/02 17:20:00
When would provide be NULL?
megjablon
2014/12/02 22:33:21
Removed in moved code
| |
1039 profile_prefs = profile->GetPrefs(); | |
1040 ui_thread_proxy = | |
1041 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI); | |
1042 } | |
1043 data_reduction_proxy::DataReductionProxyNetworkDelegate* | |
1044 data_reduction_proxy_network_delegate = | |
1045 new data_reduction_proxy::DataReductionProxyNetworkDelegate( | |
1046 network_delegate.Pass()); | |
1047 data_reduction_proxy_network_delegate->Init( | |
bengr
2014/12/02 17:20:00
Again, this Init needs to be rewritten.
megjablon
2014/12/02 22:33:21
Removed.
| |
1048 profile_prefs, ui_thread_proxy, NULL, NULL, NULL, NULL, NULL, | |
bengr
2014/12/02 17:20:00
This confuses me. You always instantiate the DRPNe
megjablon
2014/12/02 22:33:21
Moved into ProfileImplIOData as discussed.
| |
1049 data_reduction_proxy::DataReductionProxyNetworkDelegate:: | |
1050 OnResolveProxyHandler(), | |
1051 data_reduction_proxy::DataReductionProxyNetworkDelegate:: | |
1052 ProxyConfigGetter()); | |
1053 data_reduction_proxy_network_delegate_.reset( | |
1054 data_reduction_proxy_network_delegate); | |
1033 | 1055 |
1034 fraudulent_certificate_reporter_.reset( | 1056 fraudulent_certificate_reporter_.reset( |
1035 new chrome_browser_net::ChromeFraudulentCertificateReporter( | 1057 new chrome_browser_net::ChromeFraudulentCertificateReporter( |
1036 main_request_context_.get())); | 1058 main_request_context_.get())); |
1037 | 1059 |
1038 // NOTE: Proxy service uses the default io thread network delegate, not the | 1060 // NOTE: Proxy service uses the default io thread network delegate, not the |
1039 // delegate just created. | 1061 // delegate just created. |
1040 proxy_service_.reset( | 1062 proxy_service_.reset( |
1041 ProxyServiceFactory::CreateProxyService( | 1063 ProxyServiceFactory::CreateProxyService( |
1042 io_thread->net_log(), | 1064 io_thread->net_log(), |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1288 void ProfileIOData::SetCookieSettingsForTesting( | 1310 void ProfileIOData::SetCookieSettingsForTesting( |
1289 CookieSettings* cookie_settings) { | 1311 CookieSettings* cookie_settings) { |
1290 DCHECK(!cookie_settings_.get()); | 1312 DCHECK(!cookie_settings_.get()); |
1291 cookie_settings_ = cookie_settings; | 1313 cookie_settings_ = cookie_settings; |
1292 } | 1314 } |
1293 | 1315 |
1294 void ProfileIOData::set_signin_names_for_testing( | 1316 void ProfileIOData::set_signin_names_for_testing( |
1295 SigninNamesOnIOThread* signin_names) { | 1317 SigninNamesOnIOThread* signin_names) { |
1296 signin_names_.reset(signin_names); | 1318 signin_names_.reset(signin_names); |
1297 } | 1319 } |
OLD | NEW |