101 lines
2.7 KiB
Plaintext
101 lines
2.7 KiB
Plaintext
|
|
// Copyright 2017 The Chromium Authors
|
||
|
|
// 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_registration_generator.py
|
||
|
|
// Please do not change its content.
|
||
|
|
|
||
|
|
#ifndef HEADER_GUARD
|
||
|
|
#define HEADER_GUARD
|
||
|
|
|
||
|
|
#include <jni.h>
|
||
|
|
|
||
|
|
#include <iterator>
|
||
|
|
|
||
|
|
#include "base/android/jni_generator/jni_generator_helper.h"
|
||
|
|
#include "base/android/jni_int_wrapper.h"
|
||
|
|
|
||
|
|
|
||
|
|
// Step 1: Forward declarations (classes).
|
||
|
|
|
||
|
|
|
||
|
|
// Step 2: Forward declarations (methods).
|
||
|
|
|
||
|
|
JNI_GENERATOR_EXPORT void
|
||
|
|
Java_org_chromium_base_natives_GEN_1JNI_org_1chromium_1example_1SampleProxyJni_1foo(
|
||
|
|
JNIEnv* env,
|
||
|
|
jclass jcaller,
|
||
|
|
jlong nativePtr);
|
||
|
|
JNI_GENERATOR_EXPORT jint
|
||
|
|
Java_org_chromium_base_natives_GEN_1JNI_org_1chromium_1example_1SampleProxyJni_1bar(
|
||
|
|
JNIEnv* env,
|
||
|
|
jclass jcaller,
|
||
|
|
jint x,
|
||
|
|
jint y);
|
||
|
|
JNI_GENERATOR_EXPORT jstring
|
||
|
|
Java_org_chromium_base_natives_GEN_1JNI_org_1chromium_1example_1SampleProxyJni_1foobar(
|
||
|
|
JNIEnv* env,
|
||
|
|
jclass jcaller,
|
||
|
|
jstring x,
|
||
|
|
jstring y);
|
||
|
|
|
||
|
|
|
||
|
|
// Step 3: Method declarations.
|
||
|
|
|
||
|
|
|
||
|
|
static const JNINativeMethod kMethods_org_chromium_base_natives_GEN_1JNI[] = {
|
||
|
|
{ "org_chromium_example_SampleProxyJni_foo", "(J)V",
|
||
|
|
reinterpret_cast<void*>(Java_org_chromium_base_natives_GEN_1JNI_org_1chromium_1example_1SampleProxyJni_1foo)
|
||
|
|
},
|
||
|
|
{ "org_chromium_example_SampleProxyJni_bar", "(II)I",
|
||
|
|
reinterpret_cast<void*>(Java_org_chromium_base_natives_GEN_1JNI_org_1chromium_1example_1SampleProxyJni_1bar)
|
||
|
|
},
|
||
|
|
{ "org_chromium_example_SampleProxyJni_foobar",
|
||
|
|
"(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;",
|
||
|
|
reinterpret_cast<void*>(Java_org_chromium_base_natives_GEN_1JNI_org_1chromium_1example_1SampleProxyJni_1foobar)
|
||
|
|
},
|
||
|
|
|
||
|
|
};
|
||
|
|
|
||
|
|
namespace {
|
||
|
|
|
||
|
|
JNI_REGISTRATION_EXPORT bool RegisterNative_org_chromium_base_natives_GEN_1JNI(JNIEnv* env) {
|
||
|
|
const int number_of_methods = std::size(kMethods_org_chromium_base_natives_GEN_1JNI);
|
||
|
|
|
||
|
|
base::android::ScopedJavaLocalRef<jclass> native_clazz =
|
||
|
|
base::android::GetClass(env, "org/chromium/base/natives/GEN_JNI");
|
||
|
|
if (env->RegisterNatives(
|
||
|
|
native_clazz.obj(),
|
||
|
|
kMethods_org_chromium_base_natives_GEN_1JNI,
|
||
|
|
number_of_methods) < 0) {
|
||
|
|
|
||
|
|
jni_generator::HandleRegistrationError(env, native_clazz.obj(), __FILE__);
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
|
||
|
|
} // namespace
|
||
|
|
|
||
|
|
|
||
|
|
// Step 4: Registration function.
|
||
|
|
|
||
|
|
namespace test {
|
||
|
|
|
||
|
|
bool RegisterNatives(JNIEnv* env) {
|
||
|
|
// Register natives in a proxy.
|
||
|
|
if (!RegisterNative_org_chromium_base_natives_GEN_1JNI(env)) {
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
|
||
|
|
} // namespace test
|
||
|
|
|
||
|
|
#endif // HEADER_GUARD
|