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

Unified Diff: webrtc/base/physicalsocketserver.cc

Issue 2623473004: Replace all use of the VERIFY macro. (Closed)
Patch Set: Delete a DCHECK, instead log and return failure. And fix compile error in previous patch set. Created 3 years, 10 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
Index: webrtc/base/physicalsocketserver.cc
diff --git a/webrtc/base/physicalsocketserver.cc b/webrtc/base/physicalsocketserver.cc
index 3b395ce63cf3f308838ce65818547cc295e6b512..6970388844e4a9475d62a38a0201108ebe43bd47 100644
--- a/webrtc/base/physicalsocketserver.cc
+++ b/webrtc/base/physicalsocketserver.cc
@@ -138,7 +138,9 @@ PhysicalSocket::PhysicalSocket(PhysicalSocketServer* ss, SOCKET s)
int type = SOCK_STREAM;
socklen_t len = sizeof(type);
- VERIFY(0 == getsockopt(s_, SOL_SOCKET, SO_TYPE, (SockOptArg)&type, &len));
+ const int res =
+ getsockopt(s_, SOL_SOCKET, SO_TYPE, (SockOptArg)&type, &len);
+ RTC_DCHECK_EQ(0, res);
udp_ = (SOCK_DGRAM == type);
}
}
@@ -834,9 +836,9 @@ class EventDispatcher : public Dispatcher {
CritScope cs(&crit_);
if (!fSignaled_) {
const uint8_t b[1] = {0};
- if (VERIFY(1 == write(afd_[1], b, sizeof(b)))) {
- fSignaled_ = true;
- }
+ const ssize_t res = write(afd_[1], b, sizeof(b));
+ RTC_DCHECK_EQ(1, res);
+ fSignaled_ = true;
}
}
@@ -849,7 +851,8 @@ class EventDispatcher : public Dispatcher {
CritScope cs(&crit_);
if (fSignaled_) {
uint8_t b[4]; // Allow for reading more than 1 byte, but expect 1.
- VERIFY(1 == read(afd_[0], b, sizeof(b)));
+ const ssize_t res = read(afd_[0], b, sizeof(b));
+ RTC_DCHECK_EQ(1, res);
fSignaled_ = false;
}
}

Powered by Google App Engine
This is Rietveld 408576698