| 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 e72f64bfe77d23f5c42592df1e10fda3357b3abe..b7207c2a7b6d006d2971ea321403da2a9a79b614 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
|
| @@ -138,21 +138,21 @@ DataReductionProxyIOData::DataReductionProxyIOData(
|
| base::Unretained(this))));
|
| request_options_.reset(
|
| new DataReductionProxyRequestOptions(client_, config_.get()));
|
| request_options_->Init();
|
| if (use_config_client) {
|
| // It is safe to use base::Unretained here, since it gets executed
|
| // synchronously on the IO thread, and |this| outlives the caller (since the
|
| // caller is owned by |this|.
|
| config_client_.reset(new DataReductionProxyConfigServiceClient(
|
| std::move(params), GetBackoffPolicy(), request_options_.get(),
|
| - raw_mutable_config, config_.get(), event_creator_.get(), net_log_,
|
| + raw_mutable_config, config_.get(), event_creator_.get(), this, net_log_,
|
| base::Bind(&DataReductionProxyIOData::StoreSerializedConfig,
|
| base::Unretained(this))));
|
| }
|
|
|
| proxy_delegate_.reset(new DataReductionProxyDelegate(
|
| config_.get(), configurator_.get(), event_creator_.get(),
|
| bypass_stats_.get(), net_log_));
|
| }
|
|
|
| DataReductionProxyIOData::DataReductionProxyIOData()
|
| @@ -200,20 +200,29 @@ void DataReductionProxyIOData::InitializeOnIOThread() {
|
| FROM_HERE,
|
| base::Bind(&DataReductionProxyService::SetIOData,
|
| service_, weak_factory_.GetWeakPtr()));
|
| }
|
|
|
| bool DataReductionProxyIOData::IsEnabled() const {
|
| DCHECK(io_task_runner_->BelongsToCurrentThread());
|
| return enabled_;
|
| }
|
|
|
| +void DataReductionProxyIOData::SetPingbackReportingFraction(
|
| + float pingback_reporting_fraction) {
|
| + DCHECK(io_task_runner_->BelongsToCurrentThread());
|
| + ui_task_runner_->PostTask(
|
| + FROM_HERE,
|
| + base::Bind(&DataReductionProxyService::SetPingbackReportingFraction,
|
| + service_, pingback_reporting_fraction));
|
| +}
|
| +
|
| std::unique_ptr<net::URLRequestInterceptor>
|
| DataReductionProxyIOData::CreateInterceptor() {
|
| DCHECK(io_task_runner_->BelongsToCurrentThread());
|
| return base::WrapUnique(new DataReductionProxyInterceptor(
|
| config_.get(), config_client_.get(), bypass_stats_.get(),
|
| event_creator_.get()));
|
| }
|
|
|
| std::unique_ptr<DataReductionProxyNetworkDelegate>
|
| DataReductionProxyIOData::CreateNetworkDelegate(
|
|
|