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

Unified Diff: content/app/android/content_jni_onload.cc

Issue 2620303004: Remove JNI onload callback vector construction in favour of direct calls. (Closed)
Patch Set: rebase compile errors Created 3 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
Index: content/app/android/content_jni_onload.cc
diff --git a/content/app/android/content_jni_onload.cc b/content/app/android/content_jni_onload.cc
index 67a596d4cec35cf90e88bcc29f4ee739a853db47..15f89d2d7feac85f77c098358fce4037b83dd512 100644
--- a/content/app/android/content_jni_onload.cc
+++ b/content/app/android/content_jni_onload.cc
@@ -7,6 +7,7 @@
#include <vector>
#include "base/android/base_jni_onload.h"
+#include "base/android/jni_android.h"
#include "base/android/library_loader/library_loader_hooks.h"
#include "base/bind.h"
#include "content/app/android/library_loader_hooks.h"
@@ -15,32 +16,20 @@
namespace content {
namespace android {
-namespace {
+bool OnJNIOnLoadRegisterJNI(JNIEnv* env) {
+ if (!base::android::OnJNIOnLoadRegisterJNI(env))
+ return false;
-bool RegisterJNI(JNIEnv* env) {
return content::EnsureJniRegistered(env);
}
-bool Init() {
+bool OnJNIOnLoadInit() {
+ if (!base::android::OnJNIOnLoadInit())
+ return false;
+
base::android::SetLibraryLoadedHook(&content::LibraryLoaded);
return true;
}
-} // namespace
-
-
-bool OnJNIOnLoadRegisterJNI(
- JavaVM* vm,
- std::vector<base::android::RegisterCallback> callbacks) {
- callbacks.push_back(base::Bind(&RegisterJNI));
- return base::android::OnJNIOnLoadRegisterJNI(vm, callbacks);
-}
-
-bool OnJNIOnLoadInit(
- std::vector<base::android::InitCallback> callbacks) {
- callbacks.push_back(base::Bind(&Init));
- return base::android::OnJNIOnLoadInit(callbacks);
-}
-
} // namespace android
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698