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

Unified Diff: headless/app/headless_shell.cc

Issue 1920773003: headless: Make it possible to override the DevTools server address (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | headless/app/headless_shell_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/app/headless_shell.cc
diff --git a/headless/app/headless_shell.cc b/headless/app/headless_shell.cc
index e1348e328ed10634668affd59a479af1b29429ed..525ff12e1cf777f76f57b9410354919d2e0e619b 100644
--- a/headless/app/headless_shell.cc
+++ b/headless/app/headless_shell.cc
@@ -101,14 +101,18 @@ int main(int argc, const char** argv) {
// Enable devtools if requested.
base::CommandLine command_line(argc, argv);
if (command_line.HasSwitch(switches::kRemoteDebuggingPort)) {
+ std::string address = kDevToolsHttpServerAddress;
+ if (command_line.HasSwitch(headless::switches::kRemoteDebuggingAddress)) {
+ address = command_line.GetSwitchValueASCII(
+ headless::switches::kRemoteDebuggingAddress);
Mike West 2016/04/26 08:04:37 It seems reasonable to do some sanity checking her
Sami 2016/04/26 10:07:52 Good point. I've now made this use net::ParseURLHo
+ }
int parsed_port;
std::string port_str =
command_line.GetSwitchValueASCII(switches::kRemoteDebuggingPort);
if (base::StringToInt(port_str, &parsed_port) &&
base::IsValueInRangeForNumericType<uint16_t>(parsed_port)) {
net::IPAddress devtools_address;
- bool result =
- devtools_address.AssignFromIPLiteral(kDevToolsHttpServerAddress);
+ bool result = devtools_address.AssignFromIPLiteral(address);
DCHECK(result);
builder.EnableDevToolsServer(net::IPEndPoint(
devtools_address, base::checked_cast<uint16_t>(parsed_port)));
« no previous file with comments | « no previous file | headless/app/headless_shell_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698