| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/shell/standalone/android/main.h" | 5 #include "mojo/shell/standalone/android/main.h" |
| 6 | 6 |
| 7 #include "base/android/fifo_utils.h" | 7 #include "base/android/fifo_utils.h" |
| 8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
| 9 #include "base/android/jni_array.h" | 9 #include "base/android/jni_array.h" |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| 11 #include "base/at_exit.h" | 11 #include "base/at_exit.h" |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/debug/stack_trace.h" | 14 #include "base/debug/stack_trace.h" |
| 15 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
| 16 #include "base/files/file_util.h" | 16 #include "base/files/file_util.h" |
| 17 #include "base/i18n/icu_util.h" |
| 17 #include "base/lazy_instance.h" | 18 #include "base/lazy_instance.h" |
| 18 #include "base/logging.h" | 19 #include "base/logging.h" |
| 19 #include "base/macros.h" | 20 #include "base/macros.h" |
| 20 #include "base/message_loop/message_loop.h" | 21 #include "base/message_loop/message_loop.h" |
| 21 #include "base/run_loop.h" | 22 #include "base/run_loop.h" |
| 22 #include "build/build_config.h" | 23 #include "build/build_config.h" |
| 23 #include "components/mus/android_loader.h" | 24 #include "components/mus/android_loader.h" |
| 24 #include "jni/ShellMain_jni.h" | 25 #include "jni/ShellMain_jni.h" |
| 25 #include "mojo/message_pump/message_pump_mojo.h" | 26 #include "mojo/message_pump/message_pump_mojo.h" |
| 26 #include "mojo/shell/application_loader.h" | 27 #include "mojo/shell/application_loader.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 // LazyInstances is akin to stack-allocating objects; their destructors | 130 // LazyInstances is akin to stack-allocating objects; their destructors |
| 130 // will be invoked first-in-last-out. | 131 // will be invoked first-in-last-out. |
| 131 base::FilePath shell_file_root( | 132 base::FilePath shell_file_root( |
| 132 base::android::ConvertJavaStringToUTF8(env, j_local_apps_directory)); | 133 base::android::ConvertJavaStringToUTF8(env, j_local_apps_directory)); |
| 133 Context* shell_context = new Context; | 134 Context* shell_context = new Context; |
| 134 g_context.Get().reset(shell_context); | 135 g_context.Get().reset(shell_context); |
| 135 | 136 |
| 136 g_java_message_loop.Get().reset(new base::MessageLoopForUI); | 137 g_java_message_loop.Get().reset(new base::MessageLoopForUI); |
| 137 base::MessageLoopForUI::current()->Start(); | 138 base::MessageLoopForUI::current()->Start(); |
| 138 | 139 |
| 140 CHECK(base::i18n::InitializeICU()); |
| 141 |
| 139 shell_context->Init(shell_file_root); | 142 shell_context->Init(shell_file_root); |
| 140 ConfigureAndroidServices(shell_context); | 143 ConfigureAndroidServices(shell_context); |
| 141 | 144 |
| 142 // This is done after the main message loop is started since it may post | 145 // This is done after the main message loop is started since it may post |
| 143 // tasks. This is consistent with the ordering from the desktop version of | 146 // tasks. This is consistent with the ordering from the desktop version of |
| 144 // this file (../desktop/launcher_process.cc). | 147 // this file (../desktop/launcher_process.cc). |
| 145 InitContext(shell_context); | 148 InitContext(shell_context); |
| 146 | 149 |
| 147 // TODO(abarth): At which point should we switch to cross-platform | 150 // TODO(abarth): At which point should we switch to cross-platform |
| 148 // initialization? | 151 // initialization? |
| (...skipping 30 matching lines...) Expand all Loading... |
| 179 } // namespace shell | 182 } // namespace shell |
| 180 } // namespace mojo | 183 } // namespace mojo |
| 181 | 184 |
| 182 int main(int argc, char** argv) { | 185 int main(int argc, char** argv) { |
| 183 base::AtExitManager at_exit; | 186 base::AtExitManager at_exit; |
| 184 base::CommandLine::Init(argc, argv); | 187 base::CommandLine::Init(argc, argv); |
| 185 | 188 |
| 186 mojo::shell::InitializeLogging(); | 189 mojo::shell::InitializeLogging(); |
| 187 return mojo::shell::ChildProcessMain(); | 190 return mojo::shell::ChildProcessMain(); |
| 188 } | 191 } |
| OLD | NEW |