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

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

Issue 805113002: Moves android specific code into android directory (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: merge 2 trunk Created 6 years 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_registrar.h" 5 #include "base/android/base_jni_registrar.h"
6 #include "base/android/jni_android.h" 6 #include "base/android/jni_android.h"
7 #include "base/android/jni_registrar.h" 7 #include "base/android/jni_registrar.h"
8 #include "base/android/library_loader/library_loader_hooks.h" 8 #include "base/android/library_loader/library_loader_hooks.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "services/native_viewport/platform_viewport_android.h" 10 #include "services/native_viewport/platform_viewport_android.h"
11 #include "shell/android/android_handler.h" 11 #include "shell/android/android_handler.h"
12 #include "shell/android/mojo_main.h" 12 #include "shell/android/mojo_main.h"
13 13
14 namespace { 14 namespace {
15 15
16 base::android::RegistrationMethod kMojoRegisteredMethods[] = { 16 base::android::RegistrationMethod kMojoRegisteredMethods[] = {
17 {"AndroidHandler", mojo::RegisterAndroidHandlerJni}, 17 {"AndroidHandler", mojo::RegisterAndroidHandlerJni},
18 {"MojoMain", mojo::RegisterMojoMain}, 18 {"MojoMain", mojo::shell::RegisterMojoMain},
19 {"PlatformViewportAndroid", 19 {"PlatformViewportAndroid",
20 native_viewport::PlatformViewportAndroid::Register}, 20 native_viewport::PlatformViewportAndroid::Register},
21 }; 21 };
22 22
23 bool RegisterMojoJni(JNIEnv* env) { 23 bool RegisterMojoJni(JNIEnv* env) {
24 return RegisterNativeMethods(env, kMojoRegisteredMethods, 24 return RegisterNativeMethods(env, kMojoRegisteredMethods,
25 arraysize(kMojoRegisteredMethods)); 25 arraysize(kMojoRegisteredMethods));
26 } 26 }
27 27
28 } // namespace 28 } // namespace
29 29
30 // This is called by the VM when the shared library is first loaded. 30 // This is called by the VM when the shared library is first loaded.
31 JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { 31 JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
32 base::android::InitVM(vm); 32 base::android::InitVM(vm);
33 JNIEnv* env = base::android::AttachCurrentThread(); 33 JNIEnv* env = base::android::AttachCurrentThread();
34 34
35 if (!base::android::RegisterLibraryLoaderEntryHook(env)) 35 if (!base::android::RegisterLibraryLoaderEntryHook(env))
36 return -1; 36 return -1;
37 37
38 if (!base::android::RegisterJni(env)) 38 if (!base::android::RegisterJni(env))
39 return -1; 39 return -1;
40 40
41 if (!RegisterMojoJni(env)) 41 if (!RegisterMojoJni(env))
42 return -1; 42 return -1;
43 43
44 return JNI_VERSION_1_4; 44 return JNI_VERSION_1_4;
45 } 45 }
OLDNEW
« no previous file with comments | « shell/android/apk/src/org/chromium/mojo_shell_apk/MojoMain.java ('k') | shell/android/mojo_main.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698