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

Unified Diff: base/android/jni_generator/testNativeExportsOptionalOption.golden

Issue 2162923002: jni_generator: Always generate native exports. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: base/android/jni_generator/testNativeExportsOptionalOption.golden
diff --git a/base/android/jni_generator/testNativeExportsOptionalOption.golden b/base/android/jni_generator/testNativeExportsOptionalOption.golden
deleted file mode 100644
index 6a4c1426253f571c40a7bb989bb73a3f2397e96e..0000000000000000000000000000000000000000
--- a/base/android/jni_generator/testNativeExportsOptionalOption.golden
+++ /dev/null
@@ -1,282 +0,0 @@
-// Copyright 2014 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.
-
-// This file is autogenerated by
-// base/android/jni_generator/jni_generator.py
-// For
-// org/chromium/example/jni_generator/SampleForTests
-
-#ifndef org_chromium_example_jni_generator_SampleForTests_JNI
-#define org_chromium_example_jni_generator_SampleForTests_JNI
-
-#include <jni.h>
-
-#include "base/android/jni_generator/jni_generator_helper.h"
-
-#include "base/android/jni_int_wrapper.h"
-
-// Step 1: forward declarations.
-namespace {
-const char kMyOtherInnerClassClassPath[] =
- "org/chromium/example/jni_generator/SampleForTests$MyOtherInnerClass";
-const char kMyInnerClassClassPath[] =
- "org/chromium/example/jni_generator/SampleForTests$MyInnerClass";
-const char kSampleForTestsClassPath[] =
- "org/chromium/example/jni_generator/SampleForTests";
-// Leaking this jclass as we cannot use LazyInstance from some threads.
-base::subtle::AtomicWord g_MyOtherInnerClass_clazz __attribute__((unused)) = 0;
-#define MyOtherInnerClass_clazz(env) base::android::LazyGetClass(env, kMyOtherInnerClassClassPath, &g_MyOtherInnerClass_clazz)
-// Leaking this jclass as we cannot use LazyInstance from some threads.
-base::subtle::AtomicWord g_MyInnerClass_clazz __attribute__((unused)) = 0;
-#define MyInnerClass_clazz(env) base::android::LazyGetClass(env, kMyInnerClassClassPath, &g_MyInnerClass_clazz)
-// Leaking this jclass as we cannot use LazyInstance from some threads.
-base::subtle::AtomicWord g_SampleForTests_clazz __attribute__((unused)) = 0;
-#define SampleForTests_clazz(env) base::android::LazyGetClass(env, kSampleForTestsClassPath, &g_SampleForTests_clazz)
-
-} // namespace
-
-// Step 2: method stubs.
-extern "C" __attribute__((visibility("default")))
-jint
- Java_org_chromium_example_jni_1generator_SampleForTests_nativeStaticMethod(JNIEnv*
- env,
- jobject jcaller,
- jlong nativeTest,
- jint arg1) {
- Test* native = reinterpret_cast<Test*>(nativeTest);
- CHECK_NATIVE_PTR(env, jcaller, native, "StaticMethod", 0);
- return native->StaticMethod(env, JavaParamRef<jobject>(env, jcaller), arg1);
-}
-
-extern "C" __attribute__((visibility("default")))
-jint
- Java_org_chromium_example_jni_1generator_SampleForTests_nativeMethod(JNIEnv*
- env,
- jobject jcaller,
- jlong nativeTest,
- jint arg1) {
- Test* native = reinterpret_cast<Test*>(nativeTest);
- CHECK_NATIVE_PTR(env, jcaller, native, "Method", 0);
- return native->Method(env, JavaParamRef<jobject>(env, jcaller), arg1);
-}
-
-static jint Init(JNIEnv* env, const JavaParamRef<jobject>& jcaller);
-
-extern "C" __attribute__((visibility("default")))
-jint
- Java_org_chromium_example_jni_1generator_SampleForTests_00024MyInnerClass_nativeInit(JNIEnv*
- env, jobject jcaller) {
- return Init(env, JavaParamRef<jobject>(env, jcaller));
-}
-
-static jint Init(JNIEnv* env, const JavaParamRef<jobject>& jcaller);
-
-extern "C" __attribute__((visibility("default")))
-jint
- Java_org_chromium_example_jni_1generator_SampleForTests_00024MyOtherInnerClass_nativeInit(JNIEnv*
- env, jobject jcaller) {
- return Init(env, JavaParamRef<jobject>(env, jcaller));
-}
-
-static base::subtle::AtomicWord g_SampleForTests_testMethodWithParam = 0;
-static void Java_SampleForTests_testMethodWithParam(JNIEnv* env, jobject obj,
- JniIntWrapper iParam) {
- /* Must call RegisterNativesImpl() */
- CHECK_CLAZZ(env, obj,
- SampleForTests_clazz(env));
- jmethodID method_id =
- base::android::MethodID::LazyGet<
- base::android::MethodID::TYPE_INSTANCE>(
- env, SampleForTests_clazz(env),
- "testMethodWithParam",
-
-"("
-"I"
-")"
-"V",
- &g_SampleForTests_testMethodWithParam);
-
- env->CallVoidMethod(obj,
- method_id, as_jint(iParam));
- jni_generator::CheckException(env);
-
-}
-
-static base::subtle::AtomicWord g_SampleForTests_testMethodWithParamAndReturn =
- 0;
-static ScopedJavaLocalRef<jstring>
- Java_SampleForTests_testMethodWithParamAndReturn(JNIEnv* env, jobject obj,
- JniIntWrapper iParam) {
- /* Must call RegisterNativesImpl() */
- CHECK_CLAZZ(env, obj,
- SampleForTests_clazz(env), NULL);
- jmethodID method_id =
- base::android::MethodID::LazyGet<
- base::android::MethodID::TYPE_INSTANCE>(
- env, SampleForTests_clazz(env),
- "testMethodWithParamAndReturn",
-
-"("
-"I"
-")"
-"Ljava/lang/String;",
- &g_SampleForTests_testMethodWithParamAndReturn);
-
- jstring ret =
- static_cast<jstring>(env->CallObjectMethod(obj,
- method_id, as_jint(iParam)));
- jni_generator::CheckException(env);
- return ScopedJavaLocalRef<jstring>(env, ret);
-}
-
-static base::subtle::AtomicWord g_SampleForTests_testStaticMethodWithParam = 0;
-static jint Java_SampleForTests_testStaticMethodWithParam(JNIEnv* env,
- JniIntWrapper iParam) {
- /* Must call RegisterNativesImpl() */
- CHECK_CLAZZ(env, SampleForTests_clazz(env),
- SampleForTests_clazz(env), 0);
- jmethodID method_id =
- base::android::MethodID::LazyGet<
- base::android::MethodID::TYPE_STATIC>(
- env, SampleForTests_clazz(env),
- "testStaticMethodWithParam",
-
-"("
-"I"
-")"
-"I",
- &g_SampleForTests_testStaticMethodWithParam);
-
- jint ret =
- env->CallStaticIntMethod(SampleForTests_clazz(env),
- method_id, as_jint(iParam));
- jni_generator::CheckException(env);
- return ret;
-}
-
-static base::subtle::AtomicWord g_SampleForTests_testMethodWithNoParam = 0;
-static jdouble Java_SampleForTests_testMethodWithNoParam(JNIEnv* env) {
- /* Must call RegisterNativesImpl() */
- CHECK_CLAZZ(env, SampleForTests_clazz(env),
- SampleForTests_clazz(env), 0);
- jmethodID method_id =
- base::android::MethodID::LazyGet<
- base::android::MethodID::TYPE_STATIC>(
- env, SampleForTests_clazz(env),
- "testMethodWithNoParam",
-
-"("
-")"
-"D",
- &g_SampleForTests_testMethodWithNoParam);
-
- jdouble ret =
- env->CallStaticDoubleMethod(SampleForTests_clazz(env),
- method_id);
- jni_generator::CheckException(env);
- return ret;
-}
-
-static base::subtle::AtomicWord g_SampleForTests_testStaticMethodWithNoParam =
- 0;
-static ScopedJavaLocalRef<jstring>
- Java_SampleForTests_testStaticMethodWithNoParam(JNIEnv* env) {
- /* Must call RegisterNativesImpl() */
- CHECK_CLAZZ(env, SampleForTests_clazz(env),
- SampleForTests_clazz(env), NULL);
- jmethodID method_id =
- base::android::MethodID::LazyGet<
- base::android::MethodID::TYPE_STATIC>(
- env, SampleForTests_clazz(env),
- "testStaticMethodWithNoParam",
-
-"("
-")"
-"Ljava/lang/String;",
- &g_SampleForTests_testStaticMethodWithNoParam);
-
- jstring ret =
-static_cast<jstring>(env->CallStaticObjectMethod(SampleForTests_clazz(env),
- method_id));
- jni_generator::CheckException(env);
- return ScopedJavaLocalRef<jstring>(env, ret);
-}
-
-// Step 3: RegisterNatives.
-
-static const JNINativeMethod kMethodsMyOtherInnerClass[] = {
- { "nativeInit",
-"("
-")"
-"I",
- reinterpret_cast<void*>(Java_org_chromium_example_jni_1generator_SampleForTests_00024MyOtherInnerClass_nativeInit)
- },
-};
-
-static const JNINativeMethod kMethodsMyInnerClass[] = {
- { "nativeInit",
-"("
-")"
-"I",
- reinterpret_cast<void*>(Java_org_chromium_example_jni_1generator_SampleForTests_00024MyInnerClass_nativeInit)
- },
-};
-
-static const JNINativeMethod kMethodsSampleForTests[] = {
- { "nativeStaticMethod",
-"("
-"J"
-"I"
-")"
-"I",
- reinterpret_cast<void*>(Java_org_chromium_example_jni_1generator_SampleForTests_nativeStaticMethod)
- },
- { "nativeMethod",
-"("
-"J"
-"I"
-")"
-"I",
- reinterpret_cast<void*>(Java_org_chromium_example_jni_1generator_SampleForTests_nativeMethod)
- },
-};
-
-static bool RegisterNativesImpl(JNIEnv* env) {
- if (base::android::IsManualJniRegistrationDisabled()) return true;
-
- const int kMethodsMyOtherInnerClassSize =
- arraysize(kMethodsMyOtherInnerClass);
-
- if (env->RegisterNatives(MyOtherInnerClass_clazz(env),
- kMethodsMyOtherInnerClass,
- kMethodsMyOtherInnerClassSize) < 0) {
- jni_generator::HandleRegistrationError(
- env, MyOtherInnerClass_clazz(env), __FILE__);
- return false;
- }
-
- const int kMethodsMyInnerClassSize = arraysize(kMethodsMyInnerClass);
-
- if (env->RegisterNatives(MyInnerClass_clazz(env),
- kMethodsMyInnerClass,
- kMethodsMyInnerClassSize) < 0) {
- jni_generator::HandleRegistrationError(
- env, MyInnerClass_clazz(env), __FILE__);
- return false;
- }
-
- const int kMethodsSampleForTestsSize = arraysize(kMethodsSampleForTests);
-
- if (env->RegisterNatives(SampleForTests_clazz(env),
- kMethodsSampleForTests,
- kMethodsSampleForTestsSize) < 0) {
- jni_generator::HandleRegistrationError(
- env, SampleForTests_clazz(env), __FILE__);
- return false;
- }
-
- return true;
-}
-
-#endif // org_chromium_example_jni_generator_SampleForTests_JNI
« no previous file with comments | « base/android/jni_generator/testNativeExportsOption.golden ('k') | base/android/jni_generator/testNatives.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698