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

Side by Side Diff: base/android/jni_generator/testFromJavaP.golden

Issue 147533004: Remove unneeded JNI registrations. (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Fix android webview build issues. Created 6 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file is autogenerated by 5 // This file is autogenerated by
6 // base/android/jni_generator/jni_generator.py 6 // base/android/jni_generator/jni_generator.py
7 // For 7 // For
8 // java/io/InputStream 8 // java/io/InputStream
9 9
10 #ifndef java_io_InputStream_JNI 10 #ifndef java_io_InputStream_JNI
11 #define java_io_InputStream_JNI 11 #define java_io_InputStream_JNI
12 12
13 #include <jni.h> 13 #include <jni.h>
14 14
15 #include "base/android/jni_generator/jni_generator_helper.h" 15 #include "base/android/jni_generator/jni_generator_helper.h"
16 16
17 // Step 1: forward declarations. 17 // Step 1: forward declarations.
18 namespace { 18 namespace {
19 const char kInputStreamClassPath[] = "java/io/InputStream"; 19 const char kInputStreamClassPath[] = "java/io/InputStream";
20 // Leaking this jclass as we cannot use LazyInstance from some threads. 20 // Leaking this jclass as we cannot use LazyInstance from some threads.
21 jclass g_InputStream_clazz = NULL; 21 jclass g_InputStream_clazz = NULL;
22 22
23 } // namespace 23 } // namespace
24 24
25 namespace JNI_InputStream { 25 namespace JNI_InputStream {
26 extern "C"{
26 27
27 // Step 2: method stubs. 28 // Step 2: method stubs.
28 29
29 static base::subtle::AtomicWord g_InputStream_available = 0; 30 static base::subtle::AtomicWord g_InputStream_available = 0;
30 static jint Java_InputStream_available(JNIEnv* env, jobject obj) __attribute__ 31 static jint Java_InputStream_available(JNIEnv* env, jobject obj) __attribute__
31 ((unused)); 32 ((unused));
32 static jint Java_InputStream_available(JNIEnv* env, jobject obj) { 33 static jint Java_InputStream_available(JNIEnv* env, jobject obj) {
33 /* Must call RegisterNativesImpl() */ 34 /* Must call RegisterNativesImpl() */
34 CHECK_CLAZZ(env, obj, 35 CHECK_CLAZZ(env, obj,
35 g_InputStream_clazz, 0); 36 g_InputStream_clazz, 0);
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 "<init>", 242 "<init>",
242 "()V", 243 "()V",
243 &g_InputStream_Constructor); 244 &g_InputStream_Constructor);
244 245
245 jobject ret = 246 jobject ret =
246 env->NewObject(g_InputStream_clazz, 247 env->NewObject(g_InputStream_clazz,
247 method_id); 248 method_id);
248 jni_generator::CheckException(env); 249 jni_generator::CheckException(env);
249 return base::android::ScopedJavaLocalRef<jobject>(env, ret); 250 return base::android::ScopedJavaLocalRef<jobject>(env, ret);
250 } 251 }
252 };
251 253
252 // Step 3: RegisterNatives. 254 // Step 3: RegisterNatives.
253
254 static bool RegisterNativesImpl(JNIEnv* env) { 255 static bool RegisterNativesImpl(JNIEnv* env) {
255 g_InputStream_clazz = reinterpret_cast<jclass>(env->NewGlobalRef( 256 g_InputStream_clazz = reinterpret_cast<jclass>(env->NewGlobalRef(
256 base::android::GetClass(env, kInputStreamClassPath).obj())); 257 base::android::GetClass(env, kInputStreamClassPath).obj()));
257 258
258 return true; 259 return true;
259 } 260 }
260 261
261 } // namespace JNI_InputStream 262 } // namespace JNI_InputStream
262 263
263 #endif // java_io_InputStream_JNI 264 #endif // java_io_InputStream_JNI
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698