Chromium Code Reviews| 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 50a303cf7849faa3f32a8787cafbe931c7e41573..c3794be724dd0e8bda54b071f7558626fe880a6c 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 |
| @@ -166,6 +166,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()) { |
|
mmenke
2015/05/15 15:37:46
In the DRP's unit tests...Are the threads the same
bengr
2015/05/15 19:30:21
They're on the same thread. Agreed that we should
|
| + InitializeOnIOThread(); |
| + return; |
| + } |
| io_task_runner_->PostTask( |
| FROM_HERE, |
| base::Bind(&DataReductionProxyIOData::InitializeOnIOThread, |
| @@ -177,6 +181,10 @@ void DataReductionProxyIOData::InitializeOnIOThread() { |
| config_->InitializeOnIOThread(basic_url_request_context_getter_.get()); |
| if (config_client_.get()) |
| config_client_->InitializeOnIOThread(url_request_context_getter_); |
| + if (ui_task_runner_->BelongsToCurrentThread()) { |
| + service_->SetIOData(weak_factory_.GetWeakPtr()); |
| + return; |
| + } |
| ui_task_runner_->PostTask( |
| FROM_HERE, |
| base::Bind(&DataReductionProxyService::SetIOData, |