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 7ad7c4c7bc648a1eb9927ad99ee878826dfdb0e3..f8791a02b74ebbc89c0e37dd6408911fe86e3ddb 100644 |
--- a/android_webview/browser/net/aw_url_request_context_getter.cc |
+++ b/android_webview/browser/net/aw_url_request_context_getter.cc |
@@ -228,8 +228,17 @@ void AwURLRequestContextGetter::InitializeURLRequestContext() { |
// Android provides a local HTTP proxy that handles all the proxying. |
// Create the proxy without a resolver since we rely on this local HTTP proxy. |
// TODO(sgurun) is this behavior guaranteed through SDK? |
- builder.set_proxy_service(net::ProxyService::CreateWithoutProxyResolver( |
- std::move(proxy_config_service_), net_log_.get())); |
+ |
+ const base::CommandLine& command_line = |
+ *base::CommandLine::ForCurrentProcess(); |
+ if (command_line.HasSwitch(switches::kProxyServer)) { |
+ std::string proxy = |
+ command_line.GetSwitchValueASCII(switches::kProxyServer); |
+ builder.set_proxy_service(net::ProxyService::CreateFixed(proxy)); |
+ } else { |
+ builder.set_proxy_service(net::ProxyService::CreateWithoutProxyResolver( |
+ std::move(proxy_config_service_), net_log_.get())); |
+ } |
builder.set_net_log(net_log_.get()); |
builder.SetCookieAndChannelIdStores(base::MakeUnique<AwCookieStoreWrapper>(), |
std::move(channel_id_service)); |