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

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, 1 month 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
Index: chrome/app/chrome_main.cc
diff --git a/chrome/app/chrome_main.cc b/chrome/app/chrome_main.cc
index e24c4675287833e7a2654dccbe050ebe1dc89f10..cefe93b2e9bdf78db8f1739abaa27c1c6655e41e 100644
--- a/chrome/app/chrome_main.cc
+++ b/chrome/app/chrome_main.cc
@@ -5,13 +5,15 @@
#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/app/headless_shell.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"
@@ -58,6 +60,11 @@ int ChromeMain(int argc, const char** argv) {
#if defined(OS_WIN)
install_static::InstallDetails::InitializeFromPrimaryModule(
chrome::kChromeElfDllName);
+
+ const base::CommandLine command_line(argc, argv);
+#if defined(OS_LINUX)
+ if (command_line.HasSwitch(switches::kHeadless))
+ return HeadlessShellMain(argc, argv);
#endif
ChromeMainDelegate chrome_main_delegate(
@@ -98,8 +105,6 @@ int ChromeMain(int argc, const char** argv) {
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"))
return MashMain();
}
« no previous file with comments | « chrome/DEPS ('k') | content/browser/browser_main_loop.cc » ('j') | content/gpu/gpu_main.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698