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 "shell/android/mojo_main.h" | 5 #include "shell/android/mojo_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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 base::CommandLine::ForCurrentProcess()->InitFromArgv(parameters); | 151 base::CommandLine::ForCurrentProcess()->InitFromArgv(parameters); |
152 | 152 |
153 InitializeLogging(); | 153 InitializeLogging(); |
154 | 154 |
155 InitializeRedirection(); | 155 InitializeRedirection(); |
156 | 156 |
157 // We want ~MessageLoop to happen prior to ~Context. Initializing | 157 // We want ~MessageLoop to happen prior to ~Context. Initializing |
158 // LazyInstances is akin to stack-allocating objects; their destructors | 158 // LazyInstances is akin to stack-allocating objects; their destructors |
159 // will be invoked first-in-last-out. | 159 // will be invoked first-in-last-out. |
160 Context* shell_context = new Context(); | 160 Context* shell_context = new Context(); |
161 shell_context->mojo_url_resolver()->SetLocalAppsPath(base::FilePath( | 161 shell_context->SetShellFileRoot(base::FilePath( |
162 base::android::ConvertJavaStringToUTF8(env, j_local_apps_directory))); | 162 base::android::ConvertJavaStringToUTF8(env, j_local_apps_directory))); |
163 for (auto& args : parameters) | 163 for (auto& args : parameters) |
164 ApplyApplicationArgs(shell_context, args); | 164 ApplyApplicationArgs(shell_context, args); |
165 | 165 |
166 g_context.Get().reset(shell_context); | 166 g_context.Get().reset(shell_context); |
167 | 167 |
168 g_java_message_loop.Get().reset(new base::MessageLoopForUI); | 168 g_java_message_loop.Get().reset(new base::MessageLoopForUI); |
169 base::MessageLoopForUI::current()->Start(); | 169 base::MessageLoopForUI::current()->Start(); |
170 | 170 |
171 // TODO(abarth): At which point should we switch to cross-platform | 171 // TODO(abarth): At which point should we switch to cross-platform |
(...skipping 22 matching lines...) Expand all Loading... |
194 base::CommandLine::ForCurrentProcess()->AppendArg( | 194 base::CommandLine::ForCurrentProcess()->AppendArg( |
195 base::android::ConvertJavaStringToUTF8(env, jurl)); | 195 base::android::ConvertJavaStringToUTF8(env, jurl)); |
196 } | 196 } |
197 | 197 |
198 bool RegisterMojoMain(JNIEnv* env) { | 198 bool RegisterMojoMain(JNIEnv* env) { |
199 return RegisterNativesImpl(env); | 199 return RegisterNativesImpl(env); |
200 } | 200 } |
201 | 201 |
202 } // namespace shell | 202 } // namespace shell |
203 } // namespace mojo | 203 } // namespace mojo |
OLD | NEW |