diff options
Diffstat (limited to 'components/cronet/android')
3 files changed, 12 insertions, 0 deletions
diff --git a/components/cronet/android/cronet_data_reduction_proxy.cc b/components/cronet/android/cronet_data_reduction_proxy.cc index 360862fb..76321be 100644 --- a/components/cronet/android/cronet_data_reduction_proxy.cc +++ b/components/cronet/android/cronet_data_reduction_proxy.cc @@ -11,6 +11,7 @@ #include "base/single_thread_task_runner.h" #include "components/cronet/android/cronet_in_memory_pref_store.h" #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.h" +#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate.h" #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h" #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.h" #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_prefs.h" @@ -106,6 +107,10 @@ CronetDataReductionProxy::CreateNetworkDelegate( false /* No bypass UMA */); } +scoped_ptr<net::ProxyDelegate> CronetDataReductionProxy::CreateProxyDelegate() { + return io_data_->CreateProxyDelegate(); +} + scoped_ptr<net::URLRequestInterceptor> CronetDataReductionProxy::CreateInterceptor() { return io_data_->CreateInterceptor(); diff --git a/components/cronet/android/cronet_data_reduction_proxy.h b/components/cronet/android/cronet_data_reduction_proxy.h index ff4fa5f..c67ed78 100644 --- a/components/cronet/android/cronet_data_reduction_proxy.h +++ b/components/cronet/android/cronet_data_reduction_proxy.h @@ -25,6 +25,7 @@ class DataReductionProxySettings; namespace net { class NetLog; class NetworkDelegate; +class ProxyDelegate; class URLRequestContext; class URLRequestContextGetter; class URLRequestInterceptor; @@ -57,6 +58,10 @@ class CronetDataReductionProxy { scoped_ptr<net::NetworkDelegate> CreateNetworkDelegate( scoped_ptr<net::NetworkDelegate> wrapped_network_delegate); + // Constructs a proxy delegate suitable for adding Data Reduction Proxy + // proxy resolution. + scoped_ptr<net::ProxyDelegate> CreateProxyDelegate(); + // Constructs a URLRequestInterceptor suitable for carrying out the Data // Reduction Proxy's bypass protocol. scoped_ptr<net::URLRequestInterceptor> CreateInterceptor(); diff --git a/components/cronet/android/cronet_url_request_context_adapter.cc b/components/cronet/android/cronet_url_request_context_adapter.cc index 776fec7..e42ed20 100644 --- a/components/cronet/android/cronet_url_request_context_adapter.cc +++ b/components/cronet/android/cronet_url_request_context_adapter.cc @@ -418,6 +418,8 @@ void CronetURLRequestContextAdapter::InitializeOnNetworkThread( GetNetworkTaskRunner(), net_log_.get())); network_delegate = data_reduction_proxy_->CreateNetworkDelegate( std::move(network_delegate)); + context_builder.set_proxy_delegate( + data_reduction_proxy_->CreateProxyDelegate()); std::vector<scoped_ptr<net::URLRequestInterceptor>> interceptors; interceptors.push_back(data_reduction_proxy_->CreateInterceptor()); context_builder.SetInterceptors(std::move(interceptors)); |