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

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

Issue 2204623002: Android: Don't require RegisterNatives if there are none (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 2014 The Chromium Authors. All rights reserved. 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 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 // org/chromium/foo/Foo 8 // org/chromium/foo/Foo
9 9
10 #ifndef org_chromium_foo_Foo_JNI 10 #ifndef org_chromium_foo_Foo_JNI
(...skipping 21 matching lines...) Expand all
32 32
33 extern "C" __attribute__((visibility("default"))) 33 extern "C" __attribute__((visibility("default")))
34 void Java_org_chromium_foo_Foo_nativeDoSomething(JNIEnv* env, jclass jcaller, 34 void Java_org_chromium_foo_Foo_nativeDoSomething(JNIEnv* env, jclass jcaller,
35 jobject callback) { 35 jobject callback) {
36 return DoSomething(env, JavaParamRef<jclass>(env, jcaller), 36 return DoSomething(env, JavaParamRef<jclass>(env, jcaller),
37 JavaParamRef<jobject>(env, callback)); 37 JavaParamRef<jobject>(env, callback));
38 } 38 }
39 39
40 static base::subtle::AtomicWord g_Foo_calledByNative = 0; 40 static base::subtle::AtomicWord g_Foo_calledByNative = 0;
41 static void Java_Foo_calledByNative(JNIEnv* env, jobject callback) { 41 static void Java_Foo_calledByNative(JNIEnv* env, jobject callback) {
42 /* Must call RegisterNativesImpl() */
43 CHECK_CLAZZ(env, Foo_clazz(env), 42 CHECK_CLAZZ(env, Foo_clazz(env),
44 Foo_clazz(env)); 43 Foo_clazz(env));
45 jmethodID method_id = 44 jmethodID method_id =
46 base::android::MethodID::LazyGet< 45 base::android::MethodID::LazyGet<
47 base::android::MethodID::TYPE_STATIC>( 46 base::android::MethodID::TYPE_STATIC>(
48 env, Foo_clazz(env), 47 env, Foo_clazz(env),
49 "calledByNative", 48 "calledByNative",
50 49
51 "(" 50 "("
52 "Lorg/chromium/foo/Bar$Callback;" 51 "Lorg/chromium/foo/Bar$Callback;"
(...skipping 27 matching lines...) Expand all
80 kMethodsFooSize) < 0) { 79 kMethodsFooSize) < 0) {
81 jni_generator::HandleRegistrationError( 80 jni_generator::HandleRegistrationError(
82 env, Foo_clazz(env), __FILE__); 81 env, Foo_clazz(env), __FILE__);
83 return false; 82 return false;
84 } 83 }
85 84
86 return true; 85 return true;
87 } 86 }
88 87
89 #endif // org_chromium_foo_Foo_JNI 88 #endif // org_chromium_foo_Foo_JNI
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698