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

Unified Diff: headless/lib/browser/headless_url_request_context_getter.cc

Issue 1781193004: headless: Make it possible to configure an HTTP proxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments. Created 4 years, 9 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 | « headless/lib/browser/headless_browser_impl.cc ('k') | headless/lib/browser/headless_web_contents_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
}
« no previous file with comments | « headless/lib/browser/headless_browser_impl.cc ('k') | headless/lib/browser/headless_web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698