From 44bfa328f18ab426fd82141754f90f6e33938193 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 20 Aug 2014 11:49:18 +0800 Subject: [PATCH] Add --proxy-server switch. --- brightray/browser/url_request_context_getter.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/brightray/browser/url_request_context_getter.cc b/brightray/browser/url_request_context_getter.cc index bc6e5d9a3f..9a93ac155f 100644 --- a/brightray/browser/url_request_context_getter.cc +++ b/brightray/browser/url_request_context_getter.cc @@ -67,6 +67,10 @@ const char kHostRules[] = "host-rules"; // other proxy server flags that are passed. const char kNoProxyServer[] = "no-proxy-server"; +// Uses a specified proxy server, overrides system settings. This switch only +// affects HTTP and HTTPS requests. +const char kProxyServer[] = "proxy-server"; + } // namespace URLRequestContextGetter::URLRequestContextGetter( @@ -138,6 +142,9 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() { net::DhcpProxyScriptFetcherFactory dhcp_factory; if (command_line.HasSwitch(kNoProxyServer)) storage_->set_proxy_service(net::ProxyService::CreateDirect()); + else if (command_line.HasSwitch(kProxyServer)) + storage_->set_proxy_service(net::ProxyService::CreateFixed( + command_line.GetSwitchValueASCII(kProxyServer))); else storage_->set_proxy_service( net::CreateProxyServiceUsingV8ProxyResolver(