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/java_handler_thread.h" | 7 #include "base/android/java_handler_thread.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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 jobjectArray jparameters, | 75 jobjectArray jparameters, |
76 jstring j_local_apps_directory) { | 76 jstring j_local_apps_directory) { |
77 base::android::ScopedJavaLocalRef<jobject> scoped_context(env, context); | 77 base::android::ScopedJavaLocalRef<jobject> scoped_context(env, context); |
78 base::android::InitApplicationContext(env, scoped_context); | 78 base::android::InitApplicationContext(env, scoped_context); |
79 | 79 |
80 std::vector<std::string> parameters; | 80 std::vector<std::string> parameters; |
81 parameters.push_back( | 81 parameters.push_back( |
82 base::android::ConvertJavaStringToUTF8(env, mojo_shell_path)); | 82 base::android::ConvertJavaStringToUTF8(env, mojo_shell_path)); |
83 base::android::AppendJavaStringArrayToStringVector(env, jparameters, | 83 base::android::AppendJavaStringArrayToStringVector(env, jparameters, |
84 ¶meters); | 84 ¶meters); |
85 CommandLine::Init(0, nullptr); | 85 base::CommandLine::Init(0, nullptr); |
86 base::CommandLine::ForCurrentProcess()->InitFromArgv(parameters); | 86 base::CommandLine::ForCurrentProcess()->InitFromArgv(parameters); |
87 | 87 |
88 InitializeLogging(); | 88 InitializeLogging(); |
89 | 89 |
90 // We want ~MessageLoop to happen prior to ~Context. Initializing | 90 // We want ~MessageLoop to happen prior to ~Context. Initializing |
91 // LazyInstances is akin to stack-allocating objects; their destructors | 91 // LazyInstances is akin to stack-allocating objects; their destructors |
92 // will be invoked first-in-last-out. | 92 // will be invoked first-in-last-out. |
93 Context* shell_context = new Context(); | 93 Context* shell_context = new Context(); |
94 shell_context->mojo_url_resolver()->SetLocalAppsPath(base::FilePath( | 94 shell_context->mojo_url_resolver()->SetLocalAppsPath(base::FilePath( |
95 base::android::ConvertJavaStringToUTF8(env, j_local_apps_directory))); | 95 base::android::ConvertJavaStringToUTF8(env, j_local_apps_directory))); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 base::CommandLine::ForCurrentProcess()->AppendArg( | 129 base::CommandLine::ForCurrentProcess()->AppendArg( |
130 base::android::ConvertJavaStringToUTF8(env, jurl)); | 130 base::android::ConvertJavaStringToUTF8(env, jurl)); |
131 } | 131 } |
132 | 132 |
133 bool RegisterMojoMain(JNIEnv* env) { | 133 bool RegisterMojoMain(JNIEnv* env) { |
134 return RegisterNativesImpl(env); | 134 return RegisterNativesImpl(env); |
135 } | 135 } |
136 | 136 |
137 } // namespace shell | 137 } // namespace shell |
138 } // namespace mojo | 138 } // namespace mojo |
OLD | NEW |