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

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: 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
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..ef7864ad1e63e6451d2231ca5293b442c7e75e99 100644
--- a/content/app/android/content_jni_onload.cc
+++ b/content/app/android/content_jni_onload.cc
@@ -20,29 +20,34 @@ namespace {
class ContentJNIOnLoadDelegate
: public base::android::JNIOnLoadDelegate {
public:
- bool RegisterJNI(JNIEnv* env) override;
- bool Init() override;
+ bool RegisterJNI(JNIEnv* env) override {
+ return content::EnsureJniRegistered(env);
+ }
+ bool Init() override {
+ base::android::SetLibraryLoadedHook(&content::LibraryLoaded);
+ return true;
+ }
};
-bool ContentJNIOnLoadDelegate::RegisterJNI(JNIEnv* env) {
- return content::EnsureJniRegistered(env);
-}
-
-bool ContentJNIOnLoadDelegate::Init() {
- base::android::SetLibraryLoadedHook(&content::LibraryLoaded);
- return true;
-}
-
} // namespace
-bool OnJNIOnLoad(JavaVM* vm,
- base::android::JNIOnLoadDelegate* delegate) {
+bool OnJNIOnLoadRegisterJNI(
+ 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::OnJNIOnLoadRegisterJNI(vm, &delegates);
+}
+
+bool OnJNIOnLoadInit(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);
+ return base::android::OnJNIOnLoadInit(&delegates);
}
} // namespace android

Powered by Google App Engine
This is Rietveld 408576698