Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Side by Side Diff: chrome/browser/profiles/profile_io_data.cc

Issue 778463002: Wrapped data reduction proxy initialization into its own class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@network-delegate
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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" 45 #include "chrome/browser/net/resource_prefetch_predictor_observer.h"
46 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator. h"
47 #include "chrome/browser/predictors/resource_prefetch_predictor.h" 46 #include "chrome/browser/predictors/resource_prefetch_predictor.h"
48 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h" 47 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h"
49 #include "chrome/browser/profiles/profile.h" 48 #include "chrome/browser/profiles/profile.h"
50 #include "chrome/browser/profiles/profile_manager.h" 49 #include "chrome/browser/profiles/profile_manager.h"
51 #include "chrome/browser/signin/signin_names_io_thread.h" 50 #include "chrome/browser/signin/signin_names_io_thread.h"
52 #include "chrome/common/chrome_paths.h" 51 #include "chrome/common/chrome_paths.h"
53 #include "chrome/common/chrome_switches.h" 52 #include "chrome/common/chrome_switches.h"
54 #include "chrome/common/pref_names.h" 53 #include "chrome/common/pref_names.h"
55 #include "chrome/common/url_constants.h" 54 #include "chrome/common/url_constants.h"
56 #include "components/content_settings/core/browser/content_settings_provider.h" 55 #include "components/content_settings/core/browser/content_settings_provider.h"
57 #include "components/content_settings/core/browser/host_content_settings_map.h" 56 #include "components/content_settings/core/browser/host_content_settings_map.h"
58 #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_io_d ata.h"
59 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf igurator.h"
60 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_netw ork_delegate.h"
61 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett ings.h"
62 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_switc hes.h"
63 #include "components/dom_distiller/core/url_constants.h" 58 #include "components/dom_distiller/core/url_constants.h"
64 #include "components/startup_metric_utils/startup_metric_utils.h" 59 #include "components/startup_metric_utils/startup_metric_utils.h"
65 #include "components/sync_driver/pref_names.h" 60 #include "components/sync_driver/pref_names.h"
66 #include "components/url_fixer/url_fixer.h" 61 #include "components/url_fixer/url_fixer.h"
67 #include "content/public/browser/browser_thread.h" 62 #include "content/public/browser/browser_thread.h"
68 #include "content/public/browser/host_zoom_map.h" 63 #include "content/public/browser/host_zoom_map.h"
69 #include "content/public/browser/notification_service.h" 64 #include "content/public/browser/notification_service.h"
70 #include "content/public/browser/resource_context.h" 65 #include "content/public/browser/resource_context.h"
71 #include "net/base/keygen_handler.h" 66 #include "net/base/keygen_handler.h"
72 #include "net/cookies/canonical_cookie.h" 67 #include "net/cookies/canonical_cookie.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 #include "extensions/common/constants.h" 100 #include "extensions/common/constants.h"
106 #endif 101 #endif
107 102
108 #if defined(ENABLE_SUPERVISED_USERS) 103 #if defined(ENABLE_SUPERVISED_USERS)
109 #include "chrome/browser/supervised_user/supervised_user_service.h" 104 #include "chrome/browser/supervised_user/supervised_user_service.h"
110 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" 105 #include "chrome/browser/supervised_user/supervised_user_service_factory.h"
111 #include "chrome/browser/supervised_user/supervised_user_url_filter.h" 106 #include "chrome/browser/supervised_user/supervised_user_url_filter.h"
112 #endif 107 #endif
113 108
114 #if defined(OS_ANDROID) 109 #if defined(OS_ANDROID)
115 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h"
116 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact ory.h"
117 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_switc hes.h"
118 #include "content/public/browser/android/content_protocol_handler.h" 110 #include "content/public/browser/android/content_protocol_handler.h"
119 #endif // defined(OS_ANDROID) 111 #endif // defined(OS_ANDROID)
120 112
121 #if defined(OS_CHROMEOS) 113 #if defined(OS_CHROMEOS)
122 #include "chrome/browser/chromeos/fileapi/external_file_protocol_handler.h" 114 #include "chrome/browser/chromeos/fileapi/external_file_protocol_handler.h"
123 #include "chrome/browser/chromeos/login/startup_utils.h" 115 #include "chrome/browser/chromeos/login/startup_utils.h"
124 #include "chrome/browser/chromeos/net/cert_verify_proc_chromeos.h" 116 #include "chrome/browser/chromeos/net/cert_verify_proc_chromeos.h"
125 #include "chrome/browser/chromeos/net/client_cert_filter_chromeos.h" 117 #include "chrome/browser/chromeos/net/client_cert_filter_chromeos.h"
126 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" 118 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
127 #include "chrome/browser/chromeos/policy/policy_cert_service.h" 119 #include "chrome/browser/chromeos/policy/policy_cert_service.h"
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 877
886 bool ProfileIOData::GetMetricsEnabledStateOnIOThread() const { 878 bool ProfileIOData::GetMetricsEnabledStateOnIOThread() const {
887 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 879 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
888 #if defined(OS_CHROMEOS) 880 #if defined(OS_CHROMEOS)
889 return enable_metrics_; 881 return enable_metrics_;
890 #else 882 #else
891 return enable_metrics_.GetValue(); 883 return enable_metrics_.GetValue();
892 #endif // defined(OS_CHROMEOS) 884 #endif // defined(OS_CHROMEOS)
893 } 885 }
894 886
895 bool ProfileIOData::IsDataReductionProxyEnabled() const { 887 void ProfileIOData::set_data_reduction_proxy_io_data(
896 return false; 888 scoped_ptr<data_reduction_proxy::DataReductionProxyIOData>
889 data_reduction_proxy_io_data) const {
890 data_reduction_proxy_io_data_ = data_reduction_proxy_io_data.Pass();
897 } 891 }
898 892
893
899 base::WeakPtr<net::HttpServerProperties> 894 base::WeakPtr<net::HttpServerProperties>
900 ProfileIOData::http_server_properties() const { 895 ProfileIOData::http_server_properties() const {
901 return http_server_properties_->GetWeakPtr(); 896 return http_server_properties_->GetWeakPtr();
902 } 897 }
903 898
904 void ProfileIOData::set_http_server_properties( 899 void ProfileIOData::set_http_server_properties(
905 scoped_ptr<net::HttpServerProperties> http_server_properties) const { 900 scoped_ptr<net::HttpServerProperties> http_server_properties) const {
906 http_server_properties_ = http_server_properties.Pass(); 901 http_server_properties_ = http_server_properties.Pass();
907 } 902 }
908 903
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
1256 enable_metrics_.Destroy(); 1251 enable_metrics_.Destroy();
1257 #endif 1252 #endif
1258 safe_browsing_enabled_.Destroy(); 1253 safe_browsing_enabled_.Destroy();
1259 printing_enabled_.Destroy(); 1254 printing_enabled_.Destroy();
1260 sync_disabled_.Destroy(); 1255 sync_disabled_.Destroy();
1261 signin_allowed_.Destroy(); 1256 signin_allowed_.Destroy();
1262 network_prediction_options_.Destroy(); 1257 network_prediction_options_.Destroy();
1263 quick_check_enabled_.Destroy(); 1258 quick_check_enabled_.Destroy();
1264 if (media_device_id_salt_.get()) 1259 if (media_device_id_salt_.get())
1265 media_device_id_salt_->ShutdownOnUIThread(); 1260 media_device_id_salt_->ShutdownOnUIThread();
1266 if (data_reduction_proxy_statistics_prefs_.get()) 1261 if (data_reduction_proxy_io_data())
1267 data_reduction_proxy_statistics_prefs_->ShutdownOnUIThread(); 1262 data_reduction_proxy_io_data()->ShutdownStatisicsPrefsOnUIThread();
1268 session_startup_pref_.Destroy(); 1263 session_startup_pref_.Destroy();
1269 #if defined(ENABLE_CONFIGURATION_POLICY) 1264 #if defined(ENABLE_CONFIGURATION_POLICY)
1270 if (url_blacklist_manager_) 1265 if (url_blacklist_manager_)
1271 url_blacklist_manager_->ShutdownOnUIThread(); 1266 url_blacklist_manager_->ShutdownOnUIThread();
1272 #endif 1267 #endif
1273 if (chrome_http_user_agent_settings_) 1268 if (chrome_http_user_agent_settings_)
1274 chrome_http_user_agent_settings_->CleanupOnUIThread(); 1269 chrome_http_user_agent_settings_->CleanupOnUIThread();
1275 incognito_availibility_pref_.Destroy(); 1270 incognito_availibility_pref_.Destroy();
1276 1271
1277 if (!context_getters->empty()) { 1272 if (!context_getters->empty()) {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
1340 void ProfileIOData::SetCookieSettingsForTesting( 1335 void ProfileIOData::SetCookieSettingsForTesting(
1341 CookieSettings* cookie_settings) { 1336 CookieSettings* cookie_settings) {
1342 DCHECK(!cookie_settings_.get()); 1337 DCHECK(!cookie_settings_.get());
1343 cookie_settings_ = cookie_settings; 1338 cookie_settings_ = cookie_settings;
1344 } 1339 }
1345 1340
1346 void ProfileIOData::set_signin_names_for_testing( 1341 void ProfileIOData::set_signin_names_for_testing(
1347 SigninNamesOnIOThread* signin_names) { 1342 SigninNamesOnIOThread* signin_names) {
1348 signin_names_.reset(signin_names); 1343 signin_names_.reset(signin_names);
1349 } 1344 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698