Index: headless/lib/browser/headless_url_request_context_getter.cc |
diff --git a/headless/lib/browser/headless_url_request_context_getter.cc b/headless/lib/browser/headless_url_request_context_getter.cc |
index de1ad37fcd29dd2d762c1103973b410d70c1adfa..1a1407ed201c4395eab0c0f2ecc356f82358d154 100644 |
--- a/headless/lib/browser/headless_url_request_context_getter.cc |
+++ b/headless/lib/browser/headless_url_request_context_getter.cc |
@@ -73,7 +73,8 @@ HeadlessURLRequestContextGetter::HeadlessURLRequestContextGetter( |
// We must create the proxy config service on the UI loop on Linux because it |
// must synchronously run on the glib message loop. This will be passed to |
// the URLRequestContextStorage on the IO thread in GetURLRequestContext(). |
- proxy_config_service_ = GetProxyConfigService(); |
+ if (options_.proxy_server.IsEmpty()) |
+ proxy_config_service_ = GetProxyConfigService(); |
} |
HeadlessURLRequestContextGetter::~HeadlessURLRequestContextGetter() {} |
@@ -91,6 +92,8 @@ HeadlessURLRequestContextGetter::GetProxyConfigService() { |
scoped_ptr<net::ProxyService> |
HeadlessURLRequestContextGetter::GetProxyService() { |
+ if (!options_.proxy_server.IsEmpty()) |
+ return net::ProxyService::CreateFixed(options_.proxy_server.ToString()); |
return net::ProxyService::CreateUsingSystemProxyResolver( |
std::move(proxy_config_service_), 0, url_request_context_->net_log()); |
} |