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

Unified Diff: base/android/jni_generator/testPureNativeMethodsOption.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 extra params Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/android/jni_generator/testNativesLong.golden ('k') | build/jar_file_jni_generator.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/jni_generator/testPureNativeMethodsOption.golden
diff --git a/base/android/jni_generator/testPureNativeMethodsOption.golden b/base/android/jni_generator/testPureNativeMethodsOption.golden
new file mode 100644
index 0000000000000000000000000000000000000000..3c34608a7e168d53baf217ffcb51d200aa28b76b
--- /dev/null
+++ b/base/android/jni_generator/testPureNativeMethodsOption.golden
@@ -0,0 +1,62 @@
+// Copyright (c) 2012 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/Test
+
+#ifndef org_chromium_example_jni_generator_Test_JNI
+#define org_chromium_example_jni_generator_Test_JNI
+
+#include <jni.h>
+
+#include "base/android/jni_generator/jni_generator_helper.h"
+
+// Step 1: forward declarations.
+namespace {
+const char kTestClassPath[] = "org/chromium/example/jni_generator/Test";
+// Leaking this jclass as we cannot use LazyInstance from some threads.
+jclass g_Test_clazz = NULL;
+
+} // namespace
+
+// Step 2: method stubs.
+static jint Method(JNIEnv* env, jobject jcaller,
+ jint nativeTest,
+ jint arg1) {
+ Test* native = reinterpret_cast<Test*>(nativeTest);
+ CHECK_NATIVE_PTR(env, jcaller, native, "Method", 0);
+ return native->Method(arg1);
+}
+
+// Step 3: RegisterNatives.
+
+static const JNINativeMethod kMethodsTest[] = {
+ { "nativeMethod",
+"("
+"I"
+"I"
+")"
+"I", reinterpret_cast<void*>(Method) },
+};
+
+static bool RegisterNativesImpl(JNIEnv* env) {
+ g_Test_clazz = reinterpret_cast<jclass>(env->NewGlobalRef(
+ base::android::GetClass(env, kTestClassPath).obj()));
+
+ const int kMethodsTestSize = arraysize(kMethodsTest);
+
+ if (env->RegisterNatives(g_Test_clazz,
+ kMethodsTest,
+ kMethodsTestSize) < 0) {
+ jni_generator::HandleRegistrationError(
+ env, g_Test_clazz, __FILE__);
+ return false;
+ }
+
+ return true;
+}
+
+#endif // org_chromium_example_jni_generator_Test_JNI
« no previous file with comments | « base/android/jni_generator/testNativesLong.golden ('k') | build/jar_file_jni_generator.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698