Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(304)

Side by Side Diff: webrtc/sdk/android/src/jni/jni_helpers.cc

Issue 2992103002: Relanding: Break peerconnection_jni.cc into multiple files, in "pc" directory. (Closed)
Patch Set: Add jni/androidnetworkmonitor_jni.h include for backwards comaptibility. Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/sdk/android/src/jni/jni_helpers.h ('k') | webrtc/sdk/android/src/jni/media_jni.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/sdk/android/src/jni/jni_helpers.h" 10 #include "webrtc/sdk/android/src/jni/jni_helpers.h"
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 jmethodID state_values_id = GetStaticMethodID( 266 jmethodID state_values_id = GetStaticMethodID(
267 jni, state_class, "values", ("()[L" + state_class_name + ";").c_str()); 267 jni, state_class, "values", ("()[L" + state_class_name + ";").c_str());
268 jobjectArray state_values = static_cast<jobjectArray>( 268 jobjectArray state_values = static_cast<jobjectArray>(
269 jni->CallStaticObjectMethod(state_class, state_values_id)); 269 jni->CallStaticObjectMethod(state_class, state_values_id));
270 CHECK_EXCEPTION(jni) << "error during CallStaticObjectMethod"; 270 CHECK_EXCEPTION(jni) << "error during CallStaticObjectMethod";
271 jobject ret = jni->GetObjectArrayElement(state_values, index); 271 jobject ret = jni->GetObjectArrayElement(state_values, index);
272 CHECK_EXCEPTION(jni) << "error during GetObjectArrayElement"; 272 CHECK_EXCEPTION(jni) << "error during GetObjectArrayElement";
273 return ret; 273 return ret;
274 } 274 }
275 275
276 jobject JavaEnumFromIndexAndClassName(JNIEnv* jni,
277 const std::string& state_class_fragment,
278 int index) {
279 const std::string state_class = "org/webrtc/" + state_class_fragment;
280 return JavaEnumFromIndex(jni, FindClass(jni, state_class.c_str()),
281 state_class, index);
282 }
283
276 std::string GetJavaEnumName(JNIEnv* jni, 284 std::string GetJavaEnumName(JNIEnv* jni,
277 const std::string& className, 285 const std::string& className,
278 jobject j_enum) { 286 jobject j_enum) {
279 jclass enumClass = FindClass(jni, className.c_str()); 287 jclass enumClass = FindClass(jni, className.c_str());
280 jmethodID nameMethod = 288 jmethodID nameMethod =
281 GetMethodID(jni, enumClass, "name", "()Ljava/lang/String;"); 289 GetMethodID(jni, enumClass, "name", "()Ljava/lang/String;");
282 jstring name = 290 jstring name =
283 reinterpret_cast<jstring>(jni->CallObjectMethod(j_enum, nameMethod)); 291 reinterpret_cast<jstring>(jni->CallObjectMethod(j_enum, nameMethod));
284 CHECK_EXCEPTION(jni) << "error during CallObjectMethod for " << className 292 CHECK_EXCEPTION(jni) << "error during CallObjectMethod for " << className
285 << ".name"; 293 << ".name";
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 RTC_CHECK(!AtEnd()); 379 RTC_CHECK(!AtEnd());
372 return value_; 380 return value_;
373 } 381 }
374 382
375 bool Iterable::Iterator::AtEnd() const { 383 bool Iterable::Iterator::AtEnd() const {
376 RTC_CHECK(thread_checker_.CalledOnValidThread()); 384 RTC_CHECK(thread_checker_.CalledOnValidThread());
377 return jni_ == nullptr || IsNull(jni_, iterator_); 385 return jni_ == nullptr || IsNull(jni_, iterator_);
378 } 386 }
379 387
380 } // namespace webrtc_jni 388 } // namespace webrtc_jni
OLDNEW
« no previous file with comments | « webrtc/sdk/android/src/jni/jni_helpers.h ('k') | webrtc/sdk/android/src/jni/media_jni.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698