Index: mojo/services/network/android_hooks.cc |
diff --git a/components/devtools_bridge/test/android/javatests/jni/jni_onload.cc b/mojo/services/network/android_hooks.cc |
similarity index 56% |
copy from components/devtools_bridge/test/android/javatests/jni/jni_onload.cc |
copy to mojo/services/network/android_hooks.cc |
index f156aed51c6cb87879d5286eeab80068e5d1965b..190eef178580a843dbef16090d39109bdb7c5dcb 100644 |
--- a/components/devtools_bridge/test/android/javatests/jni/jni_onload.cc |
+++ b/mojo/services/network/android_hooks.cc |
@@ -4,19 +4,23 @@ |
#include "base/android/base_jni_registrar.h" |
#include "base/android/jni_android.h" |
-#include "base/android/library_loader/library_loader_hooks.h" |
-#include "components/devtools_bridge/android/component_loader.h" |
- |
-using namespace devtools_bridge::android; |
+#include "net/android/net_jni_registrar.h" |
JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { |
base::android::InitVM(vm); |
JNIEnv* env = base::android::AttachCurrentThread(); |
- if (!base::android::RegisterLibraryLoaderEntryHook(env)) { |
+ |
+ if (!base::android::RegisterJni(env)) |
return -1; |
- } |
- if (!ComponentLoader::OnLoad(env)) { |
+ |
+ if (!net::android::RegisterJni(env)) |
return -1; |
- } |
+ |
return JNI_VERSION_1_4; |
} |
+ |
+extern "C" JNI_EXPORT void InitApplicationContext( |
+ const base::android::JavaRef<jobject>& context) { |
+ JNIEnv* env = base::android::AttachCurrentThread(); |
+ base::android::InitApplicationContext(env, context); |
+} |