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

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

Issue 2325763004: ProxyServer commandline flag for android webview (Closed)
Patch Set: Added commandline switch for ProxyServer to webview Created 4 years, 3 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 | « no previous file | chrome/browser/net/proxy_browsertest.cc » ('j') | chrome/browser/net/proxy_browsertest.cc » ('J')
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 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));
« no previous file with comments | « no previous file | chrome/browser/net/proxy_browsertest.cc » ('j') | chrome/browser/net/proxy_browsertest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698