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

Unified Diff: base/android/base_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
« no previous file with comments | « base/android/base_jni_onload.h ('k') | chrome/app/android/chrome_jni_onload.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/base_jni_onload.cc
diff --git a/base/android/base_jni_onload.cc b/base/android/base_jni_onload.cc
index 7ab4982c427276ac438ff0b2adabe46ca4cfc1da..0a82db4864c1d170052133dd2cd9da60777c6c38 100644
--- a/base/android/base_jni_onload.cc
+++ b/base/android/base_jni_onload.cc
@@ -12,13 +12,11 @@
namespace base {
namespace android {
-namespace {
-
-bool RegisterJNI(JNIEnv* env) {
+bool OnJNIOnLoadRegisterJNI(JNIEnv* env) {
return RegisterLibraryLoaderEntryHook(env);
}
-bool Init() {
+bool OnJNIOnLoadInit() {
InitAtExitManager();
JNIEnv* env = base::android::AttachCurrentThread();
base::android::InitReplacementClassLoader(env,
@@ -26,32 +24,5 @@ bool Init() {
return true;
}
-} // namespace
-
-
-bool OnJNIOnLoadRegisterJNI(JavaVM* vm,
- std::vector<RegisterCallback> callbacks) {
- base::android::InitVM(vm);
- JNIEnv* env = base::android::AttachCurrentThread();
-
- callbacks.push_back(base::Bind(&RegisterJNI));
- for (std::vector<RegisterCallback>::reverse_iterator i =
- callbacks.rbegin(); i != callbacks.rend(); ++i) {
- if (!i->Run(env))
- return false;
- }
- return true;
-}
-
-bool OnJNIOnLoadInit(std::vector<InitCallback> callbacks) {
- callbacks.push_back(base::Bind(&Init));
- for (std::vector<InitCallback>::reverse_iterator i =
- callbacks.rbegin(); i != callbacks.rend(); ++i) {
- if (!i->Run())
- return false;
- }
- return true;
-}
-
} // namespace android
} // namespace base
« no previous file with comments | « base/android/base_jni_onload.h ('k') | chrome/app/android/chrome_jni_onload.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698