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

Unified Diff: shell/desktop/main.cc

Issue 1055463004: Replace ChildProcess/AppChildProcess with a simple ChildMain(). (Closed) Base URL: https://github.com/domokit/mojo.git@simplify_child_6-x-simplify_child_5
Patch Set: rebased Created 5 years, 9 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 | « shell/child_process_host_unittest.cc ('k') | shell/shell_test_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: shell/desktop/main.cc
diff --git a/shell/desktop/main.cc b/shell/desktop/main.cc
index 898ab544c578ef11563890df596a1630587494b0..dcc110b5b3aa4e9293333158ede0d5844efb8a52 100644
--- a/shell/desktop/main.cc
+++ b/shell/desktop/main.cc
@@ -16,7 +16,7 @@
#include "base/message_loop/message_loop.h"
#include "base/synchronization/waitable_event.h"
#include "base/trace_event/trace_event.h"
-#include "shell/child_process.h"
+#include "shell/child_main.h"
#include "shell/command_line_util.h"
#include "shell/context.h"
#include "shell/init.h"
@@ -109,16 +109,15 @@ int main(int argc, char** argv) {
mojo::shell::InitializeLogging();
+ const base::CommandLine& command_line =
+ *base::CommandLine::ForCurrentProcess();
+
// TODO(vtl): Unify parent and child process cases to the extent possible.
- if (scoped_ptr<mojo::shell::ChildProcess> child_process =
- mojo::shell::ChildProcess::Create(
- *base::CommandLine::ForCurrentProcess())) {
- child_process->Main();
+ int exit_code = 0;
+ if (command_line.HasSwitch(switches::kChildProcess)) {
+ exit_code = mojo::shell::ChildMain();
} else {
// Only check the command line for the main process.
- const base::CommandLine& command_line =
- *base::CommandLine::ForCurrentProcess();
-
const std::set<std::string> all_switches = switches::GetAllSwitches();
const base::CommandLine::SwitchMap switches = command_line.GetSwitches();
bool found_unknown_switch = false;
@@ -181,5 +180,5 @@ int main(int argc, char** argv) {
if (g_tracing)
StopTracingAndFlushToDisk();
- return 0;
+ return exit_code;
}
« no previous file with comments | « shell/child_process_host_unittest.cc ('k') | shell/shell_test_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698