Android: Add option to print native stack traces in PeerConnectionFactory API

This CL hooks up the recently added native stack trace functionality to
the existing PeerConnectionFactory API.

Bug: webrtc:10168
Change-Id: I16189d2988b1359fc53f9a4d0b3d06f34e2a8fd5
Reviewed-on: https://webrtc-review.googlesource.com/c/118600
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26344}
This commit is contained in:
Magnus Jedvert
2019-01-20 13:44:45 +01:00
committed by Commit Bot
parent 1b761ca21a
commit 443760d4ba
3 changed files with 59 additions and 23 deletions

View File

@ -26,6 +26,7 @@
#include "rtc_base/thread.h"
#include "sdk/android/generated_peerconnection_jni/jni/PeerConnectionFactory_jni.h"
#include "sdk/android/native_api/jni/java_types.h"
#include "sdk/android/native_api/stacktrace/stacktrace.h"
#include "sdk/android/src/jni/jni_helpers.h"
#include "sdk/android/src/jni/logging/log_sink.h"
#include "sdk/android/src/jni/pc/android_network_monitor.h"
@ -515,5 +516,9 @@ static void JNI_PeerConnectionFactory_DeleteLoggable(JNIEnv* jni) {
}
}
static void JNI_PeerConnectionFactory_PrintStackTrace(JNIEnv* env, jint tid) {
RTC_LOG(LS_WARNING) << StackTraceToString(GetStackTrace(tid));
}
} // namespace jni
} // namespace webrtc