Introduce RTC_CHECK_NOTREACHED(), an always-checking RTC_NOTREACHED()
And use it in a few places that were using RTC_CHECK(false) or FATAL()
to do the exact same job. There should be no change in behavior.
Bug: none
Change-Id: I36d5e6bcf35fd41534e08a8c879fa0811b4f1967
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/191963
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32567}
diff --git a/pc/dtls_transport.cc b/pc/dtls_transport.cc
index 844063d..550ede7 100644
--- a/pc/dtls_transport.cc
+++ b/pc/dtls_transport.cc
@@ -31,7 +31,7 @@
case cricket::DTLS_TRANSPORT_FAILED:
return DtlsTransportState::kFailed;
}
- RTC_CHECK(false);
+ RTC_CHECK_NOTREACHED();
}
} // namespace
diff --git a/pc/media_session.cc b/pc/media_session.cc
index 6e9a7c1..cbff216 100644
--- a/pc/media_session.cc
+++ b/pc/media_session.cc
@@ -1818,7 +1818,7 @@
case RtpTransceiverDirection::kRecvOnly:
return audio_recv_codecs_;
}
- RTC_CHECK(false);
+ RTC_CHECK_NOTREACHED();
}
const AudioCodecs& MediaSessionDescriptionFactory::GetAudioCodecsForAnswer(
@@ -1837,7 +1837,7 @@
case RtpTransceiverDirection::kRecvOnly:
return audio_recv_codecs_;
}
- RTC_CHECK(false);
+ RTC_CHECK_NOTREACHED();
}
const VideoCodecs& MediaSessionDescriptionFactory::GetVideoCodecsForOffer(
@@ -1853,7 +1853,7 @@
case RtpTransceiverDirection::kRecvOnly:
return video_recv_codecs_;
}
- RTC_CHECK(false);
+ RTC_CHECK_NOTREACHED();
}
const VideoCodecs& MediaSessionDescriptionFactory::GetVideoCodecsForAnswer(
@@ -1872,7 +1872,7 @@
case RtpTransceiverDirection::kRecvOnly:
return video_recv_codecs_;
}
- RTC_CHECK(false);
+ RTC_CHECK_NOTREACHED();
}
void MergeCodecsFromDescription(
diff --git a/pc/peer_connection.cc b/pc/peer_connection.cc
index 165968c..3760a01 100644
--- a/pc/peer_connection.cc
+++ b/pc/peer_connection.cc
@@ -2408,7 +2408,7 @@
GetIceCandidatePairCounter(local, remote),
kIceCandidatePairMax);
} else {
- RTC_CHECK(0);
+ RTC_CHECK_NOTREACHED();
}
// Increment the counter for IP type.
diff --git a/pc/peer_connection_factory.cc b/pc/peer_connection_factory.cc
index b8d9084..da42e5a 100644
--- a/pc/peer_connection_factory.cc
+++ b/pc/peer_connection_factory.cc
@@ -141,7 +141,7 @@
case cricket::MEDIA_TYPE_UNSUPPORTED:
return RtpCapabilities();
}
- RTC_CHECK(false);
+ RTC_CHECK_NOTREACHED();
}
RtpCapabilities PeerConnectionFactory::GetRtpReceiverCapabilities(
@@ -167,7 +167,7 @@
case cricket::MEDIA_TYPE_UNSUPPORTED:
return RtpCapabilities();
}
- RTC_CHECK(false);
+ RTC_CHECK_NOTREACHED();
}
rtc::scoped_refptr<AudioSourceInterface>
diff --git a/pc/rtc_stats_collector.cc b/pc/rtc_stats_collector.cc
index 6f14e1e..5b21d33 100644
--- a/pc/rtc_stats_collector.cc
+++ b/pc/rtc_stats_collector.cc
@@ -216,7 +216,7 @@
case QualityLimitationReason::kOther:
return RTCQualityLimitationReason::kOther;
}
- RTC_CHECK(false);
+ RTC_CHECK_NOTREACHED();
}
double DoubleAudioLevelFromIntAudioLevel(int audio_level) {
diff --git a/pc/rtp_parameters_conversion.cc b/pc/rtp_parameters_conversion.cc
index 80e56b8..68a948e 100644
--- a/pc/rtp_parameters_conversion.cc
+++ b/pc/rtp_parameters_conversion.cc
@@ -76,7 +76,7 @@
}
return cricket::FeedbackParam(cricket::kRtcpFbParamTransportCc);
}
- RTC_CHECK(false);
+ RTC_CHECK_NOTREACHED();
}
template <typename C>