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

Unified Diff: chrome/app/android/chrome_jni_onload.cc

Issue 864563002: Separate JNI registration with initialization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix component build Created 5 years, 11 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: chrome/app/android/chrome_jni_onload.cc
diff --git a/chrome/app/android/chrome_jni_onload.cc b/chrome/app/android/chrome_jni_onload.cc
index 1d6e8a1f2d57abac40775bd0c498fc3ef586aa4b..a87a18988dff9922ab4d9200d5678813ef663d15 100644
--- a/chrome/app/android/chrome_jni_onload.cc
+++ b/chrome/app/android/chrome_jni_onload.cc
@@ -4,14 +4,17 @@
#include "base/android/jni_android.h"
-#include "chrome/app/android/chrome_android_initializer.h"
-#include "chrome/app/android/chrome_main_delegate_android.h"
+#include "chrome/app/android/chrome_jni_onload_delegate.h"
+#include "content/public/app/content_jni_onload.h"
// This is called by the VM when the shared library is first loaded.
-// Note that this file must be included in the final shared_library build step
-// and not in a static library or the JNI_OnLoad symbol won't be included
-// because the Android build is compiled with exclude-libs=ALL to reduce symbol
-// size.
JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
- return RunChrome(vm, ChromeMainDelegateAndroid::Create());
+ ChromeJNIOnLoadDelegate delegate;
+ std::vector<base::android::JNIOnLoadDelegate*> delegates;
+ delegates.push_back(&delegate);
+
+ if (!content::android::OnJNIOnLoad(vm, &delegates))
+ return -1;
+
+ return JNI_VERSION_1_4;
}

Powered by Google App Engine
This is Rietveld 408576698