Commit 4bc3f6d6 authored by Eric Roman's avatar Eric Roman Committed by Commit Bot

Recognize --proxy-bypass-list from WebView.

Bug: 906540
Change-Id: Ic0cae00166b1d3ffb85eb3dcae6f9df22a6252d8
Reviewed-on: https://chromium-review.googlesource.com/c/1356006Reviewed-by: default avatarTobias Sargeant <tobiasjs@chromium.org>
Commit-Queue: Eric Roman <eroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612514}
parent aa1f1cca
...@@ -85,6 +85,7 @@ bool g_check_cleartext_permitted = false; ...@@ -85,6 +85,7 @@ bool g_check_cleartext_permitted = false;
const char kProxyServerSwitch[] = "proxy-server"; const char kProxyServerSwitch[] = "proxy-server";
const char kProxyBypassListSwitch[] = "proxy-bypass-list";
void ApplyCmdlineOverridesToHostResolver( void ApplyCmdlineOverridesToHostResolver(
net::MappedHostResolver* host_resolver) { net::MappedHostResolver* host_resolver) {
...@@ -292,9 +293,17 @@ void AwURLRequestContextGetter::InitializeURLRequestContext() { ...@@ -292,9 +293,17 @@ void AwURLRequestContextGetter::InitializeURLRequestContext() {
*base::CommandLine::ForCurrentProcess(); *base::CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(kProxyServerSwitch)) { if (command_line.HasSwitch(kProxyServerSwitch)) {
std::string proxy = command_line.GetSwitchValueASCII(kProxyServerSwitch); std::string proxy = command_line.GetSwitchValueASCII(kProxyServerSwitch);
net::ProxyConfig proxy_config;
proxy_config.proxy_rules().ParseFromString(proxy);
if (command_line.HasSwitch(kProxyBypassListSwitch)) {
std::string bypass_list =
command_line.GetSwitchValueASCII(kProxyBypassListSwitch);
proxy_config.proxy_rules().bypass_rules.ParseFromString(bypass_list);
}
builder.set_proxy_resolution_service( builder.set_proxy_resolution_service(
net::ProxyResolutionService::CreateFixed(proxy, net::ProxyResolutionService::CreateFixed(net::ProxyConfigWithAnnotation(
NO_TRAFFIC_ANNOTATION_YET)); proxy_config, NO_TRAFFIC_ANNOTATION_YET)));
} else { } else {
// Retain a pointer to the config proxy service before ownership is passed // Retain a pointer to the config proxy service before ownership is passed
// on. // on.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment