OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 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 #include "webrtc/api/java/jni/jni_helpers.h" | 10 #include "webrtc/api/java/jni/jni_helpers.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
168 | 168 |
169 jclass GetObjectClass(JNIEnv* jni, jobject object) { | 169 jclass GetObjectClass(JNIEnv* jni, jobject object) { |
170 jclass c = jni->GetObjectClass(object); | 170 jclass c = jni->GetObjectClass(object); |
171 CHECK_EXCEPTION(jni) << "error during GetObjectClass"; | 171 CHECK_EXCEPTION(jni) << "error during GetObjectClass"; |
172 RTC_CHECK(c) << "GetObjectClass returned NULL"; | 172 RTC_CHECK(c) << "GetObjectClass returned NULL"; |
173 return c; | 173 return c; |
174 } | 174 } |
175 | 175 |
176 jobject GetObjectField(JNIEnv* jni, jobject object, jfieldID id) { | 176 jobject GetObjectField(JNIEnv* jni, jobject object, jfieldID id) { |
177 jobject o = jni->GetObjectField(object, id); | 177 jobject o = jni->GetObjectField(object, id); |
178 CHECK_EXCEPTION(jni) << "error during GetObjectField"; | 178 CHECK_EXCEPTION(jni) << "error during GetObjectField"; |
pthatcher1
2016/04/11 19:39:29
Can't you replace this with GetNullableObjectField
Taylor Brandstetter
2016/04/11 23:13:38
True.
| |
179 RTC_CHECK(o) << "GetObjectField returned NULL"; | 179 RTC_CHECK(!IsNull(jni, o)) << "GetObjectField returned NULL"; |
180 return o; | 180 return o; |
181 } | 181 } |
182 | 182 |
183 jobject GetNullableObjectField(JNIEnv* jni, jobject object, jfieldID id) { | |
184 jobject o = jni->GetObjectField(object, id); | |
185 CHECK_EXCEPTION(jni) << "error during GetObjectField"; | |
186 return o; | |
187 } | |
188 | |
183 jstring GetStringField(JNIEnv* jni, jobject object, jfieldID id) { | 189 jstring GetStringField(JNIEnv* jni, jobject object, jfieldID id) { |
184 return static_cast<jstring>(GetObjectField(jni, object, id)); | 190 return static_cast<jstring>(GetObjectField(jni, object, id)); |
185 } | 191 } |
186 | 192 |
187 jlong GetLongField(JNIEnv* jni, jobject object, jfieldID id) { | 193 jlong GetLongField(JNIEnv* jni, jobject object, jfieldID id) { |
188 jlong l = jni->GetLongField(object, id); | 194 jlong l = jni->GetLongField(object, id); |
189 CHECK_EXCEPTION(jni) << "error during GetLongField"; | 195 CHECK_EXCEPTION(jni) << "error during GetLongField"; |
190 return l; | 196 return l; |
191 } | 197 } |
192 | 198 |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
335 RTC_CHECK(!AtEnd()); | 341 RTC_CHECK(!AtEnd()); |
336 return value_; | 342 return value_; |
337 } | 343 } |
338 | 344 |
339 bool Iterable::Iterator::AtEnd() const { | 345 bool Iterable::Iterator::AtEnd() const { |
340 RTC_CHECK(thread_checker_.CalledOnValidThread()); | 346 RTC_CHECK(thread_checker_.CalledOnValidThread()); |
341 return jni_ == nullptr || IsNull(jni_, iterator_); | 347 return jni_ == nullptr || IsNull(jni_, iterator_); |
342 } | 348 } |
343 | 349 |
344 } // namespace webrtc_jni | 350 } // namespace webrtc_jni |
OLD | NEW |