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 #include <jni.h> | 5 #include <jni.h> |
6 #include <map> | 6 #include <map> |
7 #include <string> | 7 #include <string> |
8 | 8 |
| 9 #include "base/android/jni_android.h" |
9 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
10 | 11 |
11 namespace base { | 12 namespace base { |
12 namespace android { | 13 namespace android { |
13 | 14 |
14 // This file is used to: | 15 // This file is used to: |
15 // - document the best practices and guidelines on JNI usage. | 16 // - document the best practices and guidelines on JNI usage. |
16 // - ensure sample_for_tests_jni.h compiles and the functions declared in it | 17 // - ensure sample_for_tests_jni.h compiles and the functions declared in it |
17 // as expected. | 18 // as expected. |
18 // | 19 // |
(...skipping 10 matching lines...) Expand all Loading... |
29 }; | 30 }; |
30 | 31 |
31 void Destroy(JNIEnv* env, jobject obj); | 32 void Destroy(JNIEnv* env, jobject obj); |
32 | 33 |
33 jint Method(JNIEnv* env, jobject obj); | 34 jint Method(JNIEnv* env, jobject obj); |
34 | 35 |
35 void AddStructB(JNIEnv* env, jobject obj, jobject structb); | 36 void AddStructB(JNIEnv* env, jobject obj, jobject structb); |
36 | 37 |
37 void IterateAndDoSomethingWithStructB(JNIEnv* env, jobject obj); | 38 void IterateAndDoSomethingWithStructB(JNIEnv* env, jobject obj); |
38 | 39 |
| 40 base::android::ScopedJavaLocalRef<jstring> ReturnAString( |
| 41 JNIEnv* env, jobject obj); |
| 42 |
39 private: | 43 private: |
40 std::map<long, std::string> map_; | 44 std::map<long, std::string> map_; |
41 | 45 |
42 DISALLOW_COPY_AND_ASSIGN(CPPClass); | 46 DISALLOW_COPY_AND_ASSIGN(CPPClass); |
43 }; | 47 }; |
44 | 48 |
45 } // namespace android | 49 } // namespace android |
46 } // namespace base | 50 } // namespace base |
OLD | NEW |