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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « chrome/app/DEPS ('k') | content/browser/browser_main_loop.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "base/command_line.h"
8 #include "base/time/time.h" 9 #include "base/time/time.h"
9 #include "chrome/app/chrome_main_delegate.h" 10 #include "chrome/app/chrome_main_delegate.h"
10 #include "chrome/common/features.h" 11 #include "chrome/common/features.h"
11 #include "content/public/app/content_main.h" 12 #include "content/public/app/content_main.h"
13 #include "content/public/common/content_switches.h"
14 #include "headless/public/headless_shell.h"
15 #include "ui/gfx/switches.h"
12 16
13 #if BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) 17 #if BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES)
14 #include "base/command_line.h"
15 #include "chrome/app/mash/mash_runner.h" 18 #include "chrome/app/mash/mash_runner.h"
16 #include "chrome/common/channel_info.h" 19 #include "chrome/common/channel_info.h"
17 #include "components/version_info/version_info.h" 20 #include "components/version_info/version_info.h"
18 #endif 21 #endif
19 22
20 #if defined(OS_WIN) 23 #if defined(OS_WIN)
21 #include "base/debug/dump_without_crashing.h" 24 #include "base/debug/dump_without_crashing.h"
22 #include "base/win/win_util.h" 25 #include "base/win/win_util.h"
23 #include "chrome/common/chrome_constants.h" 26 #include "chrome/common/chrome_constants.h"
24 #include "chrome/install_static/install_details.h" 27 #include "chrome/install_static/install_details.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 78
76 // Verify that chrome_elf and this module (chrome.dll and chrome_child.dll) 79 // Verify that chrome_elf and this module (chrome.dll and chrome_child.dll)
77 // have the same version. 80 // have the same version.
78 if (install_static::InstallDetails::Get().VersionMismatch()) 81 if (install_static::InstallDetails::Get().VersionMismatch())
79 base::debug::DumpWithoutCrashing(); 82 base::debug::DumpWithoutCrashing();
80 #else 83 #else
81 params.argc = argc; 84 params.argc = argc;
82 params.argv = argv; 85 params.argv = argv;
83 #endif 86 #endif
84 87
85 #if BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES)
86 #if !defined(OS_WIN) 88 #if !defined(OS_WIN)
87 base::CommandLine::Init(params.argc, params.argv); 89 base::CommandLine::Init(params.argc, params.argv);
90 const base::CommandLine* command_line(base::CommandLine::ForCurrentProcess());
91 ALLOW_UNUSED_LOCAL(command_line);
88 #endif 92 #endif
89 93
94 #if defined(OS_LINUX)
95 if (command_line->HasSwitch(switches::kHeadless))
96 return headless::HeadlessShellMain(argc, argv);
97 #endif // defined(OS_LINUX)
98
99 #if BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES)
90 version_info::Channel channel = chrome::GetChannel(); 100 version_info::Channel channel = chrome::GetChannel();
91 if (channel == version_info::Channel::CANARY || 101 if (channel == version_info::Channel::CANARY ||
92 channel == version_info::Channel::UNKNOWN) { 102 channel == version_info::Channel::UNKNOWN) {
93 const base::CommandLine& command_line = 103 if (command_line->HasSwitch("mash"))
94 *base::CommandLine::ForCurrentProcess();
95 if (command_line.HasSwitch("mash"))
96 return MashMain(); 104 return MashMain();
97 WaitForMashDebuggerIfNecessary(); 105 WaitForMashDebuggerIfNecessary();
98 } 106 }
99 #endif // BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) 107 #endif // BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES)
100 108
101 int rv = content::ContentMain(params); 109 int rv = content::ContentMain(params);
102 110
103 #if defined(OS_WIN) 111 #if defined(OS_WIN)
104 base::win::SetShouldCrashOnProcessDetach(false); 112 base::win::SetShouldCrashOnProcessDetach(false);
105 #endif 113 #endif
106 114
107 return rv; 115 return rv;
108 } 116 }
OLDNEW
« 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