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/runner/android/main.h" | 5 #include "mojo/runner/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" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 std::vector<std::string> parameters; | 149 std::vector<std::string> parameters; |
150 parameters.push_back( | 150 parameters.push_back( |
151 base::android::ConvertJavaStringToUTF8(env, mojo_shell_path)); | 151 base::android::ConvertJavaStringToUTF8(env, mojo_shell_path)); |
152 base::android::AppendJavaStringArrayToStringVector(env, jparameters, | 152 base::android::AppendJavaStringArrayToStringVector(env, jparameters, |
153 ¶meters); | 153 ¶meters); |
154 base::CommandLine::Init(0, nullptr); | 154 base::CommandLine::Init(0, nullptr); |
155 base::CommandLine::ForCurrentProcess()->InitFromArgv(parameters); | 155 base::CommandLine::ForCurrentProcess()->InitFromArgv(parameters); |
156 g_shell_runner.Get().reset(new MojoShellRunner(parameters)); | 156 g_shell_runner.Get().reset(new MojoShellRunner(parameters)); |
157 | 157 |
158 InitializeLogging(); | 158 InitializeLogging(); |
| 159 mojo::runner::WaitForDebuggerIfNecessary(); |
159 | 160 |
160 InitializeRedirection(); | 161 InitializeRedirection(); |
161 | 162 |
162 // We want ~MessageLoop to happen prior to ~Context. Initializing | 163 // We want ~MessageLoop to happen prior to ~Context. Initializing |
163 // LazyInstances is akin to stack-allocating objects; their destructors | 164 // LazyInstances is akin to stack-allocating objects; their destructors |
164 // will be invoked first-in-last-out. | 165 // will be invoked first-in-last-out. |
165 Context* shell_context = new Context(); | 166 Context* shell_context = new Context(); |
166 shell_context->SetShellFileRoot(base::FilePath( | 167 shell_context->SetShellFileRoot(base::FilePath( |
167 base::android::ConvertJavaStringToUTF8(env, j_local_apps_directory))); | 168 base::android::ConvertJavaStringToUTF8(env, j_local_apps_directory))); |
168 g_context.Get().reset(shell_context); | 169 g_context.Get().reset(shell_context); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 } | 203 } |
203 | 204 |
204 } // namespace runner | 205 } // namespace runner |
205 } // namespace mojo | 206 } // namespace mojo |
206 | 207 |
207 // TODO(vtl): Even though main() should never be called, mojo_shell fails to | 208 // TODO(vtl): Even though main() should never be called, mojo_shell fails to |
208 // link without it. Figure out if we can avoid this. | 209 // link without it. Figure out if we can avoid this. |
209 int main(int argc, char** argv) { | 210 int main(int argc, char** argv) { |
210 NOTREACHED(); | 211 NOTREACHED(); |
211 } | 212 } |
OLD | NEW |