sdp munging: separate "unable to parse description" error code
instead of considering this an unknown modification. It should not
be happening in practice and is done to have a pointer-is-not-null
check.
Bug: None
Change-Id: If0519fb4c70822d08434e3c78218a9fd193c92c2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/403402
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#45305}
diff --git a/api/uma_metrics.h b/api/uma_metrics.h
index 3a3dac3..8ba1d7d 100644
--- a/api/uma_metrics.h
+++ b/api/uma_metrics.h
@@ -185,6 +185,7 @@
kWithoutCreateAnswer = 2,
kWithoutCreateOffer = 3,
kNumberOfContents = 4,
+ kCurrentDescriptionFailedToParse = 5, // This is an internal error.
// Transport-related munging.
kIceOptions = 20,
kIcePwd = 21,
diff --git a/pc/sdp_munging_detector.cc b/pc/sdp_munging_detector.cc
index 4456972..58e580b 100644
--- a/pc/sdp_munging_detector.cc
+++ b/pc/sdp_munging_detector.cc
@@ -372,7 +372,10 @@
const SessionDescriptionInterface* last_created_desc) {
if (!sdesc || !sdesc->description()) {
RTC_LOG(LS_WARNING) << "SDP munging: Failed to parse session description.";
- return SdpMungingType::kUnknownModification;
+ // This is done to ensure the pointers are valid and should not happen at
+ // this point.
+ RTC_DCHECK_NOTREACHED();
+ return SdpMungingType::kCurrentDescriptionFailedToParse;
}
if (!last_created_desc || !last_created_desc->description()) {