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

Unified Diff: base/android/jni_generator/java/src/org/chromium/example/jni_generator/SampleForTests.java

Issue 1212443006: JNI SampleForTests updated with clearer name for caller object. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bta-discovery-
Patch Set: Created 5 years, 5 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 | « no previous file | base/android/jni_generator/sample_for_tests.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/jni_generator/java/src/org/chromium/example/jni_generator/SampleForTests.java
diff --git a/base/android/jni_generator/java/src/org/chromium/example/jni_generator/SampleForTests.java b/base/android/jni_generator/java/src/org/chromium/example/jni_generator/SampleForTests.java
index f54944b1ff24d704c47427a36723579589c94813..dad59ce9c3ee97b9aef946eeb666709c2653852a 100644
--- a/base/android/jni_generator/java/src/org/chromium/example/jni_generator/SampleForTests.java
+++ b/base/android/jni_generator/java/src/org/chromium/example/jni_generator/SampleForTests.java
@@ -125,7 +125,7 @@ class SampleForTests {
// This is triggered by the @CalledByNative annotation; the methods may be named as you wish.
// Exported to C++ as:
- // Java_Example_javaMethod(JNIEnv* env, jobject obj, jint foo, jint bar)
+ // Java_Example_javaMethod(JNIEnv* env, jobject caller, jint foo, jint bar)
// Typically the C++ code would have obtained the jobject via the Init() call described above.
@CalledByNative
public int javaMethod(int foo, int bar) {
@@ -177,7 +177,7 @@ class SampleForTests {
// signatures. Besides these constraints the methods can be freely named.
// This declares a C++ function which the application code must implement:
- // static jint Init(JNIEnv* env, jobject obj);
+ // static jint Init(JNIEnv* env, jobject caller);
// The jobject parameter refers back to this java side object instance.
// The implementation must return the pointer to the C++ object cast to jint.
// The caller of this method should store it, and supply it as a the nativeCPPClass param to
@@ -195,7 +195,7 @@ class SampleForTests {
private native void nativeDestroy(long nativeCPPClass);
// This declares a C++ function which the application code must implement:
- // static jdouble GetDoubleFunction(JNIEnv* env, jobject obj);
+ // static jdouble GetDoubleFunction(JNIEnv* env, jobject caller);
// The jobject parameter refers back to this java side object instance.
private native double nativeGetDoubleFunction();
@@ -209,7 +209,7 @@ class SampleForTests {
private native void nativeSetNonPODDatatype(Rect rect);
// This declares a C++ function which the application code must implement:
- // static ScopedJavaLocalRef<jobject> GetNonPODDatatype(JNIEnv* env, jobject obj);
+ // static ScopedJavaLocalRef<jobject> GetNonPODDatatype(JNIEnv* env, jobject caller);
// The jobject parameter refers back to this java side object instance.
// Note that it returns a ScopedJavaLocalRef<jobject> so that you don' have to worry about
// deleting the JNI local reference. This is similar with Strings and arrays.
« no previous file with comments | « no previous file | base/android/jni_generator/sample_for_tests.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698