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

Unified Diff: webrtc/p2p/base/relayport.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/pseudotcp.cc ('k') | webrtc/p2p/base/relayserver.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/relayport.cc
diff --git a/webrtc/p2p/base/relayport.cc b/webrtc/p2p/base/relayport.cc
index 5d851a1195d2813000653a6ad8a48b99567b9af1..bb642372b5dbba2be486522747319eb60e6ef548 100644
--- a/webrtc/p2p/base/relayport.cc
+++ b/webrtc/p2p/base/relayport.cc
@@ -11,6 +11,7 @@
#include "webrtc/p2p/base/relayport.h"
#include "webrtc/base/asyncpacketsocket.h"
+#include "webrtc/base/checks.h"
#include "webrtc/base/helpers.h"
#include "webrtc/base/logging.h"
@@ -270,7 +271,7 @@ bool RelayPort::HasMagicCookie(const char* data, size_t size) {
void RelayPort::PrepareAddress() {
// We initiate a connect on the first entry. If this completes, it will fill
// in the server address as the address of this port.
- ASSERT(entries_.size() == 1);
+ RTC_DCHECK(entries_.size() == 1);
entries_[0]->Connect();
ready_ = false;
}
@@ -341,7 +342,7 @@ int RelayPort::SendTo(const void* data, size_t size,
// still be necessary). Otherwise, we can't yet use this connection, so we
// default to the first one.
if (!entry || !entry->connected()) {
- ASSERT(!entries_.empty());
+ RTC_DCHECK(!entries_.empty());
entry = entries_[0];
if (!entry->connected()) {
error_ = ENOTCONN;
@@ -352,7 +353,7 @@ int RelayPort::SendTo(const void* data, size_t size,
// Send the actual contents to the server using the usual mechanism.
int sent = entry->SendTo(data, size, addr, options);
if (sent <= 0) {
- ASSERT(sent < 0);
+ RTC_DCHECK(sent < 0);
error_ = entry->GetError();
return SOCKET_ERROR;
}
@@ -435,7 +436,7 @@ void RelayConnection::OnSendPacket(const void* data, size_t size,
if (sent <= 0) {
LOG(LS_VERBOSE) << "OnSendPacket: failed sending to " << GetAddress() <<
strerror(socket_->GetError());
- ASSERT(sent < 0);
+ RTC_DCHECK(sent < 0);
}
}
@@ -645,7 +646,7 @@ void RelayEntry::HandleConnectFailure(
}
void RelayEntry::OnMessage(rtc::Message *pmsg) {
- ASSERT(pmsg->message_id == kMessageConnectTimeout);
+ RTC_DCHECK(pmsg->message_id == kMessageConnectTimeout);
if (current_connection_) {
const ProtocolAddress* ra = current_connection_->protocol_address();
LOG(LS_WARNING) << "Relay " << ra->proto << " connection to " <<
@@ -684,7 +685,7 @@ void RelayEntry::OnReadPacket(
const char* data, size_t size,
const rtc::SocketAddress& remote_addr,
const rtc::PacketTime& packet_time) {
- // ASSERT(remote_addr == port_->server_addr());
+ // RTC_DCHECK(remote_addr == port_->server_addr());
// TODO: are we worried about this?
if (current_connection_ == NULL || socket != current_connection_->socket()) {
« no previous file with comments | « webrtc/p2p/base/pseudotcp.cc ('k') | webrtc/p2p/base/relayserver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698