From 844c759766d3a804fdf55b3d73320b447ed648a8 Mon Sep 17 00:00:00 2001 From: Philipp Hancke Date: Mon, 18 Jan 2021 11:25:31 +0100 Subject: [PATCH] fix variable naming in ReportSdpFormatReceived it no longer reports just offers. BUG=chromium:857004 Change-Id: Idf35b6fa98f3ee6637aeef6b11553947fea3ee25 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/202249 Reviewed-by: Harald Alvestrand Commit-Queue: Philipp Hancke Cr-Commit-Position: refs/heads/master@{#33024} --- pc/peer_connection.cc | 9 +++++---- pc/peer_connection.h | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pc/peer_connection.cc b/pc/peer_connection.cc index eb68a5be90..b5af73580c 100644 --- a/pc/peer_connection.cc +++ b/pc/peer_connection.cc @@ -2269,12 +2269,13 @@ bool PeerConnection::ValidateBundleSettings(const SessionDescription* desc) { } void PeerConnection::ReportSdpFormatReceived( - const SessionDescriptionInterface& remote_offer) { + const SessionDescriptionInterface& remote_description) { int num_audio_mlines = 0; int num_video_mlines = 0; int num_audio_tracks = 0; int num_video_tracks = 0; - for (const ContentInfo& content : remote_offer.description()->contents()) { + for (const ContentInfo& content : + remote_description.description()->contents()) { cricket::MediaType media_type = content.media_description()->type(); int num_tracks = std::max( 1, static_cast(content.media_description()->streams().size())); @@ -2294,7 +2295,7 @@ void PeerConnection::ReportSdpFormatReceived( } else if (num_audio_tracks > 0 || num_video_tracks > 0) { format = kSdpFormatReceivedSimple; } - switch (remote_offer.GetType()) { + switch (remote_description.GetType()) { case SdpType::kOffer: // Historically only offers were counted. RTC_HISTOGRAM_ENUMERATION("WebRTC.PeerConnection.SdpFormatReceived", @@ -2306,7 +2307,7 @@ void PeerConnection::ReportSdpFormatReceived( break; default: RTC_LOG(LS_ERROR) << "Can not report SdpFormatReceived for " - << SdpTypeToString(remote_offer.GetType()); + << SdpTypeToString(remote_description.GetType()); break; } } diff --git a/pc/peer_connection.h b/pc/peer_connection.h index 8768ebb133..65d893e59e 100644 --- a/pc/peer_connection.h +++ b/pc/peer_connection.h @@ -379,8 +379,9 @@ class PeerConnection : public PeerConnectionInternal, void SetIceConnectionState(IceConnectionState new_state); void NoteUsageEvent(UsageEvent event); - // Report the UMA metric SdpFormatReceived for the given remote offer. - void ReportSdpFormatReceived(const SessionDescriptionInterface& remote_offer); + // Report the UMA metric SdpFormatReceived for the given remote description. + void ReportSdpFormatReceived( + const SessionDescriptionInterface& remote_description); // Returns true if the PeerConnection is configured to use Unified Plan // semantics for creating offers/answers and setting local/remote