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

Unified Diff: shell/android/library_loader.cc

Issue 952893003: Update from https://crrev.com/317530 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix gn for nacl Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/surfaces/surfaces_scheduler.cc ('k') | skia/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: shell/android/library_loader.cc
diff --git a/shell/android/library_loader.cc b/shell/android/library_loader.cc
index 42e02dff86490341d5964dfeeaebd2818455407f..0aff50b15018e3111572ab11f57c01ee4ce01b76 100644
--- a/shell/android/library_loader.cc
+++ b/shell/android/library_loader.cc
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/android/base_jni_onload.h"
#include "base/android/base_jni_registrar.h"
#include "base/android/jni_android.h"
#include "base/android/jni_registrar.h"
-#include "base/android/library_loader/library_loader_hooks.h"
-#include "base/logging.h"
+#include "base/bind.h"
#include "services/native_viewport/platform_viewport_android.h"
#include "shell/android/android_handler.h"
#include "shell/android/keyboard_impl.h"
@@ -22,7 +22,10 @@ base::android::RegistrationMethod kMojoRegisteredMethods[] = {
native_viewport::PlatformViewportAndroid::Register},
};
-bool RegisterMojoJni(JNIEnv* env) {
+bool RegisterJNI(JNIEnv* env) {
+ if (!base::android::RegisterJni(env))
+ return false;
+
return RegisterNativeMethods(env, kMojoRegisteredMethods,
arraysize(kMojoRegisteredMethods));
}
@@ -31,17 +34,13 @@ bool RegisterMojoJni(JNIEnv* env) {
// This is called by the VM when the shared library is first loaded.
JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
- base::android::InitVM(vm);
- JNIEnv* env = base::android::AttachCurrentThread();
-
- if (!base::android::RegisterLibraryLoaderEntryHook(env))
- return -1;
-
- if (!base::android::RegisterJni(env))
- return -1;
-
- if (!RegisterMojoJni(env))
+ std::vector<base::android::RegisterCallback> register_callbacks;
+ register_callbacks.push_back(base::Bind(&RegisterJNI));
+ if (!base::android::OnJNIOnLoadRegisterJNI(vm, register_callbacks) ||
+ !base::android::OnJNIOnLoadInit(
+ std::vector<base::android::InitCallback>())) {
return -1;
+ }
return JNI_VERSION_1_4;
}
« no previous file with comments | « services/surfaces/surfaces_scheduler.cc ('k') | skia/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698