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

Side by Side Diff: android/jni_generator/testNativeExportsOption.golden

Issue 2045303002: Update to Chromium //base at Chromium commit 3e81715e6d3a4324362635aea46ce1f1a163cca1. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/domokit/base@master
Patch Set: Created 4 years, 6 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 &g_SampleForTests_testMethodWithParam); 88 &g_SampleForTests_testMethodWithParam);
89 89
90 env->CallVoidMethod(obj, 90 env->CallVoidMethod(obj,
91 method_id, as_jint(iParam)); 91 method_id, as_jint(iParam));
92 jni_generator::CheckException(env); 92 jni_generator::CheckException(env);
93 93
94 } 94 }
95 95
96 static base::subtle::AtomicWord g_SampleForTests_testMethodWithParamAndReturn = 96 static base::subtle::AtomicWord g_SampleForTests_testMethodWithParamAndReturn =
97 0; 97 0;
98 static base::android::ScopedJavaLocalRef<jstring> 98 static ScopedJavaLocalRef<jstring>
99 Java_SampleForTests_testMethodWithParamAndReturn(JNIEnv* env, jobject obj, 99 Java_SampleForTests_testMethodWithParamAndReturn(JNIEnv* env, jobject obj,
100 JniIntWrapper iParam) { 100 JniIntWrapper iParam) {
101 /* Must call RegisterNativesImpl() */ 101 /* Must call RegisterNativesImpl() */
102 CHECK_CLAZZ(env, obj, 102 CHECK_CLAZZ(env, obj,
103 SampleForTests_clazz(env), NULL); 103 SampleForTests_clazz(env), NULL);
104 jmethodID method_id = 104 jmethodID method_id =
105 base::android::MethodID::LazyGet< 105 base::android::MethodID::LazyGet<
106 base::android::MethodID::TYPE_INSTANCE>( 106 base::android::MethodID::TYPE_INSTANCE>(
107 env, SampleForTests_clazz(env), 107 env, SampleForTests_clazz(env),
108 "testMethodWithParamAndReturn", 108 "testMethodWithParamAndReturn",
109 109
110 "(" 110 "("
111 "I" 111 "I"
112 ")" 112 ")"
113 "Ljava/lang/String;", 113 "Ljava/lang/String;",
114 &g_SampleForTests_testMethodWithParamAndReturn); 114 &g_SampleForTests_testMethodWithParamAndReturn);
115 115
116 jstring ret = 116 jstring ret =
117 static_cast<jstring>(env->CallObjectMethod(obj, 117 static_cast<jstring>(env->CallObjectMethod(obj,
118 method_id, as_jint(iParam))); 118 method_id, as_jint(iParam)));
119 jni_generator::CheckException(env); 119 jni_generator::CheckException(env);
120 return base::android::ScopedJavaLocalRef<jstring>(env, ret); 120 return ScopedJavaLocalRef<jstring>(env, ret);
121 } 121 }
122 122
123 static base::subtle::AtomicWord g_SampleForTests_testStaticMethodWithParam = 0; 123 static base::subtle::AtomicWord g_SampleForTests_testStaticMethodWithParam = 0;
124 static jint Java_SampleForTests_testStaticMethodWithParam(JNIEnv* env, 124 static jint Java_SampleForTests_testStaticMethodWithParam(JNIEnv* env,
125 JniIntWrapper iParam) { 125 JniIntWrapper iParam) {
126 /* Must call RegisterNativesImpl() */ 126 /* Must call RegisterNativesImpl() */
127 CHECK_CLAZZ(env, SampleForTests_clazz(env), 127 CHECK_CLAZZ(env, SampleForTests_clazz(env),
128 SampleForTests_clazz(env), 0); 128 SampleForTests_clazz(env), 0);
129 jmethodID method_id = 129 jmethodID method_id =
130 base::android::MethodID::LazyGet< 130 base::android::MethodID::LazyGet<
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 163
164 jdouble ret = 164 jdouble ret =
165 env->CallStaticDoubleMethod(SampleForTests_clazz(env), 165 env->CallStaticDoubleMethod(SampleForTests_clazz(env),
166 method_id); 166 method_id);
167 jni_generator::CheckException(env); 167 jni_generator::CheckException(env);
168 return ret; 168 return ret;
169 } 169 }
170 170
171 static base::subtle::AtomicWord g_SampleForTests_testStaticMethodWithNoParam = 171 static base::subtle::AtomicWord g_SampleForTests_testStaticMethodWithNoParam =
172 0; 172 0;
173 static base::android::ScopedJavaLocalRef<jstring> 173 static ScopedJavaLocalRef<jstring>
174 Java_SampleForTests_testStaticMethodWithNoParam(JNIEnv* env) { 174 Java_SampleForTests_testStaticMethodWithNoParam(JNIEnv* env) {
175 /* Must call RegisterNativesImpl() */ 175 /* Must call RegisterNativesImpl() */
176 CHECK_CLAZZ(env, SampleForTests_clazz(env), 176 CHECK_CLAZZ(env, SampleForTests_clazz(env),
177 SampleForTests_clazz(env), NULL); 177 SampleForTests_clazz(env), NULL);
178 jmethodID method_id = 178 jmethodID method_id =
179 base::android::MethodID::LazyGet< 179 base::android::MethodID::LazyGet<
180 base::android::MethodID::TYPE_STATIC>( 180 base::android::MethodID::TYPE_STATIC>(
181 env, SampleForTests_clazz(env), 181 env, SampleForTests_clazz(env),
182 "testStaticMethodWithNoParam", 182 "testStaticMethodWithNoParam",
183 183
184 "(" 184 "("
185 ")" 185 ")"
186 "Ljava/lang/String;", 186 "Ljava/lang/String;",
187 &g_SampleForTests_testStaticMethodWithNoParam); 187 &g_SampleForTests_testStaticMethodWithNoParam);
188 188
189 jstring ret = 189 jstring ret =
190 static_cast<jstring>(env->CallStaticObjectMethod(SampleForTests_clazz(env), 190 static_cast<jstring>(env->CallStaticObjectMethod(SampleForTests_clazz(env),
191 method_id)); 191 method_id));
192 jni_generator::CheckException(env); 192 jni_generator::CheckException(env);
193 return base::android::ScopedJavaLocalRef<jstring>(env, ret); 193 return ScopedJavaLocalRef<jstring>(env, ret);
194 } 194 }
195 195
196 // Step 3: RegisterNatives. 196 // Step 3: RegisterNatives.
197 197
198 static bool RegisterNativesImpl(JNIEnv* env, jclass clazz) { 198 static bool RegisterNativesImpl(JNIEnv* env, jclass clazz) {
199 199
200 base::subtle::Release_Store(&g_SampleForTests_clazz, 200 base::subtle::Release_Store(&g_SampleForTests_clazz,
201 static_cast<base::subtle::AtomicWord>(env->NewWeakGlobalRef(clazz)); 201 static_cast<base::subtle::AtomicWord>(env->NewWeakGlobalRef(clazz));
202 202
203 return true; 203 return true;
204 } 204 }
205 205
206 extern "C" JNIEXPORT bool JNICALL 206 extern "C" JNIEXPORT bool JNICALL
207 Java_org_chromium_example_jni_1generator_SampleForTests_nativeInitNativeClass(JN IEnv* 207 Java_org_chromium_example_jni_1generator_SampleForTests_nativeInitNativeClass(JN IEnv*
208 env, jclass clazz) { 208 env, jclass clazz) {
209 return RegisterNativesImpl(env, clazz); 209 return RegisterNativesImpl(env, clazz);
210 } 210 }
211 211
212 #endif // org_chromium_example_jni_generator_SampleForTests_JNI 212 #endif // org_chromium_example_jni_generator_SampleForTests_JNI
OLDNEW
« no previous file with comments | « android/jni_generator/testFromJavaP.golden ('k') | android/jni_generator/testNativeExportsOptionalOption.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698