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: sky/shell/library_loader.cc

Issue 1139873004: Make android directory for Android-specific bits of SkyShell (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 7 months 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/android/base_jni_onload.h"
6 #include "base/android/base_jni_registrar.h"
7 #include "base/android/jni_android.h"
8 #include "base/android/jni_registrar.h"
9 #include "base/android/library_loader/library_loader_hooks.h"
10 #include "base/bind.h"
11 #include "base/logging.h"
12 #include "mojo/android/system/core_impl.h"
13 #include "sky/shell/java_service_provider.h"
14 #include "sky/shell/platform_view.h"
15 #include "sky/shell/sky_main.h"
16 #include "sky/shell/tracing_controller.h"
17
18 namespace {
19
20 base::android::RegistrationMethod kSkyRegisteredMethods[] = {
21 {"CoreImpl", mojo::android::RegisterCoreImpl},
22 {"JavaServiceProvider", sky::shell::RegisterJavaServiceProvider},
23 {"PlatformView", sky::shell::PlatformView::Register},
24 {"SkyMain", sky::shell::RegisterSkyMain},
25 {"TracingController", sky::shell::RegisterTracingController},
26 };
27
28 bool RegisterJNI(JNIEnv* env) {
29 if (!base::android::RegisterJni(env))
30 return false;
31
32 return RegisterNativeMethods(env, kSkyRegisteredMethods,
33 arraysize(kSkyRegisteredMethods));
34 }
35
36 } // namespace
37
38 // This is called by the VM when the shared library is first loaded.
39 JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
40 std::vector<base::android::RegisterCallback> register_callbacks;
41 register_callbacks.push_back(base::Bind(&RegisterJNI));
42 if (!base::android::OnJNIOnLoadRegisterJNI(vm, register_callbacks) ||
43 !base::android::OnJNIOnLoadInit(
44 std::vector<base::android::InitCallback>())) {
45 return -1;
46 }
47
48 return JNI_VERSION_1_4;
49 }
OLDNEW
« no previous file with comments | « sky/shell/java_service_provider.cc ('k') | sky/shell/org/domokit/sky/shell/GestureProvider.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698