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

Unified Diff: headless/app/headless_shell.cc

Issue 2671713004: headless: Add command line flags for logging (Closed)
Patch Set: Review comments Created 3 years, 11 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') | headless/app/headless_shell_switches.h » ('J')
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 cd05f9796cec82027c032dfc5a6fdf020d309db9..106dd5db8db3374c28ccb4872fa2be39b1436543 100644
--- a/headless/app/headless_shell.cc
+++ b/headless/app/headless_shell.cc
@@ -18,7 +18,6 @@
#include "base/memory/weak_ptr.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/string_number_conversions.h"
-#include "content/public/common/content_switches.h"
#include "headless/app/headless_shell_switches.h"
#include "headless/public/devtools/domains/emulation.h"
#include "headless/public/devtools/domains/inspector.h"
@@ -384,7 +383,7 @@ class HeadlessShell : public HeadlessWebContents::Observer,
bool RemoteDebuggingEnabled() const {
const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess();
- return command_line.HasSwitch(::switches::kRemoteDebuggingPort);
+ return command_line.HasSwitch(switches::kRemoteDebuggingPort);
}
private:
@@ -402,7 +401,7 @@ class HeadlessShell : public HeadlessWebContents::Observer,
};
bool ValidateCommandLine(const base::CommandLine& command_line) {
- if (!command_line.HasSwitch(::switches::kRemoteDebuggingPort)) {
+ if (!command_line.HasSwitch(switches::kRemoteDebuggingPort)) {
if (command_line.GetArgs().size() <= 1)
return true;
LOG(ERROR) << "Open multiple tabs is only supported when the "
@@ -442,7 +441,9 @@ int HeadlessShellMain(int argc, const char** argv) {
HeadlessBrowser::Options::Builder builder(argc, argv);
// Enable devtools if requested.
- base::CommandLine command_line(argc, argv);
+ base::CommandLine::Init(argc, argv);
+ const base::CommandLine& command_line(
+ *base::CommandLine::ForCurrentProcess());
if (!ValidateCommandLine(command_line))
return EXIT_FAILURE;
@@ -484,9 +485,9 @@ int HeadlessShellMain(int argc, const char** argv) {
builder.SetProxyServer(parsed_proxy_server);
}
- if (command_line.HasSwitch(::switches::kHostResolverRules)) {
+ if (command_line.HasSwitch(switches::kHostResolverRules)) {
builder.SetHostResolverRules(
- command_line.GetSwitchValueASCII(::switches::kHostResolverRules));
+ command_line.GetSwitchValueASCII(switches::kHostResolverRules));
}
if (command_line.HasSwitch(switches::kUseGL)) {
« no previous file with comments | « no previous file | headless/app/headless_shell_switches.h » ('j') | headless/app/headless_shell_switches.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698