chromium/third_party/jni_zero/test/golden/testUniqueAnnotations-SampleUniqueAnnotations_jni.h.golden

// This file was generated by
//     //third_party/jni_zero/jni_zero.py
// For
//     org.jni_zero.SampleUniqueAnnotations

#ifndef org_jni_1zero_SampleUniqueAnnotations_JNI
#define org_jni_1zero_SampleUniqueAnnotations_JNI

#include <jni.h>

#include "third_party/jni_zero/jni_export.h"
#include "third_party/jni_zero/jni_zero_helper.h"
// Class Accessors.
#ifndef org_jni_1zero_SampleUniqueAnnotations_clazz_defined
#define org_jni_1zero_SampleUniqueAnnotations_clazz_defined
inline jclass org_jni_1zero_SampleUniqueAnnotations_clazz(JNIEnv* env) {
  static const char kClassName[] = "org/jni_zero/SampleUniqueAnnotations";
  static std::atomic<jclass> cached_class;
  return jni_zero::internal::LazyGetClass(env, kClassName, &cached_class);
}
#endif

// Java to native functions
// Forward declaration. To be implemented by the including .cc file.
static jint JNI_SampleUniqueAnnotations_Bar(JNIEnv* env, jint x, jint y);

JNI_POSSIBLE_BOUNDARY_EXPORT jint Java_org_jni_1zero_GEN_1JNI_org_1jni_11zero_1SampleUniqueAnnotations_1bar(
    JNIEnv* env,
    jclass jcaller,
    jint x,
    jint y) {
  auto _ret = JNI_SampleUniqueAnnotations_Bar(env, x, y);
  return _ret;
}

// Forward declaration. To be implemented by the including .cc file.
static void JNI_SampleUniqueAnnotations_Baz(
    JNIEnv* env,
    const jni_zero::JavaParamRef<jobject>& handle);

JNI_POSSIBLE_BOUNDARY_EXPORT void Java_org_jni_1zero_GEN_1JNI_org_1jni_11zero_1SampleUniqueAnnotations_1baz(
    JNIEnv* env,
    jclass jcaller,
    jobject handle) {
  JNI_SampleUniqueAnnotations_Baz(
      env,
      jni_zero::JavaParamRef<jobject>(env, handle));
}

JNI_POSSIBLE_BOUNDARY_EXPORT void Java_org_jni_1zero_GEN_1JNI_org_1jni_11zero_1SampleUniqueAnnotations_1foo(
    JNIEnv* env,
    jclass jcaller,
    jlong nativePtr,
    jobject arg) {
  std::string arg_converted = jni_zero::FromJniType<std::string>(
      env,
      jni_zero::JavaParamRef<jobject>(env, arg));
  reinterpret_cast<FooAndroid::BarDelegate*>(nativePtr)->Foo(
      env,
      arg_converted);
}

JNI_POSSIBLE_BOUNDARY_EXPORT void Java_org_jni_1zero_SampleUniqueAnnotations_nativeCallWithQualifiedObject(
    JNIEnv* env,
    jobject jcaller,
    jlong nativePtr) {
  reinterpret_cast<Foo::Bar*>(nativePtr)->CallWithQualifiedObject(
      env,
      jni_zero::JavaParamRef<jobject>(env, jcaller));
}

// Native to Java functions
static void Java_SampleUniqueAnnotations_useBar1(
    JNIEnv* env,
    const jni_zero::JavaRef<jobject>& inner) {
  static std::atomic<jmethodID> cached_method_id(nullptr);
  jclass clazz = org_jni_1zero_SampleUniqueAnnotations_clazz(env);
  CHECK_CLAZZ(env, clazz, clazz);
  jni_zero::internal::JniJavaCallContext<true> call_context;
  call_context.Init<jni_zero::MethodID::TYPE_STATIC>(
      env,
      clazz,
      "useBar1",
      "(Lorg/jni_zero/Bar1$Inner;)V",
      &cached_method_id);
  env->CallStaticVoidMethod(clazz, call_context.method_id(), inner.obj());
}


#endif  // org_jni_1zero_SampleUniqueAnnotations_JNI