Index: components/devtools_bridge/test/android/javatests/jni/jni_onload.cc |
diff --git a/components/devtools_bridge/test/android/javatests/jni/jni_onload.cc b/components/devtools_bridge/test/android/javatests/jni/jni_onload.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..36dcdc8cc77c68bfe184539aee36a6ad866f5719 |
--- /dev/null |
+++ b/components/devtools_bridge/test/android/javatests/jni/jni_onload.cc |
@@ -0,0 +1,24 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#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/session_dependency_factory_native.h" |
+ |
+using namespace devtools_bridge::android; |
+ |
+JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { |
+ base::android::InitVM(vm); |
+ JNIEnv* env = base::android::AttachCurrentThread(); |
+ if (!base::android::RegisterLibraryLoaderEntryHook(env)) { |
+ return -1; |
+ } |
+ if (!base::android::RegisterJni(env)) { |
+ return -1; |
+ } |
+ |
+ SessionDependencyFactoryNative::RegisterNatives(env); |
+ return JNI_VERSION_1_4; |
+} |