Add munge-allowed histogram

This allows us to track how many ufrag munges that do not
hit the restriction filters.

Bug: b/409713509
Change-Id: Ic6f0bd714d26a3c5b97496df5afa99c51df89611
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/391180
Reviewed-by: Johannes Kron <kron@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#44977}
diff --git a/pc/sdp_offer_answer.cc b/pc/sdp_offer_answer.cc
index 990ec3e..9227a0e 100644
--- a/pc/sdp_offer_answer.cc
+++ b/pc/sdp_offer_answer.cc
@@ -5338,6 +5338,7 @@
     const std::string host = candidate->candidate().address().HostAsURIString();
     const std::vector<absl::string_view> restricted_address_list =
         absl::StrSplit(restricted_addresses, '|');
+    bool allowed = true;
     for (const absl::string_view restricted_address : restricted_address_list) {
       const std::pair<absl::string_view, absl::string_view> address =
           absl::StrSplit(restricted_address, ':');
@@ -5358,11 +5359,14 @@
         RTC_HISTOGRAM_ENUMERATION_SPARSE(
             "WebRTC.PeerConnection.RestrictedCandidates.Port",
             candidate->candidate().address().port(), 65536);
-        return false;
+        allowed = false;
+        break;
       }
     }
+    RTC_HISTOGRAM_BOOLEAN(
+        "WebRTC.PeerConnection.RestrictedCandidates.MungeAllowed", allowed);
+    return allowed;
   }
-
   return true;
 }