| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "mojo/shell/standalone/desktop/main_helper.h" | |
| 6 | |
| 7 #include "base/at_exit.h" | |
| 8 #include "base/base_switches.h" | |
| 9 #include "base/command_line.h" | |
| 10 #include "base/debug/debugger.h" | |
| 11 #include "base/files/file_path.h" | |
| 12 #include "base/logging.h" | |
| 13 #include "base/process/launch.h" | |
| 14 #include "base/stl_util.h" | |
| 15 #include "base/strings/string_split.h" | |
| 16 #include "base/strings/utf_string_conversions.h" | |
| 17 #include "mojo/shell/runner/common/switches.h" | |
| 18 #include "mojo/shell/runner/host/child_process.h" | |
| 19 #include "mojo/shell/runner/init.h" | |
| 20 #include "mojo/shell/standalone/desktop/launcher_process.h" | |
| 21 | |
| 22 #if defined(OS_WIN) | |
| 23 #include <windows.h> | |
| 24 #elif (OS_POSIX) | |
| 25 #include <unistd.h> | |
| 26 #endif | |
| 27 | |
| 28 namespace mojo { | |
| 29 namespace shell { | |
| 30 | |
| 31 int StandaloneShellMain(int argc, char** argv) { | |
| 32 base::CommandLine::Init(argc, argv); | |
| 33 const base::CommandLine& command_line = | |
| 34 *base::CommandLine::ForCurrentProcess(); | |
| 35 | |
| 36 base::AtExitManager at_exit; | |
| 37 InitializeLogging(); | |
| 38 WaitForDebuggerIfNecessary(); | |
| 39 | |
| 40 #if !defined(OFFICIAL_BUILD) && defined(OS_WIN) | |
| 41 base::RouteStdioToConsole(false); | |
| 42 #endif | |
| 43 | |
| 44 if (command_line.HasSwitch(switches::kChildProcess)) | |
| 45 return ChildProcessMain(); | |
| 46 | |
| 47 return LauncherProcessMain(); | |
| 48 } | |
| 49 | |
| 50 } // namespace shell | |
| 51 } // namespace mojo | |
| OLD | NEW |