| Index: base/android/jni_generator/testEagerCalledByNativesOption.golden
|
| diff --git a/base/android/jni_generator/testEagerCalledByNativesOption.golden b/base/android/jni_generator/testEagerCalledByNativesOption.golden
|
| index f57abeef50e2df987260b3d0aced6b1d6e1640ec..f2f685746897b65a80634a5f817ea3b8ac98c061 100644
|
| --- a/base/android/jni_generator/testEagerCalledByNativesOption.golden
|
| +++ b/base/android/jni_generator/testEagerCalledByNativesOption.golden
|
| @@ -1,4 +1,4 @@
|
| -// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| @@ -25,6 +25,8 @@ jmethodID g_Test_testMethodWithNoParam = NULL;
|
| jmethodID g_Test_testStaticMethodWithNoParam = NULL;
|
| } // namespace
|
|
|
| +extern "C"{
|
| +
|
| // Step 2: method stubs.
|
| static jint Method(JNIEnv* env, jobject jcaller,
|
| jlong nativeTest,
|
| @@ -33,6 +35,11 @@ static jint Method(JNIEnv* env, jobject jcaller,
|
| CHECK_NATIVE_PTR(env, jcaller, native, "Method", 0);
|
| return native->Method(env, jcaller, arg1);
|
| }
|
| +__attribute__((alias("Method"), visibility("default")))
|
| + jint Java_org_chromium_example_jni_1generator_Test_nativeMethod(JNIEnv* env,
|
| + jobject jcaller,
|
| + jlong nativeTest,
|
| + jint arg1);
|
|
|
| namespace {
|
|
|
| @@ -61,31 +68,11 @@ static base::android::ScopedJavaLocalRef<jstring>
|
| return base::android::ScopedJavaLocalRef<jstring>(env, ret);
|
| }
|
| } // namespace
|
| -
|
| -// Step 3: RegisterNatives.
|
| -
|
| -static const JNINativeMethod kMethodsTest[] = {
|
| - { "nativeMethod",
|
| -"("
|
| -"J"
|
| -"I"
|
| -")"
|
| -"I", reinterpret_cast<void*>(Method) },
|
| };
|
|
|
| +// Step 3: RegisterNatives.
|
| static bool RegisterNativesImpl(JNIEnv* env, jclass clazz) {
|
| g_Test_clazz = static_cast<jclass>(env->NewWeakGlobalRef(clazz));
|
| -
|
| - const int kMethodsTestSize = arraysize(kMethodsTest);
|
| -
|
| - if (env->RegisterNatives(g_Test_clazz,
|
| - kMethodsTest,
|
| - kMethodsTestSize) < 0) {
|
| - jni_generator::HandleRegistrationError(
|
| - env, g_Test_clazz, __FILE__);
|
| - return false;
|
| - }
|
| -
|
| g_Test_testMethodWithParam = env->GetMethodID(
|
| g_Test_clazz,
|
| "testMethodWithParam",
|
| @@ -131,10 +118,4 @@ static bool RegisterNativesImpl(JNIEnv* env, jclass clazz) {
|
| return true;
|
| }
|
|
|
| -extern "C" JNIEXPORT bool JNICALL
|
| -Java_org_chromium_example_jni_generator_Test_nativeInitNativeClass(JNIEnv* env,
|
| - jclass clazz) {
|
| - return RegisterNativesImpl(env, clazz);
|
| -}
|
| -
|
| #endif // org_chromium_example_jni_generator_Test_JNI
|
|
|