1// Copyright 2014 The Chromium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5 6// This file is autogenerated by 7// base/android/jni_generator/jni_generator.py 8// For 9// java/util/HashSet 10 11#ifndef java_util_HashSet_JNI 12#define java_util_HashSet_JNI 13 14#include <jni.h> 15 16#include "base/android/jni_generator/jni_generator_helper.h" 17 18 19// Step 1: Forward declarations. 20 21JNI_REGISTRATION_EXPORT extern const char kClassPath_java_util_HashSet[]; 22const char kClassPath_java_util_HashSet[] = "java/util/HashSet"; 23// Leaking this jclass as we cannot use LazyInstance from some threads. 24JNI_REGISTRATION_EXPORT base::subtle::AtomicWord g_java_util_HashSet_clazz = 0; 25#ifndef java_util_HashSet_clazz_defined 26#define java_util_HashSet_clazz_defined 27inline jclass java_util_HashSet_clazz(JNIEnv* env) { 28 return base::android::LazyGetClass(env, kClassPath_java_util_HashSet, &g_java_util_HashSet_clazz); 29} 30#endif 31 32 33// Step 2: Constants (optional). 34 35 36// Step 3: Method stubs. 37namespace JNI_HashSet { 38 39 40static base::subtle::AtomicWord g_java_util_HashSet_dummy = 0; 41static void Java_HashSet_dummy(JNIEnv* env, const base::android::JavaRef<jobject>& obj) 42 __attribute__ ((unused)); 43static void Java_HashSet_dummy(JNIEnv* env, const base::android::JavaRef<jobject>& obj) { 44 CHECK_CLAZZ(env, obj.obj(), 45 java_util_HashSet_clazz(env)); 46 jmethodID method_id = base::android::MethodID::LazyGet< 47 base::android::MethodID::TYPE_INSTANCE>( 48 env, java_util_HashSet_clazz(env), 49 "dummy", 50 "()V", 51 &g_java_util_HashSet_dummy); 52 53 env->CallVoidMethod(obj.obj(), 54 method_id); 55 jni_generator::CheckException(env); 56} 57 58static base::subtle::AtomicWord g_java_util_HashSet_getClass = 0; 59static base::android::ScopedJavaLocalRef<jclass> Java_HashSet_getClass(JNIEnv* env, const 60 base::android::JavaRef<jobject>& obj) __attribute__ ((unused)); 61static base::android::ScopedJavaLocalRef<jclass> Java_HashSet_getClass(JNIEnv* env, const 62 base::android::JavaRef<jobject>& obj) { 63 CHECK_CLAZZ(env, obj.obj(), 64 java_util_HashSet_clazz(env), NULL); 65 jmethodID method_id = base::android::MethodID::LazyGet< 66 base::android::MethodID::TYPE_INSTANCE>( 67 env, java_util_HashSet_clazz(env), 68 "getClass", 69 "()Ljava/lang/Class<*>;", 70 &g_java_util_HashSet_getClass); 71 72 jclass ret = 73 static_cast<jclass>(env->CallObjectMethod(obj.obj(), 74 method_id)); 75 jni_generator::CheckException(env); 76 return base::android::ScopedJavaLocalRef<jclass>(env, ret); 77} 78 79} // namespace JNI_HashSet 80 81#endif // java_util_HashSet_JNI 82