| Index: content/shell/android/shell_library_loader.cc
|
| diff --git a/content/shell/android/shell_library_loader.cc b/content/shell/android/shell_library_loader.cc
|
| index d9b3d28b229148bbdc67e17b81ca47ce15a679d1..dc88bd67eb012a8bb49001d5a29eef7a33419db2 100644
|
| --- a/content/shell/android/shell_library_loader.cc
|
| +++ b/content/shell/android/shell_library_loader.cc
|
| @@ -3,6 +3,7 @@
|
| // found in the LICENSE file.
|
|
|
| #include "base/android/jni_android.h"
|
| +#include "base/android/library_loader/library_loader_hooks.h"
|
| #include "base/bind.h"
|
| #include "content/public/app/content_jni_onload.h"
|
| #include "content/public/app/content_main.h"
|
| @@ -16,7 +17,10 @@ bool RegisterJNI(JNIEnv* env) {
|
| return content::android::RegisterShellJni(env);
|
| }
|
|
|
| -bool Init() {
|
| +bool NativeInit() {
|
| + if (!content::android::OnJNIOnLoadInit())
|
| + return false;
|
| +
|
| content::Compositor::Initialize();
|
| content::SetContentMainDelegate(new content::ShellMainDelegate());
|
| return true;
|
| @@ -27,12 +31,10 @@ bool Init() {
|
|
|
| // This is called by the VM when the shared library is first loaded.
|
| JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
|
| - std::vector<base::android::RegisterCallback> register_callbacks;
|
| - register_callbacks.push_back(base::Bind(&RegisterJNI));
|
| - std::vector<base::android::InitCallback> init_callbacks;
|
| - init_callbacks.push_back(base::Bind(&Init));
|
| - if (!content::android::OnJNIOnLoadRegisterJNI(vm, register_callbacks) ||
|
| - !content::android::OnJNIOnLoadInit(init_callbacks)) {
|
| + base::android::InitVM(vm);
|
| + JNIEnv* env = base::android::AttachCurrentThread();
|
| + if (!content::android::OnJNIOnLoadRegisterJNI(env) || !RegisterJNI(env) ||
|
| + !NativeInit()) {
|
| return -1;
|
| }
|
| return JNI_VERSION_1_4;
|
|
|