Introduce dchecked_cast, and start using it
It's the faster, less strict cousin of checked_cast.
BUG=none
Review-Url: https://codereview.webrtc.org/2714063002
Cr-Commit-Position: refs/heads/master@{#16958}
diff --git a/webrtc/modules/audio_coding/acm2/acm_receiver.cc b/webrtc/modules/audio_coding/acm2/acm_receiver.cc
index fd4e91a..1577d2d 100644
--- a/webrtc/modules/audio_coding/acm2/acm_receiver.cc
+++ b/webrtc/modules/audio_coding/acm2/acm_receiver.cc
@@ -162,7 +162,7 @@
audio_frame->sample_rate_hz_ = desired_freq_hz;
RTC_DCHECK_EQ(
audio_frame->sample_rate_hz_,
- rtc::checked_cast<int>(audio_frame->samples_per_channel_ * 100));
+ rtc::dchecked_cast<int>(audio_frame->samples_per_channel_ * 100));
resampled_last_output_frame_ = true;
} else {
resampled_last_output_frame_ = false;
diff --git a/webrtc/modules/audio_coding/acm2/audio_coding_module.cc b/webrtc/modules/audio_coding/acm2/audio_coding_module.cc
index 32e6940..daeea35 100644
--- a/webrtc/modules/audio_coding/acm2/audio_coding_module.cc
+++ b/webrtc/modules/audio_coding/acm2/audio_coding_module.cc
@@ -370,7 +370,7 @@
frag->fragmentationOffset[i] = offset;
offset += info.redundant[i].encoded_bytes;
frag->fragmentationLength[i] = info.redundant[i].encoded_bytes;
- frag->fragmentationTimeDiff[i] = rtc::checked_cast<uint16_t>(
+ frag->fragmentationTimeDiff[i] = rtc::dchecked_cast<uint16_t>(
info.encoded_timestamp - info.redundant[i].encoded_timestamp);
frag->fragmentationPlType[i] = info.redundant[i].payload_type;
}