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 // This file is autogenerated by | 5 // This file is autogenerated by |
6 // base/android/jni_generator/jni_generator.py | 6 // base/android/jni_generator/jni_generator.py |
7 // For | 7 // For |
8 // org/chromium/TestJni | 8 // org/chromium/TestJni |
9 | 9 |
10 #ifndef org_chromium_TestJni_JNI | 10 #ifndef org_chromium_TestJni_JNI |
11 #define org_chromium_TestJni_JNI | 11 #define org_chromium_TestJni_JNI |
12 | 12 |
13 #include <jni.h> | 13 #include <jni.h> |
14 | 14 |
15 #include "base/android/jni_generator/jni_generator_helper.h" | 15 #include "base/android/jni_generator/jni_generator_helper.h" |
16 | 16 |
17 #include "base/android/jni_int_wrapper.h" | 17 #include "base/android/jni_int_wrapper.h" |
| 18 #include "base/android/jni_utils.h" |
18 | 19 |
19 // Step 1: forward declarations. | 20 // Step 1: forward declarations. |
20 namespace { | 21 namespace { |
21 const char kMyOtherInnerClassClassPath[] = | 22 const char kMyOtherInnerClassClassPath[] = |
22 "org/chromium/TestJni$MyOtherInnerClass"; | 23 "org/chromium/TestJni$MyOtherInnerClass"; |
23 const char kTestJniClassPath[] = "org/chromium/TestJni"; | 24 const char kTestJniClassPath[] = "org/chromium/TestJni"; |
24 // Leaking this jclass as we cannot use LazyInstance from some threads. | 25 // Leaking this jclass as we cannot use LazyInstance from some threads. |
25 base::subtle::AtomicWord g_MyOtherInnerClass_clazz __attribute__((unused)) = 0; | 26 base::subtle::AtomicWord g_MyOtherInnerClass_clazz __attribute__((unused)) = 0; |
26 #define MyOtherInnerClass_clazz(env) base::android::LazyGetClass(env, kMyOtherIn
nerClassClassPath, &g_MyOtherInnerClass_clazz) | 27 #define MyOtherInnerClass_clazz(env) base::android::LazyGetClass(env, kMyOtherIn
nerClassClassPath, &g_MyOtherInnerClass_clazz) |
27 // Leaking this jclass as we cannot use LazyInstance from some threads. | 28 // Leaking this jclass as we cannot use LazyInstance from some threads. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 63 |
63 static const JNINativeMethod kMethodsTestJni[] = { | 64 static const JNINativeMethod kMethodsTestJni[] = { |
64 { "nativeInit", | 65 { "nativeInit", |
65 "(" | 66 "(" |
66 ")" | 67 ")" |
67 "I", reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeInit) }, | 68 "I", reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeInit) }, |
68 }; | 69 }; |
69 | 70 |
70 static bool RegisterNativesImpl(JNIEnv* env) { | 71 static bool RegisterNativesImpl(JNIEnv* env) { |
71 if (base::android::IsManualJniRegistrationDisabled()) return true; | 72 if (base::android::IsManualJniRegistrationDisabled()) return true; |
| 73 if (base::android::IsMultidexEnabled(env) && |
| 74 base::android::GetLibraryProcessType(env) != |
| 75 base::android::PROCESS_BROWSER) { |
| 76 return true; |
| 77 } |
72 | 78 |
73 const int kMethodsMyOtherInnerClassSize = | 79 const int kMethodsMyOtherInnerClassSize = |
74 arraysize(kMethodsMyOtherInnerClass); | 80 arraysize(kMethodsMyOtherInnerClass); |
75 | 81 |
76 if (env->RegisterNatives(MyOtherInnerClass_clazz(env), | 82 if (env->RegisterNatives(MyOtherInnerClass_clazz(env), |
77 kMethodsMyOtherInnerClass, | 83 kMethodsMyOtherInnerClass, |
78 kMethodsMyOtherInnerClassSize) < 0) { | 84 kMethodsMyOtherInnerClassSize) < 0) { |
79 jni_generator::HandleRegistrationError( | 85 jni_generator::HandleRegistrationError( |
80 env, MyOtherInnerClass_clazz(env), __FILE__); | 86 env, MyOtherInnerClass_clazz(env), __FILE__); |
81 return false; | 87 return false; |
82 } | 88 } |
83 | 89 |
84 const int kMethodsTestJniSize = arraysize(kMethodsTestJni); | 90 const int kMethodsTestJniSize = arraysize(kMethodsTestJni); |
85 | 91 |
86 if (env->RegisterNatives(TestJni_clazz(env), | 92 if (env->RegisterNatives(TestJni_clazz(env), |
87 kMethodsTestJni, | 93 kMethodsTestJni, |
88 kMethodsTestJniSize) < 0) { | 94 kMethodsTestJniSize) < 0) { |
89 jni_generator::HandleRegistrationError( | 95 jni_generator::HandleRegistrationError( |
90 env, TestJni_clazz(env), __FILE__); | 96 env, TestJni_clazz(env), __FILE__); |
91 return false; | 97 return false; |
92 } | 98 } |
93 | 99 |
94 return true; | 100 return true; |
95 } | 101 } |
96 | 102 |
97 #endif // org_chromium_TestJni_JNI | 103 #endif // org_chromium_TestJni_JNI |
OLD | NEW |