OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef BASE_ANDROID_JNI_GENERATOR_SAMPLE_FOR_TESTS_H_ | 5 #ifndef BASE_ANDROID_JNI_GENERATOR_SAMPLE_FOR_TESTS_H_ |
6 #define BASE_ANDROID_JNI_GENERATOR_SAMPLE_FOR_TESTS_H_ | 6 #define BASE_ANDROID_JNI_GENERATOR_SAMPLE_FOR_TESTS_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 ~CPPClass(); | 141 ~CPPClass(); |
142 | 142 |
143 // Register C++ methods exposed to Java using JNI. | 143 // Register C++ methods exposed to Java using JNI. |
144 static bool RegisterJNI(JNIEnv* env); | 144 static bool RegisterJNI(JNIEnv* env); |
145 | 145 |
146 // Java @CalledByNative methods implicitly available to C++ via the _jni.h | 146 // Java @CalledByNative methods implicitly available to C++ via the _jni.h |
147 // file included in the .cc file. | 147 // file included in the .cc file. |
148 | 148 |
149 class InnerClass { | 149 class InnerClass { |
150 public: | 150 public: |
151 jdouble MethodOtherP0(JNIEnv* env, jobject obj); | 151 jdouble MethodOtherP0(JNIEnv* env, jobject caller); |
152 }; | 152 }; |
153 | 153 |
154 void Destroy(JNIEnv* env, jobject obj); | 154 void Destroy(JNIEnv* env, jobject caller); |
155 | 155 |
156 jint Method(JNIEnv* env, jobject obj); | 156 jint Method(JNIEnv* env, jobject caller); |
157 | 157 |
158 void AddStructB(JNIEnv* env, jobject obj, jobject structb); | 158 void AddStructB(JNIEnv* env, jobject caller, jobject structb); |
159 | 159 |
160 void IterateAndDoSomethingWithStructB(JNIEnv* env, jobject obj); | 160 void IterateAndDoSomethingWithStructB(JNIEnv* env, jobject caller); |
161 | 161 |
162 base::android::ScopedJavaLocalRef<jstring> ReturnAString( | 162 base::android::ScopedJavaLocalRef<jstring> ReturnAString(JNIEnv* env, |
163 JNIEnv* env, jobject obj); | 163 jobject caller); |
164 | 164 |
165 private: | 165 private: |
166 std::map<long, std::string> map_; | 166 std::map<long, std::string> map_; |
167 | 167 |
168 DISALLOW_COPY_AND_ASSIGN(CPPClass); | 168 DISALLOW_COPY_AND_ASSIGN(CPPClass); |
169 }; | 169 }; |
170 | 170 |
171 } // namespace android | 171 } // namespace android |
172 } // namespace base | 172 } // namespace base |
173 | 173 |
174 #endif // BASE_ANDROID_JNI_GENERATOR_SAMPLE_FOR_TESTS_H_ | 174 #endif // BASE_ANDROID_JNI_GENERATOR_SAMPLE_FOR_TESTS_H_ |
OLD | NEW |