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

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

Issue 2213963002: Stop relying on using statements in the JNI generator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/example/jni_generator/SampleForTests 8 // org/chromium/example/jni_generator/SampleForTests
9 9
10 #ifndef org_chromium_example_jni_generator_SampleForTests_JNI 10 #ifndef org_chromium_example_jni_generator_SampleForTests_JNI
(...skipping 18 matching lines...) Expand all
29 // Step 2: method stubs. 29 // Step 2: method stubs.
30 extern "C" __attribute__((visibility("default"))) 30 extern "C" __attribute__((visibility("default")))
31 jint 31 jint
32 Java_org_chromium_example_jni_1generator_SampleForTests_nativeStaticMethod(J NIEnv* 32 Java_org_chromium_example_jni_1generator_SampleForTests_nativeStaticMethod(J NIEnv*
33 env, 33 env,
34 jobject jcaller, 34 jobject jcaller,
35 jlong nativeTest, 35 jlong nativeTest,
36 jint arg1) { 36 jint arg1) {
37 Test* native = reinterpret_cast<Test*>(nativeTest); 37 Test* native = reinterpret_cast<Test*>(nativeTest);
38 CHECK_NATIVE_PTR(env, jcaller, native, "StaticMethod", 0); 38 CHECK_NATIVE_PTR(env, jcaller, native, "StaticMethod", 0);
39 return native->StaticMethod(env, JavaParamRef<jobject>(env, jcaller), arg1); 39 return native->StaticMethod(env, base::android::JavaParamRef<jobject>(env,
40 jcaller), arg1);
40 } 41 }
41 42
42 extern "C" __attribute__((visibility("default"))) 43 extern "C" __attribute__((visibility("default")))
43 jint 44 jint
44 Java_org_chromium_example_jni_1generator_SampleForTests_nativeMethod(JNIEnv* 45 Java_org_chromium_example_jni_1generator_SampleForTests_nativeMethod(JNIEnv*
45 env, 46 env,
46 jobject jcaller, 47 jobject jcaller,
47 jlong nativeTest, 48 jlong nativeTest,
48 jint arg1) { 49 jint arg1) {
49 Test* native = reinterpret_cast<Test*>(nativeTest); 50 Test* native = reinterpret_cast<Test*>(nativeTest);
50 CHECK_NATIVE_PTR(env, jcaller, native, "Method", 0); 51 CHECK_NATIVE_PTR(env, jcaller, native, "Method", 0);
51 return native->Method(env, JavaParamRef<jobject>(env, jcaller), arg1); 52 return native->Method(env, base::android::JavaParamRef<jobject>(env, jcaller),
53 arg1);
52 } 54 }
53 55
54 static jint Init(JNIEnv* env, const JavaParamRef<jobject>& jcaller); 56 static jint Init(JNIEnv* env, const base::android::JavaParamRef<jobject>&
57 jcaller);
55 58
56 extern "C" __attribute__((visibility("default"))) 59 extern "C" __attribute__((visibility("default")))
57 jint 60 jint
58 Java_org_chromium_example_jni_1generator_SampleForTests_00024MyInnerClass_na tiveInit(JNIEnv* 61 Java_org_chromium_example_jni_1generator_SampleForTests_00024MyInnerClass_na tiveInit(JNIEnv*
59 env, jobject jcaller) { 62 env, jobject jcaller) {
60 return Init(env, JavaParamRef<jobject>(env, jcaller)); 63 return Init(env, base::android::JavaParamRef<jobject>(env, jcaller));
61 } 64 }
62 65
63 static jint Init(JNIEnv* env, const JavaParamRef<jobject>& jcaller); 66 static jint Init(JNIEnv* env, const base::android::JavaParamRef<jobject>&
67 jcaller);
64 68
65 extern "C" __attribute__((visibility("default"))) 69 extern "C" __attribute__((visibility("default")))
66 jint 70 jint
67 Java_org_chromium_example_jni_1generator_SampleForTests_00024MyOtherInnerCla ss_nativeInit(JNIEnv* 71 Java_org_chromium_example_jni_1generator_SampleForTests_00024MyOtherInnerCla ss_nativeInit(JNIEnv*
68 env, jobject jcaller) { 72 env, jobject jcaller) {
69 return Init(env, JavaParamRef<jobject>(env, jcaller)); 73 return Init(env, base::android::JavaParamRef<jobject>(env, jcaller));
70 } 74 }
71 75
72 static base::subtle::AtomicWord g_SampleForTests_testMethodWithParam = 0; 76 static base::subtle::AtomicWord g_SampleForTests_testMethodWithParam = 0;
73 static void Java_SampleForTests_testMethodWithParam(JNIEnv* env, jobject obj, 77 static void Java_SampleForTests_testMethodWithParam(JNIEnv* env, jobject obj,
74 JniIntWrapper iParam) { 78 JniIntWrapper iParam) {
75 CHECK_CLAZZ(env, obj, 79 CHECK_CLAZZ(env, obj,
76 SampleForTests_clazz(env)); 80 SampleForTests_clazz(env));
77 jmethodID method_id = 81 jmethodID method_id =
78 base::android::MethodID::LazyGet< 82 base::android::MethodID::LazyGet<
79 base::android::MethodID::TYPE_INSTANCE>( 83 base::android::MethodID::TYPE_INSTANCE>(
80 env, SampleForTests_clazz(env), 84 env, SampleForTests_clazz(env),
81 "testMethodWithParam", 85 "testMethodWithParam",
82 86
83 "(" 87 "("
84 "I" 88 "I"
85 ")" 89 ")"
86 "V", 90 "V",
87 &g_SampleForTests_testMethodWithParam); 91 &g_SampleForTests_testMethodWithParam);
88 92
89 env->CallVoidMethod(obj, 93 env->CallVoidMethod(obj,
90 method_id, as_jint(iParam)); 94 method_id, as_jint(iParam));
91 jni_generator::CheckException(env); 95 jni_generator::CheckException(env);
92 96
93 } 97 }
94 98
95 static base::subtle::AtomicWord g_SampleForTests_testMethodWithParamAndReturn = 99 static base::subtle::AtomicWord g_SampleForTests_testMethodWithParamAndReturn =
96 0; 100 0;
97 static ScopedJavaLocalRef<jstring> 101 static base::android::ScopedJavaLocalRef<jstring>
98 Java_SampleForTests_testMethodWithParamAndReturn(JNIEnv* env, jobject obj, 102 Java_SampleForTests_testMethodWithParamAndReturn(JNIEnv* env, jobject obj,
99 JniIntWrapper iParam) { 103 JniIntWrapper iParam) {
100 CHECK_CLAZZ(env, obj, 104 CHECK_CLAZZ(env, obj,
101 SampleForTests_clazz(env), NULL); 105 SampleForTests_clazz(env), NULL);
102 jmethodID method_id = 106 jmethodID method_id =
103 base::android::MethodID::LazyGet< 107 base::android::MethodID::LazyGet<
104 base::android::MethodID::TYPE_INSTANCE>( 108 base::android::MethodID::TYPE_INSTANCE>(
105 env, SampleForTests_clazz(env), 109 env, SampleForTests_clazz(env),
106 "testMethodWithParamAndReturn", 110 "testMethodWithParamAndReturn",
107 111
108 "(" 112 "("
109 "I" 113 "I"
110 ")" 114 ")"
111 "Ljava/lang/String;", 115 "Ljava/lang/String;",
112 &g_SampleForTests_testMethodWithParamAndReturn); 116 &g_SampleForTests_testMethodWithParamAndReturn);
113 117
114 jstring ret = 118 jstring ret =
115 static_cast<jstring>(env->CallObjectMethod(obj, 119 static_cast<jstring>(env->CallObjectMethod(obj,
116 method_id, as_jint(iParam))); 120 method_id, as_jint(iParam)));
117 jni_generator::CheckException(env); 121 jni_generator::CheckException(env);
118 return ScopedJavaLocalRef<jstring>(env, ret); 122 return base::android::ScopedJavaLocalRef<jstring>(env, ret);
119 } 123 }
120 124
121 static base::subtle::AtomicWord g_SampleForTests_testStaticMethodWithParam = 0; 125 static base::subtle::AtomicWord g_SampleForTests_testStaticMethodWithParam = 0;
122 static jint Java_SampleForTests_testStaticMethodWithParam(JNIEnv* env, 126 static jint Java_SampleForTests_testStaticMethodWithParam(JNIEnv* env,
123 JniIntWrapper iParam) { 127 JniIntWrapper iParam) {
124 CHECK_CLAZZ(env, SampleForTests_clazz(env), 128 CHECK_CLAZZ(env, SampleForTests_clazz(env),
125 SampleForTests_clazz(env), 0); 129 SampleForTests_clazz(env), 0);
126 jmethodID method_id = 130 jmethodID method_id =
127 base::android::MethodID::LazyGet< 131 base::android::MethodID::LazyGet<
128 base::android::MethodID::TYPE_STATIC>( 132 base::android::MethodID::TYPE_STATIC>(
(...skipping 30 matching lines...) Expand all
159 163
160 jdouble ret = 164 jdouble ret =
161 env->CallStaticDoubleMethod(SampleForTests_clazz(env), 165 env->CallStaticDoubleMethod(SampleForTests_clazz(env),
162 method_id); 166 method_id);
163 jni_generator::CheckException(env); 167 jni_generator::CheckException(env);
164 return ret; 168 return ret;
165 } 169 }
166 170
167 static base::subtle::AtomicWord g_SampleForTests_testStaticMethodWithNoParam = 171 static base::subtle::AtomicWord g_SampleForTests_testStaticMethodWithNoParam =
168 0; 172 0;
169 static ScopedJavaLocalRef<jstring> 173 static base::android::ScopedJavaLocalRef<jstring>
170 Java_SampleForTests_testStaticMethodWithNoParam(JNIEnv* env) { 174 Java_SampleForTests_testStaticMethodWithNoParam(JNIEnv* env) {
171 CHECK_CLAZZ(env, SampleForTests_clazz(env), 175 CHECK_CLAZZ(env, SampleForTests_clazz(env),
172 SampleForTests_clazz(env), NULL); 176 SampleForTests_clazz(env), NULL);
173 jmethodID method_id = 177 jmethodID method_id =
174 base::android::MethodID::LazyGet< 178 base::android::MethodID::LazyGet<
175 base::android::MethodID::TYPE_STATIC>( 179 base::android::MethodID::TYPE_STATIC>(
176 env, SampleForTests_clazz(env), 180 env, SampleForTests_clazz(env),
177 "testStaticMethodWithNoParam", 181 "testStaticMethodWithNoParam",
178 182
179 "(" 183 "("
180 ")" 184 ")"
181 "Ljava/lang/String;", 185 "Ljava/lang/String;",
182 &g_SampleForTests_testStaticMethodWithNoParam); 186 &g_SampleForTests_testStaticMethodWithNoParam);
183 187
184 jstring ret = 188 jstring ret =
185 static_cast<jstring>(env->CallStaticObjectMethod(SampleForTests_clazz(env), 189 static_cast<jstring>(env->CallStaticObjectMethod(SampleForTests_clazz(env),
186 method_id)); 190 method_id));
187 jni_generator::CheckException(env); 191 jni_generator::CheckException(env);
188 return ScopedJavaLocalRef<jstring>(env, ret); 192 return base::android::ScopedJavaLocalRef<jstring>(env, ret);
189 } 193 }
190 194
191 // Step 3: RegisterNatives. 195 // Step 3: RegisterNatives.
192 196
193 #endif // org_chromium_example_jni_generator_SampleForTests_JNI 197 #endif // org_chromium_example_jni_generator_SampleForTests_JNI
OLDNEW
« no previous file with comments | « base/android/jni_generator/testMultipleJNIAdditionalImport.golden ('k') | base/android/jni_generator/testNatives.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698