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

Side by Side Diff: base/android/jni_generator/sample_for_tests.cc

Issue 131543003: Android: moves jni_generator samples to use long for JNI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/android/jni_generator/jni_generator.gyp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 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 #include "base/android/jni_generator/sample_for_tests.h" 5 #include "base/android/jni_generator/sample_for_tests.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/android/scoped_java_ref.h" 9 #include "base/android/scoped_java_ref.h"
10 #include "jni/SampleForTests_jni.h" 10 #include "jni/SampleForTests_jni.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 } 52 }
53 53
54 base::android::ScopedJavaLocalRef<jstring> CPPClass::ReturnAString( 54 base::android::ScopedJavaLocalRef<jstring> CPPClass::ReturnAString(
55 JNIEnv* env, jobject obj) { 55 JNIEnv* env, jobject obj) {
56 base::android::ScopedJavaLocalRef<jstring> ret = ConvertUTF8ToJavaString( 56 base::android::ScopedJavaLocalRef<jstring> ret = ConvertUTF8ToJavaString(
57 env, "test"); 57 env, "test");
58 return ret; 58 return ret;
59 } 59 }
60 60
61 // Static free functions declared and called directly from java. 61 // Static free functions declared and called directly from java.
62 static jint Init(JNIEnv* env, jobject obj, jstring param) { 62 static jlong Init(JNIEnv* env, jobject obj, jstring param) {
63 return 0; 63 return 0;
64 } 64 }
65 65
66 static jdouble GetDoubleFunction(JNIEnv*, jobject) { 66 static jdouble GetDoubleFunction(JNIEnv*, jobject) {
67 return 0; 67 return 0;
68 } 68 }
69 69
70 static jfloat GetFloatFunction(JNIEnv*, jclass) { 70 static jfloat GetFloatFunction(JNIEnv*, jclass) {
71 return 0; 71 return 0;
72 } 72 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 ScopedJavaLocalRef<jobject> struct_a = 104 ScopedJavaLocalRef<jobject> struct_a =
105 base::android::Java_InnerStructA_create( 105 base::android::Java_InnerStructA_create(
106 env, 0, 1, 106 env, 0, 1,
107 base::android::ConvertUTF8ToJavaString(env, "test").obj()); 107 base::android::ConvertUTF8ToJavaString(env, "test").obj());
108 base::android::Java_SampleForTests_addStructA( 108 base::android::Java_SampleForTests_addStructA(
109 env, my_java_object, struct_a.obj()); 109 env, my_java_object, struct_a.obj());
110 } 110 }
111 base::android::Java_SampleForTests_iterateAndDoSomething(env, my_java_object); 111 base::android::Java_SampleForTests_iterateAndDoSomething(env, my_java_object);
112 return 0; 112 return 0;
113 } 113 }
OLDNEW
« no previous file with comments | « base/android/jni_generator/jni_generator.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698