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

Unified Diff: android_webview/browser/aw_browser_context.cc

Issue 742023003: Enable using system proxy resolver for android webview. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address mnaganov's nit 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/aw_browser_context.cc
diff --git a/android_webview/browser/aw_browser_context.cc b/android_webview/browser/aw_browser_context.cc
index 32148fccc0a3342bbd19f011a0f703f061094dd1..a328489fb6ea9d26d4bd803a3f7ad0699c690789 100644
--- a/android_webview/browser/aw_browser_context.cc
+++ b/android_webview/browser/aw_browser_context.cc
@@ -28,6 +28,7 @@
#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_contents.h"
#include "net/cookies/cookie_store.h"
+#include "net/proxy/proxy_config_service_android.h"
#include "net/proxy/proxy_service.h"
using base::FilePath;
@@ -45,6 +46,16 @@ void HandleReadError(PersistentPrefStore::PrefReadError error) {
AwBrowserContext* g_browser_context = NULL;
+net::ProxyConfigService* CreateProxyConfigService() {
+ net::ProxyConfigServiceAndroid* config_service =
+ static_cast<net::ProxyConfigServiceAndroid*>(
+ net::ProxyService::CreateSystemProxyConfigService(
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO),
+ nullptr /* Ignored on Android */ ));
+ config_service->set_use_local_proxy(true);
+ return config_service;
+}
+
} // namespace
// Data reduction proxy is disabled by default.
@@ -112,10 +123,7 @@ void AwBrowserContext::PreMainMessageLoopRun() {
data_reduction_proxy_config_service(
new DataReductionProxyConfigService(
scoped_ptr<net::ProxyConfigService>(
- net::ProxyService::CreateSystemProxyConfigService(
- BrowserThread::GetMessageLoopProxyForThread(
- BrowserThread::IO),
- NULL /* Ignored on Android */)).Pass()));
+ CreateProxyConfigService()).Pass()));
eroman 2014/11/21 01:55:15 Should this be a part of net::ProxySerive::CreateS
sgurun-gerrit only 2014/11/21 02:13:37 I think this is a special case for webview, but I
if (data_reduction_proxy_settings_.get()) {
data_reduction_proxy_configurator_.reset(
new data_reduction_proxy::DataReductionProxyConfigTracker(

Powered by Google App Engine
This is Rietveld 408576698