| Index: base/android/jni_generator/golden_sample_for_tests_jni.h
|
| diff --git a/base/android/jni_generator/golden_sample_for_tests_jni.h b/base/android/jni_generator/golden_sample_for_tests_jni.h
|
| index 974cfffde8a17a4ca08a32f5ef5e8b827bad390e..e982609c7e003c4e7e527e92a9115fb7cacec0c3 100644
|
| --- a/base/android/jni_generator/golden_sample_for_tests_jni.h
|
| +++ b/base/android/jni_generator/golden_sample_for_tests_jni.h
|
| @@ -41,14 +41,15 @@ namespace android {
|
|
|
| // Step 2: method stubs.
|
|
|
| -static jlong Init(JNIEnv* env, jobject jcaller,
|
| - jstring param);
|
| +static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& jcaller,
|
| + const JavaParamRef<jstring>& param);
|
|
|
| static jlong
|
| Java_org_chromium_example_jni_1generator_SampleForTests_nativeInit(JNIEnv*
|
| env, jobject jcaller,
|
| jstring param) {
|
| - return Init(env, jcaller, param);
|
| + return Init(env, JavaParamRef<jobject>(env, jcaller),
|
| + JavaParamRef<jstring>(env, param));
|
| }
|
|
|
| static void
|
| @@ -58,42 +59,45 @@ static void
|
| jlong nativeCPPClass) {
|
| CPPClass* native = reinterpret_cast<CPPClass*>(nativeCPPClass);
|
| CHECK_NATIVE_PTR(env, jcaller, native, "Destroy");
|
| - return native->Destroy(env, jcaller);
|
| + return native->Destroy(env, JavaParamRef<jobject>(env, jcaller));
|
| }
|
|
|
| -static jdouble GetDoubleFunction(JNIEnv* env, jobject jcaller);
|
| +static jdouble GetDoubleFunction(JNIEnv* env, const JavaParamRef<jobject>&
|
| + jcaller);
|
|
|
| static jdouble
|
| Java_org_chromium_example_jni_1generator_SampleForTests_nativeGetDoubleFunction(JNIEnv*
|
| env, jobject jcaller) {
|
| - return GetDoubleFunction(env, jcaller);
|
| + return GetDoubleFunction(env, JavaParamRef<jobject>(env, jcaller));
|
| }
|
|
|
| -static jfloat GetFloatFunction(JNIEnv* env, jclass jcaller);
|
| +static jfloat GetFloatFunction(JNIEnv* env, const JavaParamRef<jclass>&
|
| + jcaller);
|
|
|
| static jfloat
|
| Java_org_chromium_example_jni_1generator_SampleForTests_nativeGetFloatFunction(JNIEnv*
|
| env, jclass jcaller) {
|
| - return GetFloatFunction(env, jcaller);
|
| + return GetFloatFunction(env, JavaParamRef<jclass>(env, jcaller));
|
| }
|
|
|
| -static void SetNonPODDatatype(JNIEnv* env, jobject jcaller,
|
| - jobject rect);
|
| +static void SetNonPODDatatype(JNIEnv* env, const JavaParamRef<jobject>& jcaller,
|
| + const JavaParamRef<jobject>& rect);
|
|
|
| static void
|
| Java_org_chromium_example_jni_1generator_SampleForTests_nativeSetNonPODDatatype(JNIEnv*
|
| env, jobject jcaller,
|
| jobject rect) {
|
| - return SetNonPODDatatype(env, jcaller, rect);
|
| + return SetNonPODDatatype(env, JavaParamRef<jobject>(env, jcaller),
|
| + JavaParamRef<jobject>(env, rect));
|
| }
|
|
|
| -static ScopedJavaLocalRef<jobject> GetNonPODDatatype(JNIEnv* env, jobject
|
| - jcaller);
|
| +static ScopedJavaLocalRef<jobject> GetNonPODDatatype(JNIEnv* env, const
|
| + JavaParamRef<jobject>& jcaller);
|
|
|
| static jobject
|
| Java_org_chromium_example_jni_1generator_SampleForTests_nativeGetNonPODDatatype(JNIEnv*
|
| env, jobject jcaller) {
|
| - return GetNonPODDatatype(env, jcaller).Release();
|
| + return GetNonPODDatatype(env, JavaParamRef<jobject>(env, jcaller)).Release();
|
| }
|
|
|
| static jint
|
| @@ -103,7 +107,7 @@ static jint
|
| jlong nativeCPPClass) {
|
| CPPClass* native = reinterpret_cast<CPPClass*>(nativeCPPClass);
|
| CHECK_NATIVE_PTR(env, jcaller, native, "Method", 0);
|
| - return native->Method(env, jcaller);
|
| + return native->Method(env, JavaParamRef<jobject>(env, jcaller));
|
| }
|
|
|
| static jdouble
|
| @@ -114,7 +118,7 @@ static jdouble
|
| CPPClass::InnerClass* native =
|
| reinterpret_cast<CPPClass::InnerClass*>(nativePtr);
|
| CHECK_NATIVE_PTR(env, jcaller, native, "MethodOtherP0", 0);
|
| - return native->MethodOtherP0(env, jcaller);
|
| + return native->MethodOtherP0(env, JavaParamRef<jobject>(env, jcaller));
|
| }
|
|
|
| static void
|
| @@ -125,7 +129,8 @@ static void
|
| jobject b) {
|
| CPPClass* native = reinterpret_cast<CPPClass*>(nativeCPPClass);
|
| CHECK_NATIVE_PTR(env, jcaller, native, "AddStructB");
|
| - return native->AddStructB(env, jcaller, b);
|
| + return native->AddStructB(env, JavaParamRef<jobject>(env, jcaller),
|
| + JavaParamRef<jobject>(env, b));
|
| }
|
|
|
| static void
|
| @@ -135,7 +140,8 @@ static void
|
| jlong nativeCPPClass) {
|
| CPPClass* native = reinterpret_cast<CPPClass*>(nativeCPPClass);
|
| CHECK_NATIVE_PTR(env, jcaller, native, "IterateAndDoSomethingWithStructB");
|
| - return native->IterateAndDoSomethingWithStructB(env, jcaller);
|
| + return native->IterateAndDoSomethingWithStructB(env,
|
| + JavaParamRef<jobject>(env, jcaller));
|
| }
|
|
|
| static jstring
|
| @@ -145,7 +151,8 @@ static jstring
|
| jlong nativeCPPClass) {
|
| CPPClass* native = reinterpret_cast<CPPClass*>(nativeCPPClass);
|
| CHECK_NATIVE_PTR(env, jcaller, native, "ReturnAString", NULL);
|
| - return native->ReturnAString(env, jcaller).Release();
|
| + return native->ReturnAString(env, JavaParamRef<jobject>(env,
|
| + jcaller)).Release();
|
| }
|
|
|
| static base::subtle::AtomicWord g_SampleForTests_javaMethod = 0;
|
|
|