Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(282)

Unified Diff: webrtc/pc/datachannel.cc

Issue 2988153003: Replace CHECK(x && y) with two separate CHECK() calls (Closed)
Patch Set: fix mistakes Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/p2p/client/basicportallocator.cc ('k') | webrtc/pc/remoteaudiosource.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/datachannel.cc
diff --git a/webrtc/pc/datachannel.cc b/webrtc/pc/datachannel.cc
index ce0aa14d4e3c2ee4afa6d917f56941bbce7f61ea..28c090dee66fde7320ed4f4095cf95dd6689193a 100644
--- a/webrtc/pc/datachannel.cc
+++ b/webrtc/pc/datachannel.cc
@@ -282,8 +282,9 @@ void DataChannel::RemotePeerRequestClose() {
}
void DataChannel::SetSctpSid(int sid) {
- RTC_DCHECK(config_.id < 0 && sid >= 0 &&
- data_channel_type_ == cricket::DCT_SCTP);
+ RTC_DCHECK_LT(config_.id, 0);
+ RTC_DCHECK_GE(sid, 0);
+ RTC_DCHECK_EQ(data_channel_type_, cricket::DCT_SCTP);
if (config_.id == sid) {
return;
}
@@ -618,8 +619,10 @@ void DataChannel::QueueControlMessage(const rtc::CopyOnWriteBuffer& buffer) {
bool DataChannel::SendControlMessage(const rtc::CopyOnWriteBuffer& buffer) {
bool is_open_message = handshake_state_ == kHandshakeShouldSendOpen;
- RTC_DCHECK(data_channel_type_ == cricket::DCT_SCTP && writable_ &&
- config_.id >= 0 && (!is_open_message || !config_.negotiated));
+ RTC_DCHECK_EQ(data_channel_type_, cricket::DCT_SCTP);
+ RTC_DCHECK(writable_);
+ RTC_DCHECK_GE(config_.id, 0);
+ RTC_DCHECK(!is_open_message || !config_.negotiated);
cricket::SendDataParams send_params;
send_params.sid = config_.id;
« no previous file with comments | « webrtc/p2p/client/basicportallocator.cc ('k') | webrtc/pc/remoteaudiosource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698