Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: shell/android/library_loader.cc

Issue 1456913002: Use thread with looper and native message loop for vsync service. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/android/base_jni_onload.h" 5 #include "base/android/base_jni_onload.h"
6 #include "base/android/base_jni_registrar.h" 6 #include "base/android/base_jni_registrar.h"
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_registrar.h" 8 #include "base/android/jni_registrar.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "mojo/android/system/base_run_loop.h" 10 #include "mojo/android/system/base_run_loop.h"
11 #include "mojo/android/system/core_impl.h" 11 #include "mojo/android/system/core_impl.h"
12 #include "services/native_viewport/platform_viewport_android.h" 12 #include "services/native_viewport/platform_viewport_android.h"
13 #include "shell/android/android_handler.h" 13 #include "shell/android/android_handler.h"
14 #include "shell/android/java_application_loader.h" 14 #include "shell/android/java_application_loader.h"
15 #include "shell/android/main.h" 15 #include "shell/android/main.h"
16 #include "shell/android/native_handler_thread.h"
16 17
17 namespace { 18 namespace {
18 19
19 base::android::RegistrationMethod kMojoRegisteredMethods[] = { 20 base::android::RegistrationMethod kMojoRegisteredMethods[] = {
20 {"Base", base::android::RegisterJni}, 21 {"Base", base::android::RegisterJni},
21 {"Core", mojo::android::RegisterCoreImpl}, 22 {"Core", mojo::android::RegisterCoreImpl},
22 {"BaseRunLoop", mojo::android::RegisterBaseRunLoop}, 23 {"BaseRunLoop", mojo::android::RegisterBaseRunLoop},
23 {"AndroidHandler", shell::RegisterAndroidHandlerJni}, 24 {"AndroidHandler", shell::RegisterAndroidHandlerJni},
25 {"JavaApplicationLoader", shell::JavaApplicationLoader::RegisterJni},
26 {"NativeHandlerThread", shell::RegisterNativeHandlerThreadJni},
24 {"PlatformViewportAndroid", 27 {"PlatformViewportAndroid",
25 native_viewport::PlatformViewportAndroid::Register}, 28 native_viewport::PlatformViewportAndroid::Register},
26 {"ShellService", shell::RegisterShellService}, 29 {"ShellService", shell::RegisterShellService},
27 {"JavaApplicationLoader", shell::JavaApplicationLoader::RegisterJni},
28 }; 30 };
29 31
30 bool RegisterJNI(JNIEnv* env) { 32 bool RegisterJNI(JNIEnv* env) {
31 return RegisterNativeMethods(env, kMojoRegisteredMethods, 33 return RegisterNativeMethods(env, kMojoRegisteredMethods,
32 arraysize(kMojoRegisteredMethods)); 34 arraysize(kMojoRegisteredMethods));
33 } 35 }
34 36
35 } // namespace 37 } // namespace
36 38
37 // This is called by the VM when the shared library is first loaded. 39 // This is called by the VM when the shared library is first loaded.
38 JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { 40 JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
39 std::vector<base::android::RegisterCallback> register_callbacks; 41 std::vector<base::android::RegisterCallback> register_callbacks;
40 register_callbacks.push_back(base::Bind(&RegisterJNI)); 42 register_callbacks.push_back(base::Bind(&RegisterJNI));
41 if (!base::android::OnJNIOnLoadRegisterJNI(vm, register_callbacks) || 43 if (!base::android::OnJNIOnLoadRegisterJNI(vm, register_callbacks) ||
42 !base::android::OnJNIOnLoadInit( 44 !base::android::OnJNIOnLoadInit(
43 std::vector<base::android::InitCallback>())) { 45 std::vector<base::android::InitCallback>())) {
44 return -1; 46 return -1;
45 } 47 }
46 48
47 return JNI_VERSION_1_4; 49 return JNI_VERSION_1_4;
48 } 50 }
OLDNEW
« no previous file with comments | « shell/android/apk/src/org/chromium/mojo/shell/VsyncFactory.java ('k') | shell/android/native_handler_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698