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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc

Issue 937513003: Add Data Saver support to Cronet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added test Created 5 years, 9 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
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc
index bb7ab76752ea742954fdee844800ce89c489f917..6337f9b51e40115cf404931d0aeec6cb8af492e7 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc
@@ -84,10 +84,16 @@ void DataReductionProxyConfig::SetProxyPrefs(bool enabled,
bool alternative_enabled,
bool at_startup) {
DCHECK(thread_checker_.CalledOnValidThread());
+
+ if (io_task_runner_->BelongsToCurrentThread()) {
+ SetProxyConfigOnIOThread(enabled, alternative_enabled, at_startup);
+ return;
+ }
mmenke 2015/04/01 16:48:53 Why do we need to do this stuff synchronously, her
bengr 2015/04/24 02:30:43 Done.
io_task_runner_->PostTask(
- FROM_HERE, base::Bind(&DataReductionProxyConfig::SetProxyConfigOnIOThread,
- base::Unretained(this), enabled,
- alternative_enabled, at_startup));
+ FROM_HERE, base::Bind(
+ &DataReductionProxyConfig::SetProxyConfigOnIOThread,
+ base::Unretained(this), enabled,
+ alternative_enabled, at_startup));
}
bool DataReductionProxyConfig::WasDataReductionProxyUsed(

Powered by Google App Engine
This is Rietveld 408576698