Index: android_webview/browser/net/aw_url_request_context_getter.cc |
diff --git a/android_webview/browser/net/aw_url_request_context_getter.cc b/android_webview/browser/net/aw_url_request_context_getter.cc |
index 94da7366edbc5b2078a6871a7ee754b18dd5d6c0..c0331f7f194b8d47d0c858a4bda5311665a62471 100644 |
--- a/android_webview/browser/net/aw_url_request_context_getter.cc |
+++ b/android_webview/browser/net/aw_url_request_context_getter.cc |
@@ -17,6 +17,7 @@ |
#include "base/strings/string_number_conversions.h" |
#include "base/threading/sequenced_worker_pool.h" |
#include "base/threading/worker_pool.h" |
+#include "components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.h" |
#include "components/data_reduction_proxy/browser/data_reduction_proxy_config_service.h" |
#include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.h" |
#include "content/public/browser/browser_thread.h" |
@@ -167,14 +168,12 @@ scoped_ptr<net::URLRequestJobFactory> CreateJobFactory( |
} // namespace |
AwURLRequestContextGetter::AwURLRequestContextGetter( |
- const base::FilePath& partition_path, net::CookieStore* cookie_store) |
+ const base::FilePath& partition_path, net::CookieStore* cookie_store, |
+ scoped_ptr<data_reduction_proxy::DataReductionProxyConfigService> |
+ config_service) |
: partition_path_(partition_path), |
- cookie_store_(cookie_store), |
- proxy_config_service_(new DataReductionProxyConfigService( |
- scoped_ptr<net::ProxyConfigService>( |
- net::ProxyService::CreateSystemProxyConfigService( |
- GetNetworkTaskRunner(), |
- NULL /* Ignored on Android */)).Pass())) { |
+ cookie_store_(cookie_store) { |
+ data_reduction_proxy_config_service_ = config_service.Pass(); |
// CreateSystemProxyConfigService for Android must be called on main thread. |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
} |
@@ -193,7 +192,10 @@ void AwURLRequestContextGetter::InitializeURLRequestContext() { |
#if !defined(DISABLE_FTP_SUPPORT) |
builder.set_ftp_enabled(false); // Android WebView does not support ftp yet. |
#endif |
- builder.set_proxy_config_service(proxy_config_service_.release()); |
+#if defined(SPDY_PROXY_AUTH_ORIGIN) |
+ builder.set_proxy_config_service( |
+ data_reduction_proxy_config_service_.release()); |
+#endif |
builder.set_accept_language(net::HttpUtil::GenerateAcceptLanguageHeader( |
AwContentBrowserClient::GetAcceptLangsImpl())); |
ApplyCmdlineOverridesToURLRequestContextBuilder(&builder); |
@@ -222,13 +224,18 @@ void AwURLRequestContextGetter::InitializeURLRequestContext() { |
#if defined(SPDY_PROXY_AUTH_ORIGIN) |
AwBrowserContext* browser_context = AwBrowserContext::GetDefault(); |
DCHECK(browser_context); |
- DataReductionProxySettings* drp_settings = |
+ DataReductionProxySettings* data_reduction_proxy_settings = |
browser_context->GetDataReductionProxySettings(); |
- if (drp_settings) { |
+ if (data_reduction_proxy_settings) { |
sgurun-gerrit only
2014/08/05 01:26:35
is it an error if data_reduction_proxy_settings do
bengr
2014/08/05 02:35:07
You are right. Done.
|
+ data_reduction_proxy_auth_request_handler_.reset( |
+ new data_reduction_proxy::DataReductionProxyAuthRequestHandler( |
+ data_reduction_proxy_settings->params(), |
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); |
+ |
aw_network_delegate->set_data_reduction_proxy_params( |
- drp_settings->params()); |
+ data_reduction_proxy_settings->params()); |
aw_network_delegate->set_data_reduction_proxy_auth_request_handler( |
- browser_context->GetDataReductionProxyAuthRequestHandler()); |
+ data_reduction_proxy_auth_request_handler_.get()); |
} |
#endif |
@@ -261,10 +268,9 @@ void AwURLRequestContextGetter::SetHandlersAndInterceptors( |
request_interceptors_.swap(request_interceptors); |
} |
-DataReductionProxyConfigService* |
-AwURLRequestContextGetter::proxy_config_service() { |
- // TODO(bengr): return system config if data reduction proxy is disabled. |
- return proxy_config_service_.get(); |
+data_reduction_proxy::DataReductionProxyAuthRequestHandler* |
+AwURLRequestContextGetter::GetDataReductionProxyAuthRequestHandler() const { |
+ return data_reduction_proxy_auth_request_handler_.get(); |
} |
} // namespace android_webview |