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/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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 static base::subtle::AtomicWord g_SampleForTests_testMethodWithParam = 0; | 76 static base::subtle::AtomicWord g_SampleForTests_testMethodWithParam = 0; |
77 static void Java_SampleForTests_testMethodWithParam(JNIEnv* env, const | 77 static void Java_SampleForTests_testMethodWithParam(JNIEnv* env, const |
78 base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper iParam) { | 78 base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper iParam) { |
79 CHECK_CLAZZ(env, obj.obj(), | 79 CHECK_CLAZZ(env, obj.obj(), |
80 SampleForTests_clazz(env)); | 80 SampleForTests_clazz(env)); |
81 jmethodID method_id = | 81 jmethodID method_id = |
82 base::android::MethodID::LazyGet< | 82 base::android::MethodID::LazyGet< |
83 base::android::MethodID::TYPE_INSTANCE>( | 83 base::android::MethodID::TYPE_INSTANCE>( |
84 env, SampleForTests_clazz(env), | 84 env, SampleForTests_clazz(env), |
85 "testMethodWithParam", | 85 "testMethodWithParam", |
86 | |
87 "(" | 86 "(" |
88 "I" | 87 "I" |
89 ")" | 88 ")" |
90 "V", | 89 "V", |
91 &g_SampleForTests_testMethodWithParam); | 90 &g_SampleForTests_testMethodWithParam); |
92 | 91 |
93 env->CallVoidMethod(obj.obj(), | 92 env->CallVoidMethod(obj.obj(), |
94 method_id, as_jint(iParam)); | 93 method_id, as_jint(iParam)); |
95 jni_generator::CheckException(env); | 94 jni_generator::CheckException(env); |
96 | |
97 } | 95 } |
98 | 96 |
99 static base::subtle::AtomicWord g_SampleForTests_testMethodWithParamAndReturn = | 97 static base::subtle::AtomicWord g_SampleForTests_testMethodWithParamAndReturn = |
100 0; | 98 0; |
101 static base::android::ScopedJavaLocalRef<jstring> | 99 static base::android::ScopedJavaLocalRef<jstring> |
102 Java_SampleForTests_testMethodWithParamAndReturn(JNIEnv* env, const | 100 Java_SampleForTests_testMethodWithParamAndReturn(JNIEnv* env, const |
103 base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper iParam) { | 101 base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper iParam) { |
104 CHECK_CLAZZ(env, obj.obj(), | 102 CHECK_CLAZZ(env, obj.obj(), |
105 SampleForTests_clazz(env), NULL); | 103 SampleForTests_clazz(env), NULL); |
106 jmethodID method_id = | 104 jmethodID method_id = |
107 base::android::MethodID::LazyGet< | 105 base::android::MethodID::LazyGet< |
108 base::android::MethodID::TYPE_INSTANCE>( | 106 base::android::MethodID::TYPE_INSTANCE>( |
109 env, SampleForTests_clazz(env), | 107 env, SampleForTests_clazz(env), |
110 "testMethodWithParamAndReturn", | 108 "testMethodWithParamAndReturn", |
111 | |
112 "(" | 109 "(" |
113 "I" | 110 "I" |
114 ")" | 111 ")" |
115 "Ljava/lang/String;", | 112 "Ljava/lang/String;", |
116 &g_SampleForTests_testMethodWithParamAndReturn); | 113 &g_SampleForTests_testMethodWithParamAndReturn); |
117 | 114 |
118 jstring ret = | 115 jstring ret = |
119 static_cast<jstring>(env->CallObjectMethod(obj.obj(), | 116 static_cast<jstring>(env->CallObjectMethod(obj.obj(), |
120 method_id, as_jint(iParam))); | 117 method_id, as_jint(iParam))); |
121 jni_generator::CheckException(env); | 118 jni_generator::CheckException(env); |
122 return base::android::ScopedJavaLocalRef<jstring>(env, ret); | 119 return base::android::ScopedJavaLocalRef<jstring>(env, ret); |
123 } | 120 } |
124 | 121 |
125 static base::subtle::AtomicWord g_SampleForTests_testStaticMethodWithParam = 0; | 122 static base::subtle::AtomicWord g_SampleForTests_testStaticMethodWithParam = 0; |
126 static jint Java_SampleForTests_testStaticMethodWithParam(JNIEnv* env, | 123 static jint Java_SampleForTests_testStaticMethodWithParam(JNIEnv* env, |
127 JniIntWrapper iParam) { | 124 JniIntWrapper iParam) { |
128 CHECK_CLAZZ(env, SampleForTests_clazz(env), | 125 CHECK_CLAZZ(env, SampleForTests_clazz(env), |
129 SampleForTests_clazz(env), 0); | 126 SampleForTests_clazz(env), 0); |
130 jmethodID method_id = | 127 jmethodID method_id = |
131 base::android::MethodID::LazyGet< | 128 base::android::MethodID::LazyGet< |
132 base::android::MethodID::TYPE_STATIC>( | 129 base::android::MethodID::TYPE_STATIC>( |
133 env, SampleForTests_clazz(env), | 130 env, SampleForTests_clazz(env), |
134 "testStaticMethodWithParam", | 131 "testStaticMethodWithParam", |
135 | |
136 "(" | 132 "(" |
137 "I" | 133 "I" |
138 ")" | 134 ")" |
139 "I", | 135 "I", |
140 &g_SampleForTests_testStaticMethodWithParam); | 136 &g_SampleForTests_testStaticMethodWithParam); |
141 | 137 |
142 jint ret = | 138 jint ret = |
143 env->CallStaticIntMethod(SampleForTests_clazz(env), | 139 env->CallStaticIntMethod(SampleForTests_clazz(env), |
144 method_id, as_jint(iParam)); | 140 method_id, as_jint(iParam)); |
145 jni_generator::CheckException(env); | 141 jni_generator::CheckException(env); |
146 return ret; | 142 return ret; |
147 } | 143 } |
148 | 144 |
149 static base::subtle::AtomicWord g_SampleForTests_testMethodWithNoParam = 0; | 145 static base::subtle::AtomicWord g_SampleForTests_testMethodWithNoParam = 0; |
150 static jdouble Java_SampleForTests_testMethodWithNoParam(JNIEnv* env) { | 146 static jdouble Java_SampleForTests_testMethodWithNoParam(JNIEnv* env) { |
151 CHECK_CLAZZ(env, SampleForTests_clazz(env), | 147 CHECK_CLAZZ(env, SampleForTests_clazz(env), |
152 SampleForTests_clazz(env), 0); | 148 SampleForTests_clazz(env), 0); |
153 jmethodID method_id = | 149 jmethodID method_id = |
154 base::android::MethodID::LazyGet< | 150 base::android::MethodID::LazyGet< |
155 base::android::MethodID::TYPE_STATIC>( | 151 base::android::MethodID::TYPE_STATIC>( |
156 env, SampleForTests_clazz(env), | 152 env, SampleForTests_clazz(env), |
157 "testMethodWithNoParam", | 153 "testMethodWithNoParam", |
158 | |
159 "(" | 154 "(" |
160 ")" | 155 ")" |
161 "D", | 156 "D", |
162 &g_SampleForTests_testMethodWithNoParam); | 157 &g_SampleForTests_testMethodWithNoParam); |
163 | 158 |
164 jdouble ret = | 159 jdouble ret = |
165 env->CallStaticDoubleMethod(SampleForTests_clazz(env), | 160 env->CallStaticDoubleMethod(SampleForTests_clazz(env), |
166 method_id); | 161 method_id); |
167 jni_generator::CheckException(env); | 162 jni_generator::CheckException(env); |
168 return ret; | 163 return ret; |
169 } | 164 } |
170 | 165 |
171 static base::subtle::AtomicWord g_SampleForTests_testStaticMethodWithNoParam = | 166 static base::subtle::AtomicWord g_SampleForTests_testStaticMethodWithNoParam = |
172 0; | 167 0; |
173 static base::android::ScopedJavaLocalRef<jstring> | 168 static base::android::ScopedJavaLocalRef<jstring> |
174 Java_SampleForTests_testStaticMethodWithNoParam(JNIEnv* env) { | 169 Java_SampleForTests_testStaticMethodWithNoParam(JNIEnv* env) { |
175 CHECK_CLAZZ(env, SampleForTests_clazz(env), | 170 CHECK_CLAZZ(env, SampleForTests_clazz(env), |
176 SampleForTests_clazz(env), NULL); | 171 SampleForTests_clazz(env), NULL); |
177 jmethodID method_id = | 172 jmethodID method_id = |
178 base::android::MethodID::LazyGet< | 173 base::android::MethodID::LazyGet< |
179 base::android::MethodID::TYPE_STATIC>( | 174 base::android::MethodID::TYPE_STATIC>( |
180 env, SampleForTests_clazz(env), | 175 env, SampleForTests_clazz(env), |
181 "testStaticMethodWithNoParam", | 176 "testStaticMethodWithNoParam", |
182 | |
183 "(" | 177 "(" |
184 ")" | 178 ")" |
185 "Ljava/lang/String;", | 179 "Ljava/lang/String;", |
186 &g_SampleForTests_testStaticMethodWithNoParam); | 180 &g_SampleForTests_testStaticMethodWithNoParam); |
187 | 181 |
188 jstring ret = | 182 jstring ret = |
189 static_cast<jstring>(env->CallStaticObjectMethod(SampleForTests_clazz(env), | 183 static_cast<jstring>(env->CallStaticObjectMethod(SampleForTests_clazz(env), |
190 method_id)); | 184 method_id)); |
191 jni_generator::CheckException(env); | 185 jni_generator::CheckException(env); |
192 return base::android::ScopedJavaLocalRef<jstring>(env, ret); | 186 return base::android::ScopedJavaLocalRef<jstring>(env, ret); |
193 } | 187 } |
194 | 188 |
195 // Step 3: RegisterNatives. | 189 // Step 3: RegisterNatives. |
196 | 190 |
197 #endif // org_chromium_example_jni_generator_SampleForTests_JNI | 191 #endif // org_chromium_example_jni_generator_SampleForTests_JNI |
OLD | NEW |