Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(255)

Side by Side Diff: base/android/jni_generator/testInnerClassNativesMultiple.golden

Issue 1279163006: jni_generator: Wrap all native methods in stubs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove separate forward declaration section entirely Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698