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

Unified Diff: chrome/browser/profiles/profile_impl_io_data.cc

Issue 643443002: Move data_reduction_proxy_enabled pref to profile_impl_io_data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed mmenke's comments. Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/profiles/profile_impl_io_data.h ('k') | chrome/browser/profiles/profile_io_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_impl_io_data.cc
diff --git a/chrome/browser/profiles/profile_impl_io_data.cc b/chrome/browser/profiles/profile_impl_io_data.cc
index e12166230d1e5c6c4e600bbe65beb09b21156ada..9168683e79cdd89dc878a7db4c880721c54d15b2 100644
--- a/chrome/browser/profiles/profile_impl_io_data.cc
+++ b/chrome/browser/profiles/profile_impl_io_data.cc
@@ -114,6 +114,7 @@ ProfileImplIOData::Handle::~Handle() {
if (io_data_->http_server_properties_manager_)
io_data_->http_server_properties_manager_->ShutdownOnPrefThread();
+ io_data_->data_reduction_proxy_enabled()->Destroy();
io_data_->ShutdownOnUIThread(GetAllContextGetters().Pass());
}
@@ -333,6 +334,7 @@ void ProfileImplIOData::Handle::ClearNetworkingHistorySince(
}
void ProfileImplIOData::Handle::LazyInitialize() const {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (initialized_)
return;
@@ -438,6 +440,8 @@ void ProfileImplIOData::InitializeInternal(
data_reduction_proxy_usage_stats()->set_unavailable_callback(
data_reduction_proxy_unavailable_callback());
+ network_delegate()->set_data_reduction_proxy_enabled_pref(
+ &data_reduction_proxy_enabled_);
network_delegate()->set_data_reduction_proxy_params(
data_reduction_proxy_params());
network_delegate()->set_data_reduction_proxy_usage_stats(
@@ -830,3 +834,9 @@ void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread(
DCHECK(http_server_properties_manager_);
http_server_properties_manager_->Clear(completion);
}
+
+bool ProfileImplIOData::IsDataReductionProxyEnabled() const {
+ return data_reduction_proxy_enabled_.GetValue() ||
+ CommandLine::ForCurrentProcess()->HasSwitch(
+ data_reduction_proxy::switches::kEnableDataReductionProxy);
+}
« no previous file with comments | « chrome/browser/profiles/profile_impl_io_data.h ('k') | chrome/browser/profiles/profile_io_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698