Remove the KeyProtocol metric

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 <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38278}
diff --git a/api/uma_metrics.h b/api/uma_metrics.h
index c4fecf0..9eb3bf7 100644
--- a/api/uma_metrics.h
+++ b/api/uma_metrics.h
@@ -85,14 +85,6 @@
 
 // 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 {
   kEnumCounterKeyProtocolMediaTypeDtlsAudio = 0,
   kEnumCounterKeyProtocolMediaTypeDtlsVideo = 1,
diff --git a/pc/peer_connection_integrationtest.cc b/pc/peer_connection_integrationtest.cc
index ffe64fe..19cc6ce 100644
--- a/pc/peer_connection_integrationtest.cc
+++ b/pc/peer_connection_integrationtest.cc
@@ -268,12 +268,6 @@
   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 @@
   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 7b41fce..758a50c 100644
--- a/pc/sdp_offer_answer.cc
+++ b/pc/sdp_offer_answer.cc
@@ -133,11 +133,6 @@
                             kAddIceCandidateMax);
 }
 
-void NoteKeyProtocol(KeyExchangeProtocolType protocol_type) {
-  RTC_HISTOGRAM_ENUMERATION("WebRTC.PeerConnection.KeyProtocol", protocol_type,
-                            kEnumCounterKeyProtocolMax);
-}
-
 std::map<std::string, const cricket::ContentGroup*> GetBundleGroupsByMid(
     const SessionDescription* desc) {
   std::vector<const cricket::ContentGroup*> bundle_groups =
@@ -331,9 +326,9 @@
     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 =