OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/android/base_jni_registrar.h" | 5 #include "base/android/base_jni_registrar.h" |
6 #include "base/android/jni_android.h" | 6 #include "base/android/jni_android.h" |
7 #include "base/android/library_loader/library_loader_hooks.h" | 7 #include "net/android/net_jni_registrar.h" |
8 #include "components/devtools_bridge/android/component_loader.h" | |
9 | |
10 using namespace devtools_bridge::android; | |
11 | 8 |
12 JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { | 9 JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { |
13 base::android::InitVM(vm); | 10 base::android::InitVM(vm); |
14 JNIEnv* env = base::android::AttachCurrentThread(); | 11 JNIEnv* env = base::android::AttachCurrentThread(); |
15 if (!base::android::RegisterLibraryLoaderEntryHook(env)) { | 12 |
| 13 if (!base::android::RegisterJni(env)) |
16 return -1; | 14 return -1; |
17 } | 15 |
18 if (!ComponentLoader::OnLoad(env)) { | 16 if (!net::android::RegisterJni(env)) |
19 return -1; | 17 return -1; |
20 } | 18 |
21 return JNI_VERSION_1_4; | 19 return JNI_VERSION_1_4; |
22 } | 20 } |
| 21 |
| 22 extern "C" JNI_EXPORT void InitApplicationContext( |
| 23 const base::android::JavaRef<jobject>& context) { |
| 24 JNIEnv* env = base::android::AttachCurrentThread(); |
| 25 base::android::InitApplicationContext(env, context); |
| 26 } |
OLD | NEW |