From 22d32f1a6c0662562eaa9240669bfe987060fb89 Mon Sep 17 00:00:00 2001 From: Harald Alvestrand Date: Mon, 3 Oct 2022 13:16:28 +0000 Subject: [PATCH] Remove the KeyProtocol metric MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that SDES is (largely) removed, this is no longer useful. Bug: chromium:1365484 Change-Id: I3e626a7d5d83130a70958851de3df0aa27616bd2 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/277781 Reviewed-by: Henrik Boström Commit-Queue: Harald Alvestrand Cr-Commit-Position: refs/heads/main@{#38278} --- api/uma_metrics.h | 8 -------- pc/peer_connection_integrationtest.cc | 12 ------------ pc/sdp_offer_answer.cc | 11 +++-------- 3 files changed, 3 insertions(+), 28 deletions(-) diff --git a/api/uma_metrics.h b/api/uma_metrics.h index c4fecf0269..9eb3bf7e1f 100644 --- a/api/uma_metrics.h +++ b/api/uma_metrics.h @@ -83,14 +83,6 @@ enum IceCandidatePairType { // occurrences of events, while "Name" has a value associated with it which is // used to form a histogram. -// These values are persisted to logs. Entries should not be renumbered and -// numeric values should never be reused. -enum KeyExchangeProtocolType { - kEnumCounterKeyProtocolDtls = 0, - kEnumCounterKeyProtocolSdes = 1, - kEnumCounterKeyProtocolMax -}; - // These values are persisted to logs. Entries should not be renumbered and // numeric values should never be reused. enum KeyExchangeProtocolMedia { diff --git a/pc/peer_connection_integrationtest.cc b/pc/peer_connection_integrationtest.cc index ffe64fe8d8..19cc6ce3cf 100644 --- a/pc/peer_connection_integrationtest.cc +++ b/pc/peer_connection_integrationtest.cc @@ -268,12 +268,6 @@ TEST_P(PeerConnectionIntegrationTest, EndToEndCallWithDtls) { MediaExpectations media_expectations; media_expectations.ExpectBidirectionalAudioAndVideo(); ASSERT_TRUE(ExpectNewFrames(media_expectations)); - EXPECT_METRIC_LE( - 2, webrtc::metrics::NumEvents("WebRTC.PeerConnection.KeyProtocol", - webrtc::kEnumCounterKeyProtocolDtls)); - EXPECT_METRIC_EQ( - 0, webrtc::metrics::NumEvents("WebRTC.PeerConnection.KeyProtocol", - webrtc::kEnumCounterKeyProtocolSdes)); } #if defined(WEBRTC_FUCHSIA) @@ -293,12 +287,6 @@ TEST_P(PeerConnectionIntegrationTest, EndToEndCallWithSdes) { MediaExpectations media_expectations; media_expectations.ExpectBidirectionalAudioAndVideo(); ASSERT_TRUE(ExpectNewFrames(media_expectations)); - EXPECT_METRIC_LE( - 2, webrtc::metrics::NumEvents("WebRTC.PeerConnection.KeyProtocol", - webrtc::kEnumCounterKeyProtocolSdes)); - EXPECT_METRIC_EQ( - 0, webrtc::metrics::NumEvents("WebRTC.PeerConnection.KeyProtocol", - webrtc::kEnumCounterKeyProtocolDtls)); } #endif diff --git a/pc/sdp_offer_answer.cc b/pc/sdp_offer_answer.cc index 7b41fceb09..758a50c2c9 100644 --- a/pc/sdp_offer_answer.cc +++ b/pc/sdp_offer_answer.cc @@ -133,11 +133,6 @@ void NoteAddIceCandidateResult(int result) { kAddIceCandidateMax); } -void NoteKeyProtocol(KeyExchangeProtocolType protocol_type) { - RTC_HISTOGRAM_ENUMERATION("WebRTC.PeerConnection.KeyProtocol", protocol_type, - kEnumCounterKeyProtocolMax); -} - std::map GetBundleGroupsByMid( const SessionDescription* desc) { std::vector bundle_groups = @@ -331,9 +326,9 @@ RTCError VerifyCrypto(const SessionDescription* desc, if (content_info.rejected) { continue; } - // Note what media is used with each crypto protocol, for all sections. - NoteKeyProtocol(dtls_enabled ? webrtc::kEnumCounterKeyProtocolDtls - : webrtc::kEnumCounterKeyProtocolSdes); +#if !defined(WEBRTC_FUCHSIA) + RTC_CHECK(dtls_enabled) << "SDES protocol is only allowed in Fuchsia"; +#endif const std::string& mid = content_info.name; auto it = bundle_groups_by_mid.find(mid); const cricket::ContentGroup* bundle =