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

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

Issue 935413004: Separate OnJNIOnLoad (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sync 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 | « chromecast/app/android/cast_jni_loader.cc ('k') | content/public/app/content_jni_onload.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ab9596526ebfa1a23f6e4ea15f7d298a5b301889..27c7b1668dbfa4340b21dc314c7f081fd2956870 100644
--- a/content/app/android/content_jni_onload.cc
+++ b/content/app/android/content_jni_onload.cc
@@ -7,8 +7,8 @@
#include <vector>
#include "base/android/base_jni_onload.h"
-#include "base/android/jni_onload_delegate.h"
#include "base/android/library_loader/library_loader_hooks.h"
+#include "base/bind.h"
#include "content/app/android/library_loader_hooks.h"
#include "content/public/app/content_main.h"
@@ -17,18 +17,11 @@ namespace android {
namespace {
-class ContentJNIOnLoadDelegate
- : public base::android::JNIOnLoadDelegate {
- public:
- bool RegisterJNI(JNIEnv* env) override;
- bool Init() override;
-};
-
-bool ContentJNIOnLoadDelegate::RegisterJNI(JNIEnv* env) {
+bool RegisterJNI(JNIEnv* env) {
return content::EnsureJniRegistered(env);
}
-bool ContentJNIOnLoadDelegate::Init() {
+bool Init() {
base::android::SetLibraryLoadedHook(&content::LibraryLoaded);
return true;
}
@@ -36,13 +29,20 @@ bool ContentJNIOnLoadDelegate::Init() {
} // namespace
-bool OnJNIOnLoad(JavaVM* vm,
- base::android::JNIOnLoadDelegate* delegate) {
- std::vector<base::android::JNIOnLoadDelegate*> delegates;
- ContentJNIOnLoadDelegate content_delegate;
- delegates.push_back(delegate);
- delegates.push_back(&content_delegate);
- return base::android::OnJNIOnLoad(vm, &delegates);
+bool OnJNIOnLoadRegisterJNI(
+ JavaVM* vm,
+ base::android::RegisterCallback callback) {
+ std::vector<base::android::RegisterCallback> callbacks;
+ callbacks.push_back(callback);
+ callbacks.push_back(base::Bind(&RegisterJNI));
+ return base::android::OnJNIOnLoadRegisterJNI(vm, callbacks);
+}
+
+bool OnJNIOnLoadInit(base::android::InitCallback callback) {
+ std::vector<base::android::InitCallback> callbacks;
+ callbacks.push_back(callback);
+ callbacks.push_back(base::Bind(&Init));
+ return base::android::OnJNIOnLoadInit(callbacks);
}
} // namespace android
« no previous file with comments | « chromecast/app/android/cast_jni_loader.cc ('k') | content/public/app/content_jni_onload.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698