OLD | NEW |
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 #ifndef BASE_ANDROID_JNI_ANDROID_H_ | 5 #ifndef BASE_ANDROID_JNI_ANDROID_H_ |
6 #define BASE_ANDROID_JNI_ANDROID_H_ | 6 #define BASE_ANDROID_JNI_ANDROID_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 #include <sys/types.h> | 9 #include <sys/types.h> |
10 | 10 |
11 #include "base/android/scoped_java_ref.h" | 11 #include "base/android/scoped_java_ref.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 | 13 |
14 namespace base { | 14 namespace base { |
15 namespace android { | 15 namespace android { |
16 | 16 |
| 17 // Used to mark symbols to be exported in a shared library's symbol table. |
| 18 #define JNI_EXPORT __attribute__ ((visibility("default"))) |
| 19 |
17 // Attach the current thread to the VM (if necessary) and return the JNIEnv*. | 20 // Attach the current thread to the VM (if necessary) and return the JNIEnv*. |
18 JNIEnv* AttachCurrentThread(); | 21 JNIEnv* AttachCurrentThread(); |
19 | 22 |
20 // Detach the current thread from VM if it is attached. | 23 // Detach the current thread from VM if it is attached. |
21 void DetachFromVM(); | 24 void DetachFromVM(); |
22 | 25 |
23 // Initializes the global JVM. It is not necessarily called before | 26 // Initializes the global JVM. It is not necessarily called before |
24 // InitApplicationContext(). | 27 // InitApplicationContext(). |
25 void InitVM(JavaVM* vm); | 28 void InitVM(JavaVM* vm); |
26 | 29 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 // and returns true. | 127 // and returns true. |
125 bool ClearException(JNIEnv* env); | 128 bool ClearException(JNIEnv* env); |
126 | 129 |
127 // This function will call CHECK() macro if there's any pending exception. | 130 // This function will call CHECK() macro if there's any pending exception. |
128 void CheckException(JNIEnv* env); | 131 void CheckException(JNIEnv* env); |
129 | 132 |
130 } // namespace android | 133 } // namespace android |
131 } // namespace base | 134 } // namespace base |
132 | 135 |
133 #endif // BASE_ANDROID_JNI_ANDROID_H_ | 136 #endif // BASE_ANDROID_JNI_ANDROID_H_ |
OLD | NEW |