|  | // 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/Example | 
|  |  | 
|  | #ifndef org_chromium_example_jni_generator_Example_JNI | 
|  | #define org_chromium_example_jni_generator_Example_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 kExampleClassPath[] = "com/test/jni_generator/Example"; | 
|  | // Leaking this jclass as we cannot use LazyInstance from some threads. | 
|  | jclass g_Example_clazz = NULL; | 
|  | #define Example_clazz(env) g_Example_clazz | 
|  |  | 
|  | }  // namespace | 
|  |  | 
|  | static void Test(JNIEnv* env, jclass jcaller, | 
|  | jobject t); | 
|  |  | 
|  | static void Test2(JNIEnv* env, jclass jcaller, | 
|  | jobject t); | 
|  |  | 
|  | static void Test3(JNIEnv* env, jclass jcaller, | 
|  | jobject t); | 
|  |  | 
|  | static void Test4(JNIEnv* env, jclass jcaller, | 
|  | jobject t); | 
|  |  | 
|  | // Step 2: method stubs. | 
|  |  | 
|  | // Step 3: RegisterNatives. | 
|  |  | 
|  | static const JNINativeMethod kMethodsExample[] = { | 
|  | { "nativeTest", | 
|  | "(" | 
|  | "Lorg/test2/Test;" | 
|  | ")" | 
|  | "V", reinterpret_cast<void*>(Test) }, | 
|  | { "nativeTest2", | 
|  | "(" | 
|  | "Lorg/chromium/example3/PrefixFoo;" | 
|  | ")" | 
|  | "V", reinterpret_cast<void*>(Test2) }, | 
|  | { "nativeTest3", | 
|  | "(" | 
|  | "Lorg/test3/Test;" | 
|  | ")" | 
|  | "V", reinterpret_cast<void*>(Test3) }, | 
|  | { "nativeTest4", | 
|  | "(" | 
|  | "Lorg/test3/TestBar$Inner;" | 
|  | ")" | 
|  | "V", reinterpret_cast<void*>(Test4) }, | 
|  | }; | 
|  |  | 
|  | static bool RegisterNativesImpl(JNIEnv* env) { | 
|  | g_Example_clazz = reinterpret_cast<jclass>(env->NewGlobalRef( | 
|  | base::android::GetClass(env, kExampleClassPath).obj())); | 
|  |  | 
|  | const int kMethodsExampleSize = arraysize(kMethodsExample); | 
|  |  | 
|  | if (env->RegisterNatives(Example_clazz(env), | 
|  | kMethodsExample, | 
|  | kMethodsExampleSize) < 0) { | 
|  | jni_generator::HandleRegistrationError( | 
|  | env, Example_clazz(env), __FILE__); | 
|  | return false; | 
|  | } | 
|  |  | 
|  | return true; | 
|  | } | 
|  |  | 
|  | #endif  // org_chromium_example_jni_generator_Example_JNI |