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 |
(...skipping 10 matching lines...) Expand all Loading... |
21 const char kMyOtherInnerClassClassPath[] = | 21 const char kMyOtherInnerClassClassPath[] = |
22 "org/chromium/TestJni$MyOtherInnerClass"; | 22 "org/chromium/TestJni$MyOtherInnerClass"; |
23 const char kTestJniClassPath[] = "org/chromium/TestJni"; | 23 const char kTestJniClassPath[] = "org/chromium/TestJni"; |
24 const char kMyInnerClassClassPath[] = "org/chromium/TestJni$MyInnerClass"; | 24 const char kMyInnerClassClassPath[] = "org/chromium/TestJni$MyInnerClass"; |
25 // Leaking this jclass as we cannot use LazyInstance from some threads. | 25 // Leaking this jclass as we cannot use LazyInstance from some threads. |
26 jclass g_TestJni_clazz = NULL; | 26 jclass g_TestJni_clazz = NULL; |
27 #define TestJni_clazz(env) g_TestJni_clazz | 27 #define TestJni_clazz(env) g_TestJni_clazz |
28 | 28 |
29 } // namespace | 29 } // namespace |
30 | 30 |
31 static jint Init(JNIEnv* env, jobject jcaller); | 31 // Step 2: method stubs. |
32 | 32 |
33 static jint Init(JNIEnv* env, jobject jcaller); | 33 static jint Init(JNIEnv* env, jobject jcaller); |
34 | 34 |
35 // Step 2: method stubs. | 35 static jint Java_org_chromium_TestJni_00024MyInnerClass_nativeInit(JNIEnv* env, |
| 36 jobject jcaller) { |
| 37 return Init(env, jcaller); |
| 38 } |
| 39 |
| 40 static jint Init(JNIEnv* env, jobject jcaller); |
| 41 |
| 42 static jint Java_org_chromium_TestJni_00024MyOtherInnerClass_nativeInit(JNIEnv* |
| 43 env, jobject jcaller) { |
| 44 return Init(env, jcaller); |
| 45 } |
36 | 46 |
37 // Step 3: RegisterNatives. | 47 // Step 3: RegisterNatives. |
38 | 48 |
39 static const JNINativeMethod kMethodsMyOtherInnerClass[] = { | 49 static const JNINativeMethod kMethodsMyOtherInnerClass[] = { |
40 { "nativeInit", | 50 { "nativeInit", |
41 "(" | 51 "(" |
42 ")" | 52 ")" |
43 "I", reinterpret_cast<void*>(Init) }, | 53 "I", |
| 54 reinterpret_cast<void*>(Java_org_chromium_TestJni_00024MyOtherInnerClass_nat
iveInit) |
| 55 }, |
44 }; | 56 }; |
45 | 57 |
46 static const JNINativeMethod kMethodsMyInnerClass[] = { | 58 static const JNINativeMethod kMethodsMyInnerClass[] = { |
47 { "nativeInit", | 59 { "nativeInit", |
48 "(" | 60 "(" |
49 ")" | 61 ")" |
50 "I", reinterpret_cast<void*>(Init) }, | 62 "I", |
| 63 reinterpret_cast<void*>(Java_org_chromium_TestJni_00024MyInnerClass_nativeIn
it) |
| 64 }, |
51 }; | 65 }; |
52 | 66 |
53 static bool RegisterNativesImpl(JNIEnv* env) { | 67 static bool RegisterNativesImpl(JNIEnv* env) { |
54 | 68 |
55 g_TestJni_clazz = reinterpret_cast<jclass>(env->NewGlobalRef( | 69 g_TestJni_clazz = reinterpret_cast<jclass>(env->NewGlobalRef( |
56 base::android::GetClass(env, kTestJniClassPath).obj())); | 70 base::android::GetClass(env, kTestJniClassPath).obj())); |
57 | 71 |
58 const int kMethodsMyOtherInnerClassSize = | 72 const int kMethodsMyOtherInnerClassSize = |
59 arraysize(kMethodsMyOtherInnerClass); | 73 arraysize(kMethodsMyOtherInnerClass); |
60 | 74 |
(...skipping 12 matching lines...) Expand all Loading... |
73 kMethodsMyInnerClassSize) < 0) { | 87 kMethodsMyInnerClassSize) < 0) { |
74 jni_generator::HandleRegistrationError( | 88 jni_generator::HandleRegistrationError( |
75 env, MyInnerClass_clazz(env), __FILE__); | 89 env, MyInnerClass_clazz(env), __FILE__); |
76 return false; | 90 return false; |
77 } | 91 } |
78 | 92 |
79 return true; | 93 return true; |
80 } | 94 } |
81 | 95 |
82 #endif // org_chromium_TestJni_JNI | 96 #endif // org_chromium_TestJni_JNI |
OLD | NEW |