OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 "mojo/runner/desktop/main_helper.h" | 5 #include "mojo/shell/standalone/desktop/main_helper.h" |
6 | 6 |
7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "base/base_switches.h" | 8 #include "base/base_switches.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/debugger.h" | 10 #include "base/debug/debugger.h" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/process/launch.h" | 13 #include "base/process/launch.h" |
14 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
15 #include "base/strings/string_split.h" | 15 #include "base/strings/string_split.h" |
16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
17 #include "mojo/runner/desktop/launcher_process.h" | |
18 #include "mojo/shell/runner/host/child_process.h" | 17 #include "mojo/shell/runner/host/child_process.h" |
19 #include "mojo/shell/runner/host/switches.h" | 18 #include "mojo/shell/runner/host/switches.h" |
20 #include "mojo/shell/runner/init.h" | 19 #include "mojo/shell/runner/init.h" |
| 20 #include "mojo/shell/standalone/desktop/launcher_process.h" |
21 | 21 |
22 #if defined(OS_WIN) | 22 #if defined(OS_WIN) |
23 #include <windows.h> | 23 #include <windows.h> |
24 #elif (OS_POSIX) | 24 #elif (OS_POSIX) |
25 #include <unistd.h> | 25 #include <unistd.h> |
26 #endif | 26 #endif |
27 | 27 |
28 namespace mojo { | 28 namespace mojo { |
29 namespace runner { | 29 namespace shell { |
30 | 30 |
31 int RunnerMain(int argc, char** argv, | 31 int StandaloneShellMain(int argc, |
32 const GURL& mojo_url, | 32 char** argv, |
33 const base::Closure& callback) { | 33 const GURL& mojo_url, |
| 34 const base::Closure& callback) { |
34 base::CommandLine::Init(argc, argv); | 35 base::CommandLine::Init(argc, argv); |
35 const base::CommandLine& command_line = | 36 const base::CommandLine& command_line = |
36 *base::CommandLine::ForCurrentProcess(); | 37 *base::CommandLine::ForCurrentProcess(); |
37 | 38 |
38 base::AtExitManager at_exit; | 39 base::AtExitManager at_exit; |
39 shell::InitializeLogging(); | 40 InitializeLogging(); |
40 shell::WaitForDebuggerIfNecessary(); | 41 WaitForDebuggerIfNecessary(); |
41 | 42 |
42 #if !defined(OFFICIAL_BUILD) && defined(OS_WIN) | 43 #if !defined(OFFICIAL_BUILD) && defined(OS_WIN) |
43 base::RouteStdioToConsole(false); | 44 base::RouteStdioToConsole(false); |
44 #endif | 45 #endif |
45 | 46 |
46 if (command_line.HasSwitch(switches::kChildProcess)) | 47 if (command_line.HasSwitch(switches::kChildProcess)) |
47 return shell::ChildProcessMain(); | 48 return ChildProcessMain(); |
48 | 49 |
49 return LauncherProcessMain(mojo_url, callback); | 50 return LauncherProcessMain(mojo_url, callback); |
50 } | 51 } |
51 | 52 |
52 } // namespace runner | 53 } // namespace shell |
53 } // namespace mojo | 54 } // namespace mojo |
OLD | NEW |