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

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

Issue 1312153003: jni_generator: Pass object parameters as JavaParamRef. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 3 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, jcaller, arg1); 39 return native->StaticMethod(env, JavaParamRef<jobject>(env, jcaller), arg1);
40 } 40 }
41 41
42 extern "C" __attribute__((visibility("default"))) 42 extern "C" __attribute__((visibility("default")))
43 jint 43 jint
44 Java_org_chromium_example_jni_1generator_SampleForTests_nativeMethod(JNIEnv* 44 Java_org_chromium_example_jni_1generator_SampleForTests_nativeMethod(JNIEnv*
45 env, 45 env,
46 jobject jcaller, 46 jobject jcaller,
47 jlong nativeTest, 47 jlong nativeTest,
48 jint arg1) { 48 jint arg1) {
49 Test* native = reinterpret_cast<Test*>(nativeTest); 49 Test* native = reinterpret_cast<Test*>(nativeTest);
50 CHECK_NATIVE_PTR(env, jcaller, native, "Method", 0); 50 CHECK_NATIVE_PTR(env, jcaller, native, "Method", 0);
51 return native->Method(env, jcaller, arg1); 51 return native->Method(env, JavaParamRef<jobject>(env, jcaller), arg1);
52 } 52 }
53 53
54 static jint Init(JNIEnv* env, jobject jcaller); 54 static jint Init(JNIEnv* env, const JavaParamRef<jobject>& jcaller);
55 55
56 extern "C" __attribute__((visibility("default"))) 56 extern "C" __attribute__((visibility("default")))
57 jint 57 jint
58 Java_org_chromium_example_jni_1generator_SampleForTests_00024MyInnerClass_na tiveInit(JNIEnv* 58 Java_org_chromium_example_jni_1generator_SampleForTests_00024MyInnerClass_na tiveInit(JNIEnv*
59 env, jobject jcaller) { 59 env, jobject jcaller) {
60 return Init(env, jcaller); 60 return Init(env, JavaParamRef<jobject>(env, jcaller));
61 } 61 }
62 62
63 static jint Init(JNIEnv* env, jobject jcaller); 63 static jint Init(JNIEnv* env, const JavaParamRef<jobject>& jcaller);
64 64
65 extern "C" __attribute__((visibility("default"))) 65 extern "C" __attribute__((visibility("default")))
66 jint 66 jint
67 Java_org_chromium_example_jni_1generator_SampleForTests_00024MyOtherInnerCla ss_nativeInit(JNIEnv* 67 Java_org_chromium_example_jni_1generator_SampleForTests_00024MyOtherInnerCla ss_nativeInit(JNIEnv*
68 env, jobject jcaller) { 68 env, jobject jcaller) {
69 return Init(env, jcaller); 69 return Init(env, JavaParamRef<jobject>(env, jcaller));
70 } 70 }
71 71
72 static base::subtle::AtomicWord g_SampleForTests_testMethodWithParam = 0; 72 static base::subtle::AtomicWord g_SampleForTests_testMethodWithParam = 0;
73 static void Java_SampleForTests_testMethodWithParam(JNIEnv* env, jobject obj, 73 static void Java_SampleForTests_testMethodWithParam(JNIEnv* env, jobject obj,
74 JniIntWrapper iParam) { 74 JniIntWrapper iParam) {
75 /* Must call RegisterNativesImpl() */ 75 /* Must call RegisterNativesImpl() */
76 CHECK_CLAZZ(env, obj, 76 CHECK_CLAZZ(env, obj,
77 SampleForTests_clazz(env)); 77 SampleForTests_clazz(env));
78 jmethodID method_id = 78 jmethodID method_id =
79 base::android::MethodID::LazyGet< 79 base::android::MethodID::LazyGet<
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
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

Powered by Google App Engine
This is Rietveld 408576698