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

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

Issue 1143503005: Fix Data Saver test in Cronet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 7 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_io_data.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.cc
index 9c12d242776a69e912dc3d6cb85e1b495dfb4cdc..29b3408b455c8d55e2bbc99b0d8539e494e31832 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.cc
@@ -172,6 +172,10 @@ void DataReductionProxyIOData::SetDataReductionProxyService(
// Using base::Unretained is safe here, unless the browser is being shut down
// before the Initialize task can be executed. The task is only created as
// part of class initialization.
+ if (io_task_runner_->BelongsToCurrentThread()) {
+ InitializeOnIOThread();
+ return;
+ }
io_task_runner_->PostTask(
FROM_HERE,
base::Bind(&DataReductionProxyIOData::InitializeOnIOThread,
@@ -184,6 +188,10 @@ void DataReductionProxyIOData::InitializeOnIOThread() {
if (config_client_.get())
config_client_->InitializeOnIOThread(url_request_context_getter_);
experiments_stats_->InitializeOnIOThread();
+ if (ui_task_runner_->BelongsToCurrentThread()) {
+ service_->SetIOData(weak_factory_.GetWeakPtr());
+ return;
+ }
ui_task_runner_->PostTask(
FROM_HERE,
base::Bind(&DataReductionProxyService::SetIOData,

Powered by Google App Engine
This is Rietveld 408576698