diff --git a/webrtc/api/peerconnection.cc b/webrtc/api/peerconnection.cc index 2f21e0c468..1a29e55124 100644 --- a/webrtc/api/peerconnection.cc +++ b/webrtc/api/peerconnection.cc @@ -327,7 +327,7 @@ RTCErrorType ParseIceServerUrl( default: // We shouldn't get to this point with an invalid service_type, we should // have returned an error already. - RTC_DCHECK(false) << "Unexpected service type"; + RTC_NOTREACHED() << "Unexpected service type"; return RTCErrorType::INTERNAL_ERROR; } return RTCErrorType::NONE; @@ -548,7 +548,7 @@ std::string GenerateRtcpCname() { std::string cname; if (!rtc::CreateRandomString(kRtcpCnameLength, &cname)) { LOG(LS_ERROR) << "Failed to generate CNAME."; - RTC_DCHECK(false); + RTC_NOTREACHED(); } return cname; } @@ -1617,7 +1617,7 @@ void PeerConnection::OnMessage(rtc::Message* msg) { break; } default: - RTC_DCHECK(false && "Not implemented"); + RTC_NOTREACHED() << "Not implemented"; break; } } @@ -2042,7 +2042,7 @@ void PeerConnection::OnRemoteTrackSeen(const std::string& stream_label, } else if (media_type == cricket::MEDIA_TYPE_VIDEO) { CreateVideoReceiver(stream, track_id, ssrc); } else { - RTC_DCHECK(false && "Invalid media type"); + RTC_NOTREACHED() << "Invalid media type"; } } diff --git a/webrtc/api/quicdatachannel.cc b/webrtc/api/quicdatachannel.cc index 5493382e1a..2ab2a3444f 100644 --- a/webrtc/api/quicdatachannel.cc +++ b/webrtc/api/quicdatachannel.cc @@ -173,7 +173,7 @@ void QuicDataChannel::OnQueuedBytesWritten(net::QuicStreamId stream_id, SetBufferedAmount_w(buffered_amount_ - queued_bytes_written); const auto& kv = write_blocked_quic_streams_.find(stream_id); if (kv == write_blocked_quic_streams_.end()) { - RTC_DCHECK(false); + RTC_NOTREACHED(); return; } cricket::ReliableQuicStream* stream = kv->second; @@ -301,7 +301,7 @@ void QuicDataChannel::OnDataReceived(net::QuicStreamId stream_id, RTC_DCHECK(data); const auto& kv = incoming_quic_messages_.find(stream_id); if (kv == incoming_quic_messages_.end()) { - RTC_DCHECK(false); + RTC_NOTREACHED(); return; } Message& message = kv->second; diff --git a/webrtc/api/quicdatatransport.cc b/webrtc/api/quicdatatransport.cc index ff3ac09335..44143ccdf7 100644 --- a/webrtc/api/quicdatatransport.cc +++ b/webrtc/api/quicdatatransport.cc @@ -134,7 +134,7 @@ void QuicDataTransport::OnDataReceived(net::QuicStreamId id, size_t len) { const auto& quic_stream_kv = quic_stream_by_id_.find(id); if (quic_stream_kv == quic_stream_by_id_.end()) { - RTC_DCHECK(false); + RTC_NOTREACHED(); return; } cricket::ReliableQuicStream* stream = quic_stream_kv->second; diff --git a/webrtc/api/rtpreceiver.cc b/webrtc/api/rtpreceiver.cc index 80a0256a02..a5a764c048 100644 --- a/webrtc/api/rtpreceiver.cc +++ b/webrtc/api/rtpreceiver.cc @@ -66,7 +66,7 @@ void AudioRtpReceiver::OnSetVolume(double volume) { // setting the volume to the source when the track is disabled. if (!stopped_ && track_->enabled()) { if (!channel_->SetOutputVolume(ssrc_, cached_volume_)) { - RTC_DCHECK(false); + RTC_NOTREACHED(); } } } @@ -107,7 +107,7 @@ void AudioRtpReceiver::Reconfigure() { } if (!channel_->SetOutputVolume(ssrc_, track_->enabled() ? cached_volume_ : 0)) { - RTC_DCHECK(false); + RTC_NOTREACHED(); } } @@ -161,7 +161,7 @@ VideoRtpReceiver::VideoRtpReceiver(MediaStreamInterface* stream, << "VideoRtpReceiver::VideoRtpReceiver: No video channel exists."; } else { if (!channel_->SetSink(ssrc_, &broadcaster_)) { - RTC_DCHECK(false); + RTC_NOTREACHED(); } } stream->AddTrack(track_); @@ -225,7 +225,7 @@ void VideoRtpReceiver::SetChannel(cricket::VideoChannel* channel) { channel_ = channel; if (channel_) { if (!channel_->SetSink(ssrc_, &broadcaster_)) { - RTC_DCHECK(false); + RTC_NOTREACHED(); } channel_->SignalFirstPacketReceived.connect( this, &VideoRtpReceiver::OnFirstPacketReceived); diff --git a/webrtc/api/rtpsender.cc b/webrtc/api/rtpsender.cc index 61f53b4d80..bb5526a497 100644 --- a/webrtc/api/rtpsender.cc +++ b/webrtc/api/rtpsender.cc @@ -388,7 +388,7 @@ void VideoRtpSender::SetVideoSend() { break; } if (!channel_->SetVideoSend(ssrc_, track_->enabled(), &options, track_)) { - RTC_DCHECK(false); + RTC_NOTREACHED(); } } diff --git a/webrtc/api/statscollector.cc b/webrtc/api/statscollector.cc index fb6583ab91..8347424b2f 100644 --- a/webrtc/api/statscollector.cc +++ b/webrtc/api/statscollector.cc @@ -351,7 +351,7 @@ const char* IceCandidateTypeToStatsType(const std::string& candidate_type) { if (candidate_type == cricket::RELAY_PORT_TYPE) { return STATSREPORT_RELAY_PORT_TYPE; } - RTC_DCHECK(false); + RTC_NOTREACHED(); return "unknown"; } @@ -370,7 +370,7 @@ const char* AdapterTypeToStatsType(rtc::AdapterType type) { case rtc::ADAPTER_TYPE_LOOPBACK: return STATSREPORT_ADAPTER_TYPE_LOOPBACK; default: - RTC_DCHECK(false); + RTC_NOTREACHED(); return ""; } } diff --git a/webrtc/api/statstypes.cc b/webrtc/api/statstypes.cc index 4a5bd69b9d..0b3e38e3c7 100644 --- a/webrtc/api/statstypes.cc +++ b/webrtc/api/statstypes.cc @@ -57,7 +57,7 @@ const char* InternalTypeToString(StatsReport::StatsType type) { case StatsReport::kStatsReportTypeDataChannel: return "datachannel"; } - RTC_DCHECK(false); + RTC_NOTREACHED(); return nullptr; } diff --git a/webrtc/api/webrtcsession.cc b/webrtc/api/webrtcsession.cc index e312c819f8..e662896fad 100644 --- a/webrtc/api/webrtcsession.cc +++ b/webrtc/api/webrtcsession.cc @@ -411,7 +411,7 @@ static std::string GetErrorCodeString(webrtc::WebRtcSession::Error err) { GET_STRING_OF_ERROR_CODE(ERROR_CONTENT) GET_STRING_OF_ERROR_CODE(ERROR_TRANSPORT) default: - RTC_DCHECK(false); + RTC_NOTREACHED(); break; } return result; @@ -1192,7 +1192,7 @@ cricket::IceConfig WebRtcSession::ParseIceConfig( gathering_policy = cricket::GATHER_CONTINUALLY; break; default: - RTC_DCHECK(false); + RTC_NOTREACHED(); gathering_policy = cricket::GATHER_ONCE; } cricket::IceConfig ice_config; diff --git a/webrtc/base/network.cc b/webrtc/base/network.cc index a999fcb45c..1eb6289322 100644 --- a/webrtc/base/network.cc +++ b/webrtc/base/network.cc @@ -111,7 +111,7 @@ std::string AdapterTypeToString(AdapterType type) { case ADAPTER_TYPE_LOOPBACK: return "Loopback"; default: - RTC_DCHECK(false) << "Invalid type " << type; + RTC_NOTREACHED() << "Invalid type " << type; return std::string(); } } diff --git a/webrtc/base/stringencode.cc b/webrtc/base/stringencode.cc index ab04d02856..7c11a05e3e 100644 --- a/webrtc/base/stringencode.cc +++ b/webrtc/base/stringencode.cc @@ -119,7 +119,7 @@ const char* unsafe_filename_characters() { return "\\/:*?\"<>|"; #else // !WEBRTC_WIN // TODO(grunell): Should this never be reached? - RTC_DCHECK(false); + RTC_NOTREACHED(); return ""; #endif // !WEBRTC_WIN } @@ -274,7 +274,7 @@ size_t html_encode(char * buffer, size_t buflen, case '\'': escseq = "'"; esclen = 5; break; case '\"': escseq = """; esclen = 6; break; case '&': escseq = "&"; esclen = 5; break; - default: RTC_DCHECK(false); + default: RTC_NOTREACHED(); } if (bufpos + esclen >= buflen) { break; @@ -331,7 +331,7 @@ size_t xml_encode(char * buffer, size_t buflen, case '\'': escseq = "'"; esclen = 6; break; case '\"': escseq = """; esclen = 6; break; case '&': escseq = "&"; esclen = 5; break; - default: RTC_DCHECK(false); + default: RTC_NOTREACHED(); } if (bufpos + esclen >= buflen) { break; diff --git a/webrtc/base/timeutils.cc b/webrtc/base/timeutils.cc index c424f701f7..509b6958f5 100644 --- a/webrtc/base/timeutils.cc +++ b/webrtc/base/timeutils.cc @@ -47,7 +47,7 @@ int64_t SystemTimeNanos() { // Get the timebase if this is the first time we run. // Recommended by Apple's QA1398. if (mach_timebase_info(&timebase) != KERN_SUCCESS) { - RTC_DCHECK(false); + RTC_NOTREACHED(); } } // Use timebase to convert absolute time tick units into nanoseconds. diff --git a/webrtc/base/virtualsocketserver.cc b/webrtc/base/virtualsocketserver.cc index da2cb1d741..cf975b1927 100644 --- a/webrtc/base/virtualsocketserver.cc +++ b/webrtc/base/virtualsocketserver.cc @@ -430,7 +430,7 @@ void VirtualSocket::OnMessage(Message* pmsg) { } else if (pmsg->message_id == MSG_ID_ADDRESS_BOUND) { SignalAddressReady(this, GetLocalAddress()); } else { - RTC_DCHECK(false); + RTC_NOTREACHED(); } } @@ -689,7 +689,7 @@ int VirtualSocketServer::Bind(VirtualSocket* socket, SocketAddress* addr) { if (!IPIsUnspec(addr->ipaddr())) { addr->SetIP(addr->ipaddr().Normalized()); } else { - RTC_DCHECK(false); + RTC_NOTREACHED(); } if (addr->port() == 0) { diff --git a/webrtc/common_audio/vad/vad.cc b/webrtc/common_audio/vad/vad.cc index 77de5166db..e634aa2ffd 100644 --- a/webrtc/common_audio/vad/vad.cc +++ b/webrtc/common_audio/vad/vad.cc @@ -37,7 +37,7 @@ class VadImpl final : public Vad { case 1: return kActive; default: - RTC_DCHECK(false) << "WebRtcVad_Process returned an error."; + RTC_NOTREACHED() << "WebRtcVad_Process returned an error."; return kError; } } diff --git a/webrtc/media/engine/webrtcvideoengine2.cc b/webrtc/media/engine/webrtcvideoengine2.cc index e43cb7e6e2..f09b2541d9 100644 --- a/webrtc/media/engine/webrtcvideoengine2.cc +++ b/webrtc/media/engine/webrtcvideoengine2.cc @@ -1743,7 +1743,7 @@ WebRtcVideoChannel2::WebRtcVideoSendStream::CreateVideoEncoder( // This shouldn't happen, we should not be trying to create something we don't // support. - RTC_DCHECK(false); + RTC_NOTREACHED(); return AllocatedEncoder(NULL, cricket::VideoCodec(), false); } diff --git a/webrtc/modules/audio_processing/echo_control_mobile_impl.cc b/webrtc/modules/audio_processing/echo_control_mobile_impl.cc index e8b163b894..a9457d96d9 100644 --- a/webrtc/modules/audio_processing/echo_control_mobile_impl.cc +++ b/webrtc/modules/audio_processing/echo_control_mobile_impl.cc @@ -33,7 +33,7 @@ int16_t MapSetting(EchoControlMobile::RoutingMode mode) { case EchoControlMobile::kLoudSpeakerphone: return 4; } - RTC_DCHECK(false); + RTC_NOTREACHED(); return -1; } diff --git a/webrtc/modules/audio_processing/gain_control_impl.cc b/webrtc/modules/audio_processing/gain_control_impl.cc index 704cfade09..ce0872e883 100644 --- a/webrtc/modules/audio_processing/gain_control_impl.cc +++ b/webrtc/modules/audio_processing/gain_control_impl.cc @@ -30,7 +30,7 @@ int16_t MapSetting(GainControl::Mode mode) { case GainControl::kFixedDigital: return kAgcModeFixedDigital; } - RTC_DCHECK(false); + RTC_NOTREACHED(); return -1; } diff --git a/webrtc/modules/audio_processing/ns/nsx_core.c b/webrtc/modules/audio_processing/ns/nsx_core.c index c58fc39bac..acd8b702b0 100644 --- a/webrtc/modules/audio_processing/ns/nsx_core.c +++ b/webrtc/modules/audio_processing/ns/nsx_core.c @@ -1545,7 +1545,7 @@ void WebRtcNsx_ProcessCore(NoiseSuppressionFixedC* inst, #ifdef NS_FILEDEBUG if (fwrite(spframe, sizeof(short), inst->blockLen10ms, inst->infile) != inst->blockLen10ms) { - RTC_DCHECK(false); + RTC_NOTREACHED(); } #endif @@ -2025,7 +2025,7 @@ void WebRtcNsx_ProcessCore(NoiseSuppressionFixedC* inst, #ifdef NS_FILEDEBUG if (fwrite(outframe, sizeof(short), inst->blockLen10ms, inst->outfile) != inst->blockLen10ms) { - RTC_DCHECK(false); + RTC_NOTREACHED(); } #endif diff --git a/webrtc/modules/audio_processing/test/bitexactness_tools.cc b/webrtc/modules/audio_processing/test/bitexactness_tools.cc index 59b9325ad7..9c8a97ce0c 100644 --- a/webrtc/modules/audio_processing/test/bitexactness_tools.cc +++ b/webrtc/modules/audio_processing/test/bitexactness_tools.cc @@ -32,7 +32,7 @@ std::string GetApmRenderTestVectorFileName(int sample_rate_hz) { case 48000: return ResourcePath("far48_stereo", "pcm"); default: - RTC_DCHECK(false); + RTC_NOTREACHED(); } return ""; } @@ -48,7 +48,7 @@ std::string GetApmCaptureTestVectorFileName(int sample_rate_hz) { case 48000: return ResourcePath("near48_stereo", "pcm"); default: - RTC_DCHECK(false); + RTC_NOTREACHED(); } return ""; } diff --git a/webrtc/modules/desktop_capture/screen_drawer_linux.cc b/webrtc/modules/desktop_capture/screen_drawer_linux.cc index c78e6843fe..0dd4036219 100644 --- a/webrtc/modules/desktop_capture/screen_drawer_linux.cc +++ b/webrtc/modules/desktop_capture/screen_drawer_linux.cc @@ -83,7 +83,7 @@ ScreenDrawerLinux::ScreenDrawerLinux() { if (!XGetWindowAttributes(display_->display(), RootWindow(display_->display(), screen_num_), &root_attributes)) { - RTC_DCHECK(false) << "Failed to get root window size."; + RTC_NOTREACHED() << "Failed to get root window size."; } window_ = XCreateSimpleWindow( display_->display(), RootWindow(display_->display(), screen_num_), 0, 0, @@ -105,7 +105,7 @@ ScreenDrawerLinux::ScreenDrawerLinux() { if (!XTranslateCoordinates(display_->display(), window_, RootWindow(display_->display(), screen_num_), 0, 0, &x, &y, &child)) { - RTC_DCHECK(false) << "Failed to get window position."; + RTC_NOTREACHED() << "Failed to get window position."; } // Some window manager does not allow a window to cover two or more monitors. // So if the window is on the first monitor of a two-monitor system, the diff --git a/webrtc/p2p/base/dtlstransportchannel.cc b/webrtc/p2p/base/dtlstransportchannel.cc index 8aea40c79a..02f3d594b5 100644 --- a/webrtc/p2p/base/dtlstransportchannel.cc +++ b/webrtc/p2p/base/dtlstransportchannel.cc @@ -633,7 +633,7 @@ void DtlsTransportChannelWrapper::MaybeStartDtls() { // packets in this state, the incoming queue must be empty. We // ignore write errors, thus any errors must be because of // configuration and therefore are our fault. - RTC_DCHECK(false) << "StartSSL failed."; + RTC_NOTREACHED() << "StartSSL failed."; LOG_J(LS_ERROR, this) << "Couldn't start DTLS handshake"; set_dtls_state(DTLS_TRANSPORT_FAILED); return; diff --git a/webrtc/p2p/base/p2ptransportchannel.cc b/webrtc/p2p/base/p2ptransportchannel.cc index 3fdaf0bad8..3fef947109 100644 --- a/webrtc/p2p/base/p2ptransportchannel.cc +++ b/webrtc/p2p/base/p2ptransportchannel.cc @@ -1420,7 +1420,7 @@ void P2PTransportChannel::UpdateState() { RTC_DCHECK(state == STATE_CONNECTING || state == STATE_COMPLETED); break; default: - RTC_DCHECK(false); + RTC_NOTREACHED(); break; } state_ = state; @@ -1759,7 +1759,7 @@ bool P2PTransportChannel::GetUseCandidateAttr(Connection* conn, return selected || better_than_selected; } default: - RTC_DCHECK(false); + RTC_NOTREACHED(); return false; } } diff --git a/webrtc/p2p/base/transportcontroller.cc b/webrtc/p2p/base/transportcontroller.cc index 7d60397955..c9ba9fdb3c 100644 --- a/webrtc/p2p/base/transportcontroller.cc +++ b/webrtc/p2p/base/transportcontroller.cc @@ -759,7 +759,7 @@ void TransportController::OnChannelCandidateGathered_n( // We should never signal peer-reflexive candidates. if (candidate.type() == PRFLX_PORT_TYPE) { - RTC_DCHECK(false); + RTC_NOTREACHED(); return; } std::vector candidates; diff --git a/webrtc/p2p/client/basicportallocator.cc b/webrtc/p2p/client/basicportallocator.cc index 806f69c2e1..943a846704 100644 --- a/webrtc/p2p/client/basicportallocator.cc +++ b/webrtc/p2p/client/basicportallocator.cc @@ -58,7 +58,7 @@ int GetProtocolPriority(cricket::ProtocolType protocol) { case cricket::PROTO_SSLTCP: return 0; default: - RTC_DCHECK(false); + RTC_NOTREACHED(); return 0; } } @@ -70,7 +70,7 @@ int GetAddressFamilyPriority(int ip_family) { case AF_INET: return 1; default: - RTC_DCHECK(false); + RTC_NOTREACHED(); return 0; } } diff --git a/webrtc/pc/channel.cc b/webrtc/pc/channel.cc index 56335e24d0..45141c8d0f 100644 --- a/webrtc/pc/channel.cc +++ b/webrtc/pc/channel.cc @@ -738,7 +738,7 @@ bool BaseChannel::SendPacket(bool rtcp, // (and SetSend(true) is called). LOG(LS_ERROR) << "Can't send outgoing RTP packet when SRTP is inactive" << " and crypto is required"; - RTC_DCHECK(false); + RTC_NOTREACHED(); return false; } @@ -998,7 +998,7 @@ bool BaseChannel::SetupDtlsSrtp_n(bool rtcp_channel) { NULL, 0, false, &dtls_buffer[0], dtls_buffer.size())) { LOG(LS_WARNING) << "DTLS-SRTP key export failed"; - RTC_DCHECK(false); // This should never happen + RTC_NOTREACHED(); // This should never happen return false; } diff --git a/webrtc/sdk/android/src/jni/androidnetworkmonitor_jni.cc b/webrtc/sdk/android/src/jni/androidnetworkmonitor_jni.cc index 3eb3f07413..9f9f5c02ea 100644 --- a/webrtc/sdk/android/src/jni/androidnetworkmonitor_jni.cc +++ b/webrtc/sdk/android/src/jni/androidnetworkmonitor_jni.cc @@ -84,7 +84,7 @@ static rtc::AdapterType AdapterTypeFromNetworkType(NetworkType network_type) { // Map it to VPN for now. return rtc::ADAPTER_TYPE_VPN; default: - RTC_DCHECK(false) << "Invalid network type " << network_type; + RTC_NOTREACHED() << "Invalid network type " << network_type; return rtc::ADAPTER_TYPE_UNKNOWN; } } diff --git a/webrtc/voice_engine/output_mixer.cc b/webrtc/voice_engine/output_mixer.cc index 32a7c4e012..61babd2750 100644 --- a/webrtc/voice_engine/output_mixer.cc +++ b/webrtc/voice_engine/output_mixer.cc @@ -475,7 +475,7 @@ OutputMixer::DoOperationsOnCombinedSignal(bool feed_data_to_apm) if (_audioProcessingModulePtr->ProcessReverseStream(&_audioFrame) != 0) { WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId, -1), "AudioProcessingModule::ProcessReverseStream() => error"); - RTC_DCHECK(false); + RTC_NOTREACHED(); } }