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 fefe4c358aa9c532cf2298361bd57c64e2bbbe33..7e504094eae053988814fe3abe8dd45397486aac 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 |
| @@ -142,23 +142,23 @@ DataReductionProxyIOData::DataReductionProxyIOData( |
| 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_, |
| base::Bind(&DataReductionProxyIOData::StoreSerializedConfig, |
| base::Unretained(this)))); |
| } |
| - |
| - proxy_delegate_.reset( |
| - new DataReductionProxyDelegate(request_options_.get(), config_.get())); |
| + proxy_delegate_.reset(new DataReductionProxyDelegate( |
| + request_options_.get(), config_.get(), configurator_.get(), |
| + event_creator_.get(), bypass_stats_.get(), net_log_)); |
| // 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|. |
| experiments_stats_.reset(new DataReductionProxyExperimentsStats(base::Bind( |
| &DataReductionProxyIOData::SetInt64Pref, base::Unretained(this)))); |
| } |
| DataReductionProxyIOData::DataReductionProxyIOData() |
| : client_(Client::UNKNOWN), |
| net_log_(nullptr), |
| @@ -221,27 +221,37 @@ DataReductionProxyIOData::CreateInterceptor() { |
| } |
| scoped_ptr<DataReductionProxyNetworkDelegate> |
| DataReductionProxyIOData::CreateNetworkDelegate( |
| scoped_ptr<net::NetworkDelegate> wrapped_network_delegate, |
| bool track_proxy_bypass_statistics) { |
| DCHECK(io_task_runner_->BelongsToCurrentThread()); |
| scoped_ptr<DataReductionProxyNetworkDelegate> network_delegate( |
| new DataReductionProxyNetworkDelegate( |
| std::move(wrapped_network_delegate), config_.get(), |
| - request_options_.get(), configurator_.get(), experiments_stats_.get(), |
| - net_log_, event_creator_.get())); |
| + request_options_.get(), configurator_.get(), |
| + experiments_stats_.get())); |
| if (track_proxy_bypass_statistics) |
| network_delegate->InitIODataAndUMA(this, bypass_stats_.get()); |
| return network_delegate; |
| } |
| +scoped_ptr<DataReductionProxyDelegate> |
| +DataReductionProxyIOData::CreateProxyDelegate() { |
| + DCHECK(io_task_runner_->BelongsToCurrentThread()); |
| + scoped_ptr<DataReductionProxyDelegate> proxy_delegate( |
|
bengr
2016/02/08 23:23:29
Can you return make_scoped_ptr(new DRPD...)?
RyanSturm
2016/02/09 00:46:03
Done.
|
| + new DataReductionProxyDelegate(request_options_.get(), config_.get(), |
| + configurator_.get(), event_creator_.get(), |
| + bypass_stats_.get(), net_log_)); |
| + return proxy_delegate; |
| +} |
| + |
| // TODO(kundaji): Rename this method to something more descriptive. |
| // Bug http://crbug/488190. |
| void DataReductionProxyIOData::SetProxyPrefs(bool enabled, bool at_startup) { |
| DCHECK(io_task_runner_->BelongsToCurrentThread()); |
| DCHECK(url_request_context_getter_->GetURLRequestContext()->proxy_service()); |
| enabled_ = enabled; |
| config_->SetProxyConfig(enabled, at_startup); |
| if (config_client_) { |
| config_client_->SetEnabled(enabled); |
| if (enabled) |