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

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

Issue 734263003: Move data reduction proxy logic out of chrome and android webview network delegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
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 1c74bd042000c70c070b1f2e3e60299affa8b5e0..05294ac855adb2cafa37b93dba38983eaabd9132 100644
--- a/android_webview/browser/net/aw_url_request_context_getter.cc
+++ b/android_webview/browser/net/aw_url_request_context_getter.cc
@@ -20,6 +20,7 @@
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_auth_request_handler.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_config_service.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_interceptor.h"
+#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/content_browser_client.h"
@@ -195,8 +196,12 @@ void AwURLRequestContextGetter::InitializeURLRequestContext() {
net::URLRequestContextBuilder builder;
builder.set_user_agent(GetUserAgent());
- AwNetworkDelegate* aw_network_delegate = new AwNetworkDelegate();
- builder.set_network_delegate(aw_network_delegate);
+ scoped_ptr<AwNetworkDelegate> aw_network_delegate(new AwNetworkDelegate());
+ data_reduction_proxy::DataReductionProxyNetworkDelegate*
+ data_reduction_proxy_network_delegate =
+ new data_reduction_proxy::DataReductionProxyNetworkDelegate(
+ aw_network_delegate.Pass());
+ builder.set_network_delegate(data_reduction_proxy_network_delegate);
#if !defined(DISABLE_FTP_SUPPORT)
builder.set_ftp_enabled(false); // Android WebView does not support ftp yet.
#endif
@@ -244,10 +249,11 @@ void AwURLRequestContextGetter::InitializeURLRequestContext() {
// Compression statistics are not gathered for WebView, so
// DataReductionProxyStatisticsPrefs is not instantiated and passed to the
// network delegate.
- aw_network_delegate->set_data_reduction_proxy_params(
+ data_reduction_proxy_network_delegate->set_data_reduction_proxy_params(
data_reduction_proxy_settings->params());
bengr 2014/11/18 19:30:55 Make this part of the DRPNetworkDelegate construc
megjablon 2014/11/19 19:23:40 Done.
- aw_network_delegate->set_data_reduction_proxy_auth_request_handler(
- data_reduction_proxy_auth_request_handler_.get());
+ data_reduction_proxy_network_delegate->
+ set_data_reduction_proxy_auth_request_handler(
+ data_reduction_proxy_auth_request_handler_.get());
main_http_factory_.reset(main_cache);
url_request_context_->set_http_transaction_factory(main_cache);

Powered by Google App Engine
This is Rietveld 408576698