| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 // Wraps the jclass object on which we can call GetMethodId() functions to | 57 // Wraps the jclass object on which we can call GetMethodId() functions to |
| 58 // query method IDs. | 58 // query method IDs. |
| 59 class JavaClass { | 59 class JavaClass { |
| 60 public: | 60 public: |
| 61 JavaClass(JNIEnv* jni, jclass clazz) : jni_(jni), j_class_(clazz) {} | 61 JavaClass(JNIEnv* jni, jclass clazz) : jni_(jni), j_class_(clazz) {} |
| 62 ~JavaClass() {} | 62 ~JavaClass() {} |
| 63 | 63 |
| 64 jmethodID GetMethodId(const char* name, const char* signature); | 64 jmethodID GetMethodId(const char* name, const char* signature); |
| 65 jmethodID GetStaticMethodId(const char* name, const char* signature); | 65 jmethodID GetStaticMethodId(const char* name, const char* signature); |
| 66 jobject CallStaticObjectMethod(jmethodID methodID, ...); | 66 jobject CallStaticObjectMethod(jmethodID methodID, ...); |
| 67 jint CallStaticIntMethod(jmethodID methodID, ...); |
| 67 | 68 |
| 68 protected: | 69 protected: |
| 69 JNIEnv* const jni_; | 70 JNIEnv* const jni_; |
| 70 jclass const j_class_; | 71 jclass const j_class_; |
| 71 }; | 72 }; |
| 72 | 73 |
| 73 // Adds support of the NewObject factory method to the JavaClass class. | 74 // Adds support of the NewObject factory method to the JavaClass class. |
| 74 // See example in JVM for more details on how to use it. | 75 // See example in JVM for more details on how to use it. |
| 75 class NativeRegistration : public JavaClass { | 76 class NativeRegistration : public JavaClass { |
| 76 public: | 77 public: |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 JNIEnv* jni() const { return GetEnv(jvm_); } | 178 JNIEnv* jni() const { return GetEnv(jvm_); } |
| 178 | 179 |
| 179 rtc::ThreadChecker thread_checker_; | 180 rtc::ThreadChecker thread_checker_; |
| 180 JavaVM* const jvm_; | 181 JavaVM* const jvm_; |
| 181 jobject context_; | 182 jobject context_; |
| 182 }; | 183 }; |
| 183 | 184 |
| 184 } // namespace webrtc | 185 } // namespace webrtc |
| 185 | 186 |
| 186 #endif // WEBRTC_MODULES_UTILITY_INCLUDE_JVM_ANDROID_H_ | 187 #endif // WEBRTC_MODULES_UTILITY_INCLUDE_JVM_ANDROID_H_ |
| OLD | NEW |