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

Side by Side Diff: webrtc/api/java/jni/peerconnection_jni.cc

Issue 2110853003: Separate the JNI function that controls logging levels into two. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Separated the tracing/logging enabled flags Created 4 years, 5 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 | « no previous file | webrtc/base/java/src/org/webrtc/Logging.java » ('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 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2013 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 866 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 binary)); 877 binary));
878 jni->ReleaseByteArrayElements(data, bytes, JNI_ABORT); 878 jni->ReleaseByteArrayElements(data, bytes, JNI_ABORT);
879 return ret; 879 return ret;
880 } 880 }
881 881
882 JOW(void, DataChannel_dispose)(JNIEnv* jni, jobject j_dc) { 882 JOW(void, DataChannel_dispose)(JNIEnv* jni, jobject j_dc) {
883 CHECK_RELEASE(ExtractNativeDC(jni, j_dc)); 883 CHECK_RELEASE(ExtractNativeDC(jni, j_dc));
884 } 884 }
885 885
886 JOW(void, Logging_nativeEnableTracing)( 886 JOW(void, Logging_nativeEnableTracing)(
887 JNIEnv* jni, jclass, jstring j_path, jint nativeLevels, 887 JNIEnv* jni, jclass, jstring j_path, jint nativeLevels) {
888 jint nativeSeverity) {
889 std::string path = JavaToStdString(jni, j_path); 888 std::string path = JavaToStdString(jni, j_path);
890 if (nativeLevels != webrtc::kTraceNone) { 889 if (nativeLevels != webrtc::kTraceNone) {
891 webrtc::Trace::set_level_filter(nativeLevels); 890 webrtc::Trace::set_level_filter(nativeLevels);
892 if (path != "logcat:") { 891 if (path != "logcat:") {
893 RTC_CHECK_EQ(0, webrtc::Trace::SetTraceFile(path.c_str(), false)) 892 RTC_CHECK_EQ(0, webrtc::Trace::SetTraceFile(path.c_str(), false))
894 << "SetTraceFile failed"; 893 << "SetTraceFile failed";
895 } else { 894 } else {
896 // Intentionally leak this to avoid needing to reason about its lifecycle. 895 // Intentionally leak this to avoid needing to reason about its lifecycle.
897 // It keeps no state and functions only as a dispatch point. 896 // It keeps no state and functions only as a dispatch point.
898 static LogcatTraceContext* g_trace_callback = new LogcatTraceContext(); 897 static LogcatTraceContext* g_trace_callback = new LogcatTraceContext();
899 } 898 }
900 } 899 }
901 if (nativeSeverity >= rtc::LS_SENSITIVE && nativeSeverity <= rtc::LS_ERROR) { 900 }
901
902 JOW(void, Logging_nativeEnableLogToDebugOutput)
903 (JNIEnv *jni, jclass, jint nativeSeverity) {
904 if (nativeSeverity >= rtc::LS_SENSITIVE && nativeSeverity <= rtc::LS_NONE) {
902 rtc::LogMessage::LogToDebug( 905 rtc::LogMessage::LogToDebug(
903 static_cast<rtc::LoggingSeverity>(nativeSeverity)); 906 static_cast<rtc::LoggingSeverity>(nativeSeverity));
904 } 907 }
905 } 908 }
906 909
907 JOW(void, Logging_nativeEnableLogThreads)(JNIEnv* jni, jclass) { 910 JOW(void, Logging_nativeEnableLogThreads)(JNIEnv* jni, jclass) {
908 rtc::LogMessage::LogThreads(true); 911 rtc::LogMessage::LogThreads(true);
909 } 912 }
910 913
911 JOW(void, Logging_nativeEnableLogTimeStamps)(JNIEnv* jni, jclass) { 914 JOW(void, Logging_nativeEnableLogTimeStamps)(JNIEnv* jni, jclass) {
(...skipping 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after
2288 return JavaStringFromStdString( 2291 return JavaStringFromStdString(
2289 jni, 2292 jni,
2290 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); 2293 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id());
2291 } 2294 }
2292 2295
2293 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { 2296 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) {
2294 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); 2297 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release();
2295 } 2298 }
2296 2299
2297 } // namespace webrtc_jni 2300 } // namespace webrtc_jni
OLDNEW
« no previous file with comments | « no previous file | webrtc/base/java/src/org/webrtc/Logging.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698