Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1379)

Unified Diff: android_webview/browser/net/aw_url_request_context_getter.cc

Issue 286013002: Added alternative configuration for the data reduction proxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DCHECK fix Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « android_webview/browser/aw_browser_context.cc ('k') | android_webview/native/aw_contents_statics.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 218f09a9c156e89ba5ada3241cba824d0274fa01..9ed9e7ee6d08d3e0879f57a5927bb8a4f76d3542 100644
--- a/android_webview/browser/net/aw_url_request_context_getter.cc
+++ b/android_webview/browser/net/aw_url_request_context_getter.cc
@@ -200,11 +200,14 @@ void AwURLRequestContextGetter::InitializeURLRequestContext() {
AwContentBrowserClient::GetAcceptLangsImpl()));
ApplyCmdlineOverridesToURLRequestContextBuilder(&builder);
-
+#if defined(SPDY_PROXY_AUTH_ORIGIN)
+ data_reduction_proxy::DataReductionProxyParams drp_params(
+ data_reduction_proxy::DataReductionProxyParams::kAllowed);
builder.add_http_auth_handler_factory(
data_reduction_proxy::HttpAuthHandlerDataReductionProxy::Scheme(),
new data_reduction_proxy::HttpAuthHandlerDataReductionProxy::Factory(
- DataReductionProxySettings::GetDataReductionProxies()));
+ drp_params.GetAllowedProxies()));
+#endif
url_request_context_.reset(builder.Build());
// TODO(mnaganov): Fix URLRequestContextBuilder to use proper threads.
@@ -222,18 +225,21 @@ void AwURLRequestContextGetter::InitializeURLRequestContext() {
20 * 1024 * 1024, // 20M
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)));
+#if defined(SPDY_PROXY_AUTH_ORIGIN)
AwBrowserContext* browser_context = AwBrowserContext::GetDefault();
DCHECK(browser_context);
DataReductionProxySettings* drp_settings =
browser_context->GetDataReductionProxySettings();
- DCHECK(drp_settings);
- std::string drp_key = drp_settings->key();
- // Only precache credentials if a key is available at URLRequestContext
- // initialization.
- if (!drp_key.empty()) {
- DataReductionProxySettings::InitDataReductionProxySession(
- main_cache->GetSession(), drp_settings->key());
+ if (drp_settings) {
+ std::string drp_key = drp_settings->params()->key();
+ // Only precache credentials if a key is available at URLRequestContext
+ // initialization.
+ if (!drp_key.empty()) {
+ DataReductionProxySettings::InitDataReductionProxySession(
+ main_cache->GetSession(), &drp_params);
+ }
}
+#endif
main_http_factory_.reset(main_cache);
url_request_context_->set_http_transaction_factory(main_cache);
« no previous file with comments | « android_webview/browser/aw_browser_context.cc ('k') | android_webview/native/aw_contents_statics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698