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

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

Issue 382313003: Add data reduction functionality to all platforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove incorrect DCHECK from drp_statistics_prefs.cc Created 6 years, 3 months 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 24 matching lines...) Expand all
35 #include "chrome/browser/media/media_device_id_salt.h" 35 #include "chrome/browser/media/media_device_id_salt.h"
36 #include "chrome/browser/net/about_protocol_handler.h" 36 #include "chrome/browser/net/about_protocol_handler.h"
37 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h" 37 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h"
38 #include "chrome/browser/net/chrome_http_user_agent_settings.h" 38 #include "chrome/browser/net/chrome_http_user_agent_settings.h"
39 #include "chrome/browser/net/chrome_net_log.h" 39 #include "chrome/browser/net/chrome_net_log.h"
40 #include "chrome/browser/net/chrome_network_delegate.h" 40 #include "chrome/browser/net/chrome_network_delegate.h"
41 #include "chrome/browser/net/chrome_url_request_context_getter.h" 41 #include "chrome/browser/net/chrome_url_request_context_getter.h"
42 #include "chrome/browser/net/cookie_store_util.h" 42 #include "chrome/browser/net/cookie_store_util.h"
43 #include "chrome/browser/net/proxy_service_factory.h" 43 #include "chrome/browser/net/proxy_service_factory.h"
44 #include "chrome/browser/net/resource_prefetch_predictor_observer.h" 44 #include "chrome/browser/net/resource_prefetch_predictor_observer.h"
45 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator. h"
45 #include "chrome/browser/predictors/resource_prefetch_predictor.h" 46 #include "chrome/browser/predictors/resource_prefetch_predictor.h"
46 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h" 47 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h"
47 #include "chrome/browser/profiles/profile.h" 48 #include "chrome/browser/profiles/profile.h"
48 #include "chrome/browser/profiles/profile_manager.h" 49 #include "chrome/browser/profiles/profile_manager.h"
49 #include "chrome/browser/signin/signin_names_io_thread.h" 50 #include "chrome/browser/signin/signin_names_io_thread.h"
50 #include "chrome/common/chrome_paths.h" 51 #include "chrome/common/chrome_paths.h"
51 #include "chrome/common/chrome_switches.h" 52 #include "chrome/common/chrome_switches.h"
52 #include "chrome/common/pref_names.h" 53 #include "chrome/common/pref_names.h"
53 #include "chrome/common/url_constants.h" 54 #include "chrome/common/url_constants.h"
54 #include "components/content_settings/core/browser/content_settings_provider.h" 55 #include "components/content_settings/core/browser/content_settings_provider.h"
56 #include "components/data_reduction_proxy/browser/data_reduction_proxy_config_se rvice.h"
57 #include "components/data_reduction_proxy/browser/data_reduction_proxy_configura tor.h"
58 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings. h"
59 #include "components/data_reduction_proxy/common/data_reduction_proxy_switches.h "
55 #include "components/dom_distiller/core/url_constants.h" 60 #include "components/dom_distiller/core/url_constants.h"
56 #include "components/startup_metric_utils/startup_metric_utils.h" 61 #include "components/startup_metric_utils/startup_metric_utils.h"
57 #include "components/sync_driver/pref_names.h" 62 #include "components/sync_driver/pref_names.h"
58 #include "components/url_fixer/url_fixer.h" 63 #include "components/url_fixer/url_fixer.h"
59 #include "content/public/browser/browser_thread.h" 64 #include "content/public/browser/browser_thread.h"
60 #include "content/public/browser/host_zoom_map.h" 65 #include "content/public/browser/host_zoom_map.h"
61 #include "content/public/browser/notification_service.h" 66 #include "content/public/browser/notification_service.h"
62 #include "content/public/browser/resource_context.h" 67 #include "content/public/browser/resource_context.h"
63 #include "net/base/keygen_handler.h" 68 #include "net/base/keygen_handler.h"
64 #include "net/cookies/canonical_cookie.h" 69 #include "net/cookies/canonical_cookie.h"
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 856
852 bool ProfileIOData::GetMetricsEnabledStateOnIOThread() const { 857 bool ProfileIOData::GetMetricsEnabledStateOnIOThread() const {
853 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 858 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
854 #if defined(OS_CHROMEOS) 859 #if defined(OS_CHROMEOS)
855 return enable_metrics_; 860 return enable_metrics_;
856 #else 861 #else
857 return enable_metrics_.GetValue(); 862 return enable_metrics_.GetValue();
858 #endif // defined(OS_CHROMEOS) 863 #endif // defined(OS_CHROMEOS)
859 } 864 }
860 865
861 #if defined(OS_ANDROID)
862 bool ProfileIOData::IsDataReductionProxyEnabled() const { 866 bool ProfileIOData::IsDataReductionProxyEnabled() const {
863 #if defined(SPDY_PROXY_AUTH_ORIGIN)
864 return data_reduction_proxy_enabled_.GetValue() || 867 return data_reduction_proxy_enabled_.GetValue() ||
865 CommandLine::ForCurrentProcess()->HasSwitch( 868 CommandLine::ForCurrentProcess()->HasSwitch(
866 data_reduction_proxy::switches::kEnableDataReductionProxy); 869 data_reduction_proxy::switches::kEnableDataReductionProxy);
867 #else
868 return false;
869 #endif // defined(SPDY_PROXY_AUTH_ORIGIN)
870 } 870 }
871 #endif
872 871
873 base::WeakPtr<net::HttpServerProperties> 872 base::WeakPtr<net::HttpServerProperties>
874 ProfileIOData::http_server_properties() const { 873 ProfileIOData::http_server_properties() const {
875 return http_server_properties_->GetWeakPtr(); 874 return http_server_properties_->GetWeakPtr();
876 } 875 }
877 876
878 void ProfileIOData::set_http_server_properties( 877 void ProfileIOData::set_http_server_properties(
879 scoped_ptr<net::HttpServerProperties> http_server_properties) const { 878 scoped_ptr<net::HttpServerProperties> http_server_properties) const {
880 http_server_properties_ = http_server_properties.Pass(); 879 http_server_properties_ = http_server_properties.Pass();
881 } 880 }
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
1017 profile_params_->extension_info_map.get()); 1016 profile_params_->extension_info_map.get());
1018 #endif 1017 #endif
1019 #if defined(ENABLE_CONFIGURATION_POLICY) 1018 #if defined(ENABLE_CONFIGURATION_POLICY)
1020 network_delegate->set_url_blacklist_manager(url_blacklist_manager_.get()); 1019 network_delegate->set_url_blacklist_manager(url_blacklist_manager_.get());
1021 #endif 1020 #endif
1022 network_delegate->set_profile(profile_params_->profile); 1021 network_delegate->set_profile(profile_params_->profile);
1023 network_delegate->set_profile_path(profile_params_->path); 1022 network_delegate->set_profile_path(profile_params_->path);
1024 network_delegate->set_cookie_settings(profile_params_->cookie_settings.get()); 1023 network_delegate->set_cookie_settings(profile_params_->cookie_settings.get());
1025 network_delegate->set_enable_do_not_track(&enable_do_not_track_); 1024 network_delegate->set_enable_do_not_track(&enable_do_not_track_);
1026 network_delegate->set_force_google_safe_search(&force_safesearch_); 1025 network_delegate->set_force_google_safe_search(&force_safesearch_);
1027 #if defined(SPDY_PROXY_AUTH_ORIGIN)
1028 network_delegate->set_data_reduction_proxy_enabled_pref( 1026 network_delegate->set_data_reduction_proxy_enabled_pref(
1029 &data_reduction_proxy_enabled_); 1027 &data_reduction_proxy_enabled_);
1030 #endif
1031 network_delegate->set_prerender_tracker(profile_params_->prerender_tracker); 1028 network_delegate->set_prerender_tracker(profile_params_->prerender_tracker);
1032 network_delegate_.reset(network_delegate); 1029 network_delegate_.reset(network_delegate);
1033 1030
1034 fraudulent_certificate_reporter_.reset( 1031 fraudulent_certificate_reporter_.reset(
1035 new chrome_browser_net::ChromeFraudulentCertificateReporter( 1032 new chrome_browser_net::ChromeFraudulentCertificateReporter(
1036 main_request_context_.get())); 1033 main_request_context_.get()));
1037 1034
1038 // NOTE: Proxy service uses the default io thread network delegate, not the 1035 // NOTE: Proxy service uses the default io thread network delegate, not the
1039 // delegate just created. 1036 // delegate just created.
1040 proxy_service_.reset( 1037 proxy_service_.reset(
1041 ProxyServiceFactory::CreateProxyService( 1038 ProxyServiceFactory::CreateProxyService(
1042 io_thread->net_log(), 1039 io_thread->net_log(),
1043 io_thread_globals->proxy_script_fetcher_context.get(), 1040 io_thread_globals->proxy_script_fetcher_context.get(),
1044 io_thread_globals->system_network_delegate.get(), 1041 io_thread_globals->system_network_delegate.get(),
1045 profile_params_->proxy_config_service.release(), 1042 profile_params_->proxy_config_service.release(),
1046 command_line, 1043 command_line,
1047 quick_check_enabled_.GetValue())); 1044 quick_check_enabled_.GetValue()));
1048
1049 transport_security_state_.reset(new net::TransportSecurityState()); 1045 transport_security_state_.reset(new net::TransportSecurityState());
1050 transport_security_persister_.reset( 1046 transport_security_persister_.reset(
1051 new net::TransportSecurityPersister( 1047 new net::TransportSecurityPersister(
1052 transport_security_state_.get(), 1048 transport_security_state_.get(),
1053 profile_params_->path, 1049 profile_params_->path,
1054 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), 1050 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE),
1055 IsOffTheRecord())); 1051 IsOffTheRecord()));
1056 1052
1057 // Take ownership over these parameters. 1053 // Take ownership over these parameters.
1058 cookie_settings_ = profile_params_->cookie_settings; 1054 cookie_settings_ = profile_params_->cookie_settings;
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
1199 google_services_username_pattern_.Destroy(); 1195 google_services_username_pattern_.Destroy();
1200 reverse_autologin_enabled_.Destroy(); 1196 reverse_autologin_enabled_.Destroy();
1201 one_click_signin_rejected_email_list_.Destroy(); 1197 one_click_signin_rejected_email_list_.Destroy();
1202 enable_referrers_.Destroy(); 1198 enable_referrers_.Destroy();
1203 enable_do_not_track_.Destroy(); 1199 enable_do_not_track_.Destroy();
1204 force_safesearch_.Destroy(); 1200 force_safesearch_.Destroy();
1205 #if !defined(OS_CHROMEOS) 1201 #if !defined(OS_CHROMEOS)
1206 enable_metrics_.Destroy(); 1202 enable_metrics_.Destroy();
1207 #endif 1203 #endif
1208 safe_browsing_enabled_.Destroy(); 1204 safe_browsing_enabled_.Destroy();
1209 #if defined(SPDY_PROXY_AUTH_ORIGIN)
1210 data_reduction_proxy_enabled_.Destroy(); 1205 data_reduction_proxy_enabled_.Destroy();
1211 #endif
1212 printing_enabled_.Destroy(); 1206 printing_enabled_.Destroy();
1213 sync_disabled_.Destroy(); 1207 sync_disabled_.Destroy();
1214 signin_allowed_.Destroy(); 1208 signin_allowed_.Destroy();
1215 network_prediction_options_.Destroy(); 1209 network_prediction_options_.Destroy();
1216 quick_check_enabled_.Destroy(); 1210 quick_check_enabled_.Destroy();
1217 if (media_device_id_salt_.get()) 1211 if (media_device_id_salt_.get())
1218 media_device_id_salt_->ShutdownOnUIThread(); 1212 media_device_id_salt_->ShutdownOnUIThread();
1219 session_startup_pref_.Destroy(); 1213 session_startup_pref_.Destroy();
1220 #if defined(ENABLE_CONFIGURATION_POLICY) 1214 #if defined(ENABLE_CONFIGURATION_POLICY)
1221 if (url_blacklist_manager_) 1215 if (url_blacklist_manager_)
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
1291 void ProfileIOData::SetCookieSettingsForTesting( 1285 void ProfileIOData::SetCookieSettingsForTesting(
1292 CookieSettings* cookie_settings) { 1286 CookieSettings* cookie_settings) {
1293 DCHECK(!cookie_settings_.get()); 1287 DCHECK(!cookie_settings_.get());
1294 cookie_settings_ = cookie_settings; 1288 cookie_settings_ = cookie_settings;
1295 } 1289 }
1296 1290
1297 void ProfileIOData::set_signin_names_for_testing( 1291 void ProfileIOData::set_signin_names_for_testing(
1298 SigninNamesOnIOThread* signin_names) { 1292 SigninNamesOnIOThread* signin_names) {
1299 signin_names_.reset(signin_names); 1293 signin_names_.reset(signin_names);
1300 } 1294 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_io_data.h ('k') | components/data_reduction_proxy/browser/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698