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

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

Issue 115103002: Android: sync up latest JNI generator changes from downstream. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adds missing files Created 7 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 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 // org/chromium/example/jni_generator/Example 8 // org/chromium/example/jni_generator/Example
9 9
10 #ifndef org_chromium_example_jni_generator_Example_JNI 10 #ifndef org_chromium_example_jni_generator_Example_JNI
11 #define org_chromium_example_jni_generator_Example_JNI 11 #define org_chromium_example_jni_generator_Example_JNI
12 12
13 #include <jni.h> 13 #include <jni.h>
14 14
15 #include "base/android/jni_android.h" 15 #include "base/android/jni_generator/jni_generator_helper.h"
16 #include "base/android/scoped_java_ref.h"
17 #include "base/basictypes.h"
18 #include "base/logging.h"
19
20 using base::android::ScopedJavaLocalRef;
21 16
22 // Step 1: forward declarations. 17 // Step 1: forward declarations.
23 namespace { 18 namespace {
24 const char kExampleClassPath[] = "com/test/jni_generator/Example"; 19 const char kExampleClassPath[] = "com/test/jni_generator/Example";
25 // Leaking this jclass as we cannot use LazyInstance from some threads. 20 // Leaking this jclass as we cannot use LazyInstance from some threads.
26 jclass g_Example_clazz = NULL; 21 jclass g_Example_clazz = NULL;
22
27 } // namespace 23 } // namespace
28 24
29 static void Test(JNIEnv* env, jclass clazz, 25 static void Test(JNIEnv* env, jclass clazz,
30 jobject t); 26 jobject t);
31 27
32 // Step 2: method stubs. 28 // Step 2: method stubs.
33 29
34 // Step 3: RegisterNatives. 30 // Step 3: RegisterNatives.
35 31
36 static bool RegisterNativesImpl(JNIEnv* env) { 32 static const JNINativeMethod kMethodsExample[] = {
37
38 g_Example_clazz = reinterpret_cast<jclass>(env->NewGlobalRef(
39 base::android::GetClass(env, kExampleClassPath).obj()));
40 static const JNINativeMethod kMethodsExample[] = {
41 { "nativeTest", 33 { "nativeTest",
42 "(" 34 "("
43 "Lorg/test2/org/chromium/example2/Test;" 35 "Lorg/test2/org/chromium/example2/Test;"
44 ")" 36 ")"
45 "V", reinterpret_cast<void*>(Test) }, 37 "V", reinterpret_cast<void*>(Test) },
46 }; 38 };
39
40 static bool RegisterNativesImpl(JNIEnv* env) {
41 g_Example_clazz = reinterpret_cast<jclass>(env->NewGlobalRef(
42 base::android::GetClass(env, kExampleClassPath).obj()));
43
47 const int kMethodsExampleSize = arraysize(kMethodsExample); 44 const int kMethodsExampleSize = arraysize(kMethodsExample);
48 45
49 if (env->RegisterNatives(g_Example_clazz, 46 if (env->RegisterNatives(g_Example_clazz,
50 kMethodsExample, 47 kMethodsExample,
51 kMethodsExampleSize) < 0) { 48 kMethodsExampleSize) < 0) {
52 LOG(ERROR) << "RegisterNatives failed in " << __FILE__; 49 jni_generator::HandleRegistrationError(
50 env, g_Example_clazz, __FILE__);
53 return false; 51 return false;
54 } 52 }
55 53
56 return true; 54 return true;
57 } 55 }
58 56
59 #endif // org_chromium_example_jni_generator_Example_JNI 57 #endif // org_chromium_example_jni_generator_Example_JNI
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698