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

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

Issue 10798010: Uses gyp "rules" rather than "actions" templates for the JNI generator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Typo on content_jni.gypi Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/android/jni_generator/jni_generator_tests.py ('k') | base/android/locale_utils.cc » ('j') | 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_android.h" 5 #include "base/android/jni_android.h"
6 #include "base/android/scoped_java_ref.h" 6 #include "base/android/scoped_java_ref.h"
7 7
8 // The main purpose of this is to ensure sample_for_tests_jni.h 8 // The main purpose of this is to ensure sample_for_tests_jni.h
9 // compiles and the functions declared in it as expected. 9 // compiles and the functions declared in it as expected.
10 10
(...skipping 19 matching lines...) Expand all
30 return 0; 30 return 0;
31 } 31 }
32 32
33 ScopedJavaLocalRef<jstring> InnerMethod(JNIEnv* env, jobject obj) { 33 ScopedJavaLocalRef<jstring> InnerMethod(JNIEnv* env, jobject obj) {
34 return ScopedJavaLocalRef<jstring>(); 34 return ScopedJavaLocalRef<jstring>();
35 } 35 }
36 }; 36 };
37 37
38 } // namespace content 38 } // namespace content
39 39
40 #include "jni/sample_for_tests_jni.h" 40 #include "jni/SampleForTests_jni.h"
41 41
42 int main() { 42 int main() {
43 // On a regular application, you'd call AttachCurrentThread(). This sample is 43 // On a regular application, you'd call AttachCurrentThread(). This sample is
44 // not yet linking with all the libraries. 44 // not yet linking with all the libraries.
45 JNIEnv* env = /* AttachCurrentThread() */ NULL; 45 JNIEnv* env = /* AttachCurrentThread() */ NULL;
46 46
47 // This is how you call a java static method from C++. 47 // This is how you call a java static method from C++.
48 bool foo = content::Java_SampleForTests_staticJavaMethod(env); 48 bool foo = content::Java_SampleForTests_staticJavaMethod(env);
49 49
50 // This is how you call a java method from C++. Note that you must have 50 // This is how you call a java method from C++. Note that you must have
51 // obtained the jobject somehow. 51 // obtained the jobject somehow.
52 jobject my_java_object = NULL; 52 jobject my_java_object = NULL;
53 int bar = content::Java_SampleForTests_javaMethod(env, my_java_object, 1, 2); 53 int bar = content::Java_SampleForTests_javaMethod(env, my_java_object, 1, 2);
54 54
55 return 0; 55 return 0;
56 } 56 }
OLDNEW
« no previous file with comments | « base/android/jni_generator/jni_generator_tests.py ('k') | base/android/locale_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698