Index: chromecast/app/android/cast_jni_loader.cc |
diff --git a/chromecast/app/android/cast_jni_loader.cc b/chromecast/app/android/cast_jni_loader.cc |
index d2cc9c75edc4b87f52adfe540c831ddc107e74f0..98223f2c954e5a093d93ed1847757a218f4aee42 100644 |
--- a/chromecast/app/android/cast_jni_loader.cc |
+++ b/chromecast/app/android/cast_jni_loader.cc |
@@ -3,7 +3,7 @@ |
// found in the LICENSE file. |
#include "base/android/jni_android.h" |
-#include "base/android/jni_onload_delegate.h" |
+#include "base/bind.h" |
#include "chromecast/android/cast_jni_registrar.h" |
#include "chromecast/android/platform_jni_loader.h" |
#include "chromecast/app/cast_main_delegate.h" |
@@ -13,32 +13,31 @@ |
namespace { |
-class CastJNIOnLoadDelegate : public base::android::JNIOnLoadDelegate { |
- public: |
- bool RegisterJNI(JNIEnv* env) override { |
- // To be called only from the UI thread. If loading the library is done on |
- // a separate thread, this should be moved elsewhere. |
- if (!chromecast::android::RegisterJni(env)) |
- return false; |
- // Allow platform-specific implementations to perform more JNI registration. |
- if (!chromecast::android::PlatformRegisterJni(env)) |
- return false; |
- return true; |
- } |
+bool RegisterJNI(JNIEnv* env) { |
+ // To be called only from the UI thread. If loading the library is done on |
+ // a separate thread, this should be moved elsewhere. |
+ if (!chromecast::android::RegisterJni(env)) |
+ return false; |
+ // Allow platform-specific implementations to perform more JNI registration. |
+ if (!chromecast::android::PlatformRegisterJni(env)) |
+ return false; |
+ return true; |
+} |
- bool Init() override { |
- content::Compositor::Initialize(); |
- content::SetContentMainDelegate(new chromecast::shell::CastMainDelegate); |
- return true; |
- } |
-}; |
+bool Init() { |
+ content::Compositor::Initialize(); |
+ content::SetContentMainDelegate(new chromecast::shell::CastMainDelegate); |
+ return true; |
+} |
} // namespace |
// This is called by the VM when the shared library is first loaded. |
JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { |
- CastJNIOnLoadDelegate delegate; |
- if (!content::android::OnJNIOnLoad(vm, &delegate)) |
+ if (!content::android::OnJNIOnLoadRegisterJNI( |
+ vm, base::Bind(&RegisterJNI)) || |
+ !content::android::OnJNIOnLoadInit(base::Bind(&Init))) |
return -1; |
+ |
return JNI_VERSION_1_4; |
} |