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

Unified Diff: webrtc/p2p/base/turnport.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/p2p/base/turnport.cc
diff --git a/webrtc/p2p/base/turnport.cc b/webrtc/p2p/base/turnport.cc
index 9ecc75ea2867c01c7e73122fc74bceff97c3385d..7e0e64d6edacaf97751c3cbc56d18ca9a6f88dad 100644
--- a/webrtc/p2p/base/turnport.cc
+++ b/webrtc/p2p/base/turnport.cc
@@ -927,14 +927,15 @@ void TurnPort::SendRequest(StunRequest* req, int delay) {
void TurnPort::AddRequestAuthInfo(StunMessage* msg) {
// If we've gotten the necessary data from the server, add it to our request.
- VERIFY(!hash_.empty());
+ RTC_DCHECK(!hash_.empty());
msg->AddAttribute(new StunByteStringAttribute(
STUN_ATTR_USERNAME, credentials_.username));
msg->AddAttribute(new StunByteStringAttribute(
STUN_ATTR_REALM, realm_));
msg->AddAttribute(new StunByteStringAttribute(
STUN_ATTR_NONCE, nonce_));
- VERIFY(msg->AddMessageIntegrity(hash()));
+ const bool success = msg->AddMessageIntegrity(hash());
+ RTC_DCHECK(success);
}
int TurnPort::Send(const void* data, size_t len,
@@ -943,8 +944,9 @@ int TurnPort::Send(const void* data, size_t len,
}
void TurnPort::UpdateHash() {
- VERIFY(ComputeStunCredentialHash(credentials_.username, realm_,
- credentials_.password, &hash_));
+ const bool success = ComputeStunCredentialHash(credentials_.username, realm_,
+ credentials_.password, &hash_);
+ RTC_DCHECK(success);
}
bool TurnPort::UpdateNonce(StunMessage* response) {
@@ -1475,7 +1477,8 @@ int TurnEntry::Send(const void* data, size_t size, bool payload,
STUN_ATTR_XOR_PEER_ADDRESS, ext_addr_));
msg.AddAttribute(new StunByteStringAttribute(
STUN_ATTR_DATA, data, size));
- VERIFY(msg.Write(&buf));
+ const bool success = msg.Write(&buf);
+ RTC_DCHECK(success);
// If we're sending real data, request a channel bind that we can use later.
if (state_ == STATE_UNBOUND && payload) {

Powered by Google App Engine
This is Rietveld 408576698