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

Unified Diff: chrome/app/chrome_main.cc

Issue 1991953002: Implement a runtime headless mode for Linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years 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 | « chrome/app/DEPS ('k') | content/browser/browser_main_loop.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/chrome_main.cc
diff --git a/chrome/app/chrome_main.cc b/chrome/app/chrome_main.cc
index 4e692590adf0975b480e42befdbbb591436a6ea9..8e1dcc577a1b9bba422497d3618a3fd91333c4ca 100644
--- a/chrome/app/chrome_main.cc
+++ b/chrome/app/chrome_main.cc
@@ -5,13 +5,16 @@
#include <stdint.h>
#include "build/build_config.h"
+#include "base/command_line.h"
#include "base/time/time.h"
#include "chrome/app/chrome_main_delegate.h"
#include "chrome/common/features.h"
#include "content/public/app/content_main.h"
+#include "content/public/common/content_switches.h"
+#include "headless/public/headless_shell.h"
+#include "ui/gfx/switches.h"
#if BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES)
-#include "base/command_line.h"
#include "chrome/app/mash/mash_runner.h"
#include "chrome/common/channel_info.h"
#include "components/version_info/version_info.h"
@@ -82,17 +85,22 @@ int ChromeMain(int argc, const char** argv) {
params.argv = argv;
#endif
-#if BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES)
#if !defined(OS_WIN)
base::CommandLine::Init(params.argc, params.argv);
+ const base::CommandLine* command_line(base::CommandLine::ForCurrentProcess());
+ ALLOW_UNUSED_LOCAL(command_line);
#endif
+#if defined(OS_LINUX)
+ if (command_line->HasSwitch(switches::kHeadless))
+ return headless::HeadlessShellMain(argc, argv);
+#endif // defined(OS_LINUX)
+
+#if BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES)
version_info::Channel channel = chrome::GetChannel();
if (channel == version_info::Channel::CANARY ||
channel == version_info::Channel::UNKNOWN) {
- const base::CommandLine& command_line =
- *base::CommandLine::ForCurrentProcess();
- if (command_line.HasSwitch("mash"))
+ if (command_line->HasSwitch("mash"))
return MashMain();
WaitForMashDebuggerIfNecessary();
}
« no previous file with comments | « chrome/app/DEPS ('k') | content/browser/browser_main_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698