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

Unified Diff: webrtc/p2p/base/stunrequest.cc

Issue 2620303003: Replace ASSERT by RTC_DCHECK in all non-test code. (Closed)
Patch Set: Address final nits. Created 3 years, 11 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/base/stunport.cc ('k') | webrtc/p2p/base/tcpport.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/stunrequest.cc
diff --git a/webrtc/p2p/base/stunrequest.cc b/webrtc/p2p/base/stunrequest.cc
index 5886cc9defdd71d047c49e569d86e3f1e18bfc95..d97f18ccd202d23d429f587b91f4f0814c8689a5 100644
--- a/webrtc/p2p/base/stunrequest.cc
+++ b/webrtc/p2p/base/stunrequest.cc
@@ -13,6 +13,7 @@
#include <algorithm>
#include <memory>
+#include "webrtc/base/checks.h"
#include "webrtc/base/common.h"
#include "webrtc/base/helpers.h"
#include "webrtc/base/logging.h"
@@ -44,7 +45,7 @@ void StunRequestManager::Send(StunRequest* request) {
void StunRequestManager::SendDelayed(StunRequest* request, int delay) {
request->set_manager(this);
- ASSERT(requests_.find(request->id()) == requests_.end());
+ RTC_DCHECK(requests_.find(request->id()) == requests_.end());
request->set_origin(origin_);
request->Construct();
requests_[request->id()] = request;
@@ -76,10 +77,10 @@ bool StunRequestManager::HasRequest(int msg_type) {
}
void StunRequestManager::Remove(StunRequest* request) {
- ASSERT(request->manager() == this);
+ RTC_DCHECK(request->manager() == this);
RequestMap::iterator iter = requests_.find(request->id());
if (iter != requests_.end()) {
- ASSERT(iter->second == request);
+ RTC_DCHECK(iter->second == request);
requests_.erase(iter);
thread_->Clear(request);
}
@@ -165,7 +166,7 @@ StunRequest::StunRequest(StunMessage* request)
}
StunRequest::~StunRequest() {
- ASSERT(manager_ != NULL);
+ RTC_DCHECK(manager_ != NULL);
if (manager_) {
manager_->Remove(this);
manager_->thread_->Clear(this);
@@ -180,12 +181,12 @@ void StunRequest::Construct() {
origin_));
}
Prepare(msg_);
- ASSERT(msg_->type() != 0);
+ RTC_DCHECK(msg_->type() != 0);
}
}
int StunRequest::type() {
- ASSERT(msg_ != NULL);
+ RTC_DCHECK(msg_ != NULL);
return msg_->type();
}
@@ -199,13 +200,13 @@ int StunRequest::Elapsed() const {
void StunRequest::set_manager(StunRequestManager* manager) {
- ASSERT(!manager_);
+ RTC_DCHECK(!manager_);
manager_ = manager;
}
void StunRequest::OnMessage(rtc::Message* pmsg) {
- ASSERT(manager_ != NULL);
- ASSERT(pmsg->message_id == MSG_STUN_SEND);
+ RTC_DCHECK(manager_ != NULL);
+ RTC_DCHECK(pmsg->message_id == MSG_STUN_SEND);
if (timeout_) {
OnTimeout();
« no previous file with comments | « webrtc/p2p/base/stunport.cc ('k') | webrtc/p2p/base/tcpport.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698