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

Unified Diff: base/android/jni_generator/golden_sample_for_tests_jni.h

Issue 132013003: Android: moves jni_generator samples to use long for JNI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: With fixes 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 | « no previous file | base/android/jni_generator/java/src/org/chromium/example/jni_generator/SampleForTests.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/jni_generator/golden_sample_for_tests_jni.h
diff --git a/base/android/jni_generator/golden_sample_for_tests_jni.h b/base/android/jni_generator/golden_sample_for_tests_jni.h
index 27277b27f8f8db610b1ca4bdc85000c46bf83f7f..b90bb9fe310cc39dd5f6a5000e5f122fe64e44e7 100644
--- a/base/android/jni_generator/golden_sample_for_tests_jni.h
+++ b/base/android/jni_generator/golden_sample_for_tests_jni.h
@@ -34,7 +34,7 @@ jclass g_InnerStructB_clazz = NULL;
namespace base {
namespace android {
-static jint Init(JNIEnv* env, jobject jcaller,
+static jlong Init(JNIEnv* env, jobject jcaller,
jstring param);
static jdouble GetDoubleFunction(JNIEnv* env, jobject jcaller);
@@ -48,21 +48,21 @@ static jobject GetNonPODDatatype(JNIEnv* env, jobject jcaller);
// Step 2: method stubs.
static void Destroy(JNIEnv* env, jobject jcaller,
- jint nativeCPPClass) {
+ jlong nativeCPPClass) {
CPPClass* native = reinterpret_cast<CPPClass*>(nativeCPPClass);
CHECK_NATIVE_PTR(env, jcaller, native, "Destroy");
return native->Destroy(env, jcaller);
}
static jint Method(JNIEnv* env, jobject jcaller,
- jint nativeCPPClass) {
+ jlong nativeCPPClass) {
CPPClass* native = reinterpret_cast<CPPClass*>(nativeCPPClass);
CHECK_NATIVE_PTR(env, jcaller, native, "Method", 0);
return native->Method(env, jcaller);
}
static jdouble MethodOtherP0(JNIEnv* env, jobject jcaller,
- jint nativePtr) {
+ jlong nativePtr) {
CPPClass::InnerClass* native =
reinterpret_cast<CPPClass::InnerClass*>(nativePtr);
CHECK_NATIVE_PTR(env, jcaller, native, "MethodOtherP0", 0);
@@ -70,7 +70,7 @@ static jdouble MethodOtherP0(JNIEnv* env, jobject jcaller,
}
static void AddStructB(JNIEnv* env, jobject jcaller,
- jint nativeCPPClass,
+ jlong nativeCPPClass,
jobject b) {
CPPClass* native = reinterpret_cast<CPPClass*>(nativeCPPClass);
CHECK_NATIVE_PTR(env, jcaller, native, "AddStructB");
@@ -78,14 +78,14 @@ static void AddStructB(JNIEnv* env, jobject jcaller,
}
static void IterateAndDoSomethingWithStructB(JNIEnv* env, jobject jcaller,
- jint nativeCPPClass) {
+ jlong nativeCPPClass) {
CPPClass* native = reinterpret_cast<CPPClass*>(nativeCPPClass);
CHECK_NATIVE_PTR(env, jcaller, native, "IterateAndDoSomethingWithStructB");
return native->IterateAndDoSomethingWithStructB(env, jcaller);
}
static jstring ReturnAString(JNIEnv* env, jobject jcaller,
- jint nativeCPPClass) {
+ jlong nativeCPPClass) {
CPPClass* native = reinterpret_cast<CPPClass*>(nativeCPPClass);
CHECK_NATIVE_PTR(env, jcaller, native, "ReturnAString", NULL);
return native->ReturnAString(env, jcaller).Release();
@@ -315,10 +315,10 @@ static const JNINativeMethod kMethodsSampleForTests[] = {
"("
"Ljava/lang/String;"
")"
-"I", reinterpret_cast<void*>(Init) },
+"J", reinterpret_cast<void*>(Init) },
{ "nativeDestroy",
"("
-"I"
+"J"
")"
"V", reinterpret_cast<void*>(Destroy) },
{ "nativeGetDoubleFunction",
@@ -340,28 +340,28 @@ static const JNINativeMethod kMethodsSampleForTests[] = {
"Ljava/lang/Object;", reinterpret_cast<void*>(GetNonPODDatatype) },
{ "nativeMethod",
"("
-"I"
+"J"
")"
"I", reinterpret_cast<void*>(Method) },
{ "nativeMethodOtherP0",
"("
-"I"
+"J"
")"
"D", reinterpret_cast<void*>(MethodOtherP0) },
{ "nativeAddStructB",
"("
-"I"
+"J"
"Lorg/chromium/example/jni_generator/SampleForTests$InnerStructB;"
")"
"V", reinterpret_cast<void*>(AddStructB) },
{ "nativeIterateAndDoSomethingWithStructB",
"("
-"I"
+"J"
")"
"V", reinterpret_cast<void*>(IterateAndDoSomethingWithStructB) },
{ "nativeReturnAString",
"("
-"I"
+"J"
")"
"Ljava/lang/String;", reinterpret_cast<void*>(ReturnAString) },
};
« no previous file with comments | « no previous file | base/android/jni_generator/java/src/org/chromium/example/jni_generator/SampleForTests.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698