From 2e18061033d36923b2377cbb31dd64e4494f49d2 Mon Sep 17 00:00:00 2001 From: Harald Alvestrand Date: Wed, 7 Mar 2018 10:56:14 +0100 Subject: [PATCH] Count key protocol for all media sections MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will give accurate stats for the number of calls that use video that are using SDES. Bug: chromium:804275 Change-Id: I35b045a2301fb5267b656b424b9b3482b1b72f9a Reviewed-on: https://webrtc-review.googlesource.com/60481 Commit-Queue: Harald Alvestrand Reviewed-by: Henrik Boström Cr-Commit-Position: refs/heads/master@{#22324} --- pc/peerconnection.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pc/peerconnection.cc b/pc/peerconnection.cc index b8bc67dc44..3df7ebf8aa 100644 --- a/pc/peerconnection.cc +++ b/pc/peerconnection.cc @@ -430,6 +430,11 @@ RTCError VerifyCrypto(const SessionDescription* desc, if (content_info.rejected) { continue; } + // Note what media is used with each crypto protocol, for all sections. + NoteKeyProtocolAndMedia(dtls_enabled ? webrtc::kEnumCounterKeyProtocolDtls + : webrtc::kEnumCounterKeyProtocolSdes, + content_info.media_description()->type(), + uma_observer); const std::string& mid = content_info.name; if (bundle && bundle->HasContentName(mid) && mid != *(bundle->FirstContentName())) { @@ -455,16 +460,12 @@ RTCError VerifyCrypto(const SessionDescription* desc, return RTCError(RTCErrorType::INVALID_PARAMETER, kSdpWithoutDtlsFingerprint); } - NoteKeyProtocolAndMedia(webrtc::kEnumCounterKeyProtocolDtls, - media->type(), uma_observer); } else { if (media->cryptos().empty()) { RTC_LOG(LS_WARNING) << "Session description must have SDES when DTLS disabled."; return RTCError(RTCErrorType::INVALID_PARAMETER, kSdpWithoutSdesCrypto); } - NoteKeyProtocolAndMedia(webrtc::kEnumCounterKeyProtocolSdes, - media->type(), uma_observer); } } return RTCError::OK();