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

Side by Side Diff: headless/app/headless_shell.cc

Issue 1912673002: headless: Add support for host resolver mapping (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased again Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | headless/lib/browser/headless_url_request_context_getter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <memory> 5 #include <memory>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 command_line.GetSwitchValueASCII(headless::switches::kProxyServer); 120 command_line.GetSwitchValueASCII(headless::switches::kProxyServer);
121 net::HostPortPair parsed_proxy_server = 121 net::HostPortPair parsed_proxy_server =
122 net::HostPortPair::FromString(proxy_server); 122 net::HostPortPair::FromString(proxy_server);
123 if (parsed_proxy_server.host().empty() || !parsed_proxy_server.port()) { 123 if (parsed_proxy_server.host().empty() || !parsed_proxy_server.port()) {
124 LOG(ERROR) << "Malformed proxy server url"; 124 LOG(ERROR) << "Malformed proxy server url";
125 return EXIT_FAILURE; 125 return EXIT_FAILURE;
126 } 126 }
127 builder.SetProxyServer(parsed_proxy_server); 127 builder.SetProxyServer(parsed_proxy_server);
128 } 128 }
129 129
130 if (command_line.HasSwitch(switches::kHostResolverRules)) {
131 builder.SetHostResolverRules(
132 command_line.GetSwitchValueASCII(switches::kHostResolverRules));
133 }
134
130 return HeadlessBrowserMain( 135 return HeadlessBrowserMain(
131 builder.Build(), 136 builder.Build(),
132 base::Bind(&HeadlessShell::OnStart, base::Unretained(&shell))); 137 base::Bind(&HeadlessShell::OnStart, base::Unretained(&shell)));
133 } 138 }
OLDNEW
« no previous file with comments | « no previous file | headless/lib/browser/headless_url_request_context_getter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698