Chromium Code Reviews| Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc |
| diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc |
| index 9ef087b0ced722e1a3e74496f1086a6f95932406..25c856b786b95c98f4ddb11fa749872da7afa82e 100644 |
| --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc |
| +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc |
| @@ -11,6 +11,8 @@ |
| #include "base/strings/string_number_conversions.h" |
| #include "base/time/time.h" |
| #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_auth_request_handler.h" |
| +#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_protocol.h" |
|
sclittle
2015/01/14 22:54:47
Why do you need this include?
bengr
2015/01/15 00:30:32
Done.
|
| +#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_configurator.h" |
| #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_statistics_prefs.h" |
| #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_usage_stats.h" |
| #include "net/base/load_flags.h" |
| @@ -74,7 +76,7 @@ DataReductionProxyNetworkDelegate::DataReductionProxyNetworkDelegate( |
| scoped_ptr<net::NetworkDelegate> network_delegate, |
| DataReductionProxyParams* params, |
| DataReductionProxyAuthRequestHandler* handler, |
| - const ProxyConfigGetter& getter) |
| + const DataReductionProxyConfigurator* configurator) |
| : LayeredNetworkDelegate(network_delegate.Pass()), |
| ui_task_runner_(NULL), |
| received_content_length_(0), |
| @@ -84,7 +86,7 @@ DataReductionProxyNetworkDelegate::DataReductionProxyNetworkDelegate( |
| data_reduction_proxy_usage_stats_(NULL), |
| data_reduction_proxy_auth_request_handler_(handler), |
| data_reduction_proxy_statistics_prefs_(NULL), |
| - proxy_config_getter_(getter) { |
| + configurator_(configurator) { |
| DCHECK(data_reduction_proxy_params_); |
| DCHECK(data_reduction_proxy_auth_request_handler_); |
| } |
| @@ -92,12 +94,6 @@ DataReductionProxyNetworkDelegate::DataReductionProxyNetworkDelegate( |
| DataReductionProxyNetworkDelegate::~DataReductionProxyNetworkDelegate() { |
| } |
| -void DataReductionProxyNetworkDelegate::InitProxyConfigOverrider( |
| - const OnResolveProxyHandler& proxy_handler) { |
| - DCHECK(!proxy_config_getter_.is_null()); |
| - on_resolve_proxy_handler_ = proxy_handler; |
| -} |
| - |
| void DataReductionProxyNetworkDelegate::InitStatisticsPrefsAndUMA( |
| scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
| DataReductionProxyStatisticsPrefs* statistics_prefs, |
| @@ -147,12 +143,9 @@ void DataReductionProxyNetworkDelegate::OnResolveProxyInternal( |
| int load_flags, |
| const net::ProxyService& proxy_service, |
| net::ProxyInfo* result) { |
| - // TODO(sclittle): Call OnResolveProxyHandler directly, see |
| - // http://crbug.com/447346. |
| - if (!on_resolve_proxy_handler_.is_null() && |
| - !proxy_config_getter_.is_null()) { |
| - on_resolve_proxy_handler_.Run( |
| - url, load_flags, proxy_config_getter_.Run(), |
| + if (configurator_) { |
| + OnResolveProxyHandler( |
| + url, load_flags, configurator_->GetProxyConfigOnIOThread(), |
| proxy_service.proxy_retry_info(), data_reduction_proxy_params_, result); |
| } |
| } |
| @@ -221,11 +214,11 @@ void DataReductionProxyNetworkDelegate::OnCompletedInternal( |
| if (data_reduction_proxy_enabled_ && |
| data_reduction_proxy_usage_stats_ && |
| - !proxy_config_getter_.is_null()) { |
| + configurator_) { |
| data_reduction_proxy_usage_stats_->RecordBytesHistograms( |
| *request, |
| *data_reduction_proxy_enabled_, |
| - proxy_config_getter_.Run()); |
| + configurator_->GetProxyConfigOnIOThread()); |
| } |
| DVLOG(2) << __FUNCTION__ |
| << " received content length: " << received_content_length |