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

Unified Diff: testing/android/native_test_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: testing/android/native_test_jni_onload.cc
diff --git a/testing/android/native_test_jni_onload.cc b/testing/android/native_test_jni_onload.cc
index bfab3c9933b689300763a4fc03cc60fa5394b158..c7d44ffddadeb54439b9258c75f456cdacb7742a 100644
--- a/testing/android/native_test_jni_onload.cc
+++ b/testing/android/native_test_jni_onload.cc
@@ -11,19 +11,16 @@ namespace {
class NativeTestJNIOnLoadDelegate : public base::android::JNIOnLoadDelegate {
public:
- bool RegisterJNI(JNIEnv* env) override;
- bool Init() override;
+ bool RegisterJNI(JNIEnv* env) override {
+ return RegisterNativeTestJNI(env);
+ }
+
+ bool Init() override {
+ InstallHandlers();
+ return true;
+ }
};
-bool NativeTestJNIOnLoadDelegate::RegisterJNI(JNIEnv* env) {
- return RegisterNativeTestJNI(env);
-}
-
-bool NativeTestJNIOnLoadDelegate::Init() {
- InstallHandlers();
- return true;
-}
-
} // namespace
@@ -33,7 +30,8 @@ JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
std::vector<base::android::JNIOnLoadDelegate*> delegates;
delegates.push_back(&delegate);
- if (!base::android::OnJNIOnLoad(vm, &delegates))
+ if (!base::android::OnJNIOnLoadRegisterJNI(vm, &delegates) ||
+ !base::android::OnJNIOnLoadInit(&delegates))
return -1;
return JNI_VERSION_1_4;
« base/android/base_jni_onload.h ('K') | « content/shell/android/shell_library_loader.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698