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

Unified Diff: chrome/app/android/chrome_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 | « chrome/app/android/chrome_jni_onload.h ('k') | chrome/browser/android/chrome_entry_point.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1b703f49693c48a5f349f61db71897a00b2829d0..64310dc8f2e3de625786a1efa3e12bc1b53492d4 100644
--- a/chrome/app/android/chrome_jni_onload.cc
+++ b/chrome/app/android/chrome_jni_onload.cc
@@ -4,17 +4,18 @@
#include "chrome/app/android/chrome_jni_onload.h"
+#include "base/android/jni_android.h"
#include "base/android/library_loader/library_loader_hooks.h"
-#include "base/bind.h"
#include "chrome/app/android/chrome_android_initializer.h"
#include "chrome/browser/android/chrome_jni_registrar.h"
#include "content/public/app/content_jni_onload.h"
namespace android {
-namespace {
+bool OnJNIOnLoadRegisterJNI(JNIEnv* env) {
+ if (!content::android::OnJNIOnLoadRegisterJNI(env))
+ return false;
-bool RegisterJNI(JNIEnv* env) {
if (base::android::GetLibraryProcessType(env) ==
base::android::PROCESS_BROWSER) {
return RegisterBrowserJNI(env);
@@ -22,26 +23,11 @@ bool RegisterJNI(JNIEnv* env) {
return true;
}
-bool Init() {
- return RunChrome();
-}
-
-} // namespace
+bool OnJNIOnLoadInit() {
+ if (!content::android::OnJNIOnLoadInit())
+ return false;
-bool OnJNIOnLoadRegisterJNI(
- JavaVM* vm,
- base::android::RegisterCallback callback) {
- std::vector<base::android::RegisterCallback> register_callbacks;
- register_callbacks.push_back(callback);
- register_callbacks.push_back(base::Bind(&RegisterJNI));
- return content::android::OnJNIOnLoadRegisterJNI(vm, register_callbacks);
-}
-
-bool OnJNIOnLoadInit(base::android::InitCallback callback) {
- std::vector<base::android::InitCallback> init_callbacks;
- init_callbacks.push_back(callback);
- init_callbacks.push_back(base::Bind(&Init));
- return content::android::OnJNIOnLoadInit(init_callbacks);
+ return RunChrome();
}
} // namespace android
« no previous file with comments | « chrome/app/android/chrome_jni_onload.h ('k') | chrome/browser/android/chrome_entry_point.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698