Index: webrtc/p2p/base/tcpport.cc |
diff --git a/webrtc/p2p/base/tcpport.cc b/webrtc/p2p/base/tcpport.cc |
index ada88fb1d811b81d73f56850d2acb09fceb9c7e4..8180c72364b5cc6e3a98a32d8333ffd5b489c283 100644 |
--- a/webrtc/p2p/base/tcpport.cc |
+++ b/webrtc/p2p/base/tcpport.cc |
@@ -67,6 +67,7 @@ |
#include "webrtc/p2p/base/tcpport.h" |
#include "webrtc/p2p/base/common.h" |
+#include "webrtc/base/checks.h" |
#include "webrtc/base/common.h" |
#include "webrtc/base/logging.h" |
@@ -251,7 +252,7 @@ int TCPPort::GetError() { |
void TCPPort::OnNewConnection(rtc::AsyncPacketSocket* socket, |
rtc::AsyncPacketSocket* new_socket) { |
- ASSERT(socket == socket_); |
+ RTC_DCHECK(socket == socket_); |
Incoming incoming; |
incoming.addr = new_socket->GetRemoteAddress(); |
@@ -320,7 +321,7 @@ TCPConnection::TCPConnection(TCPPort* port, |
LOG_J(LS_VERBOSE, this) |
<< "socket ipaddr: " << socket_->GetLocalAddress().ToString() |
<< ",port() ip:" << port->ip().ToString(); |
- ASSERT(socket_->GetLocalAddress().ipaddr() == port->ip()); |
+ RTC_DCHECK(socket_->GetLocalAddress().ipaddr() == port->ip()); |
ConnectSocketSignals(socket); |
} |
} |
@@ -378,11 +379,11 @@ void TCPConnection::OnConnectionRequestResponse(ConnectionRequest* req, |
Connection::OnReadyToSend(); |
} |
pretending_to_be_writable_ = false; |
- ASSERT(write_state() == STATE_WRITABLE); |
+ RTC_DCHECK(write_state() == STATE_WRITABLE); |
} |
void TCPConnection::OnConnect(rtc::AsyncPacketSocket* socket) { |
- ASSERT(socket == socket_.get()); |
+ RTC_DCHECK(socket == socket_.get()); |
// Do not use this connection if the socket bound to a different address than |
// the one we asked for. This is seen in Chrome, where TCP sockets cannot be |
// given a binding address, and the platform is expected to pick the |
@@ -419,7 +420,7 @@ void TCPConnection::OnConnect(rtc::AsyncPacketSocket* socket) { |
} |
void TCPConnection::OnClose(rtc::AsyncPacketSocket* socket, int error) { |
- ASSERT(socket == socket_.get()); |
+ RTC_DCHECK(socket == socket_.get()); |
LOG_J(LS_INFO, this) << "Connection closed with error " << error; |
// Guard against the condition where IPC socket will call OnClose for every |
@@ -478,17 +479,17 @@ void TCPConnection::OnReadPacket( |
rtc::AsyncPacketSocket* socket, const char* data, size_t size, |
const rtc::SocketAddress& remote_addr, |
const rtc::PacketTime& packet_time) { |
- ASSERT(socket == socket_.get()); |
+ RTC_DCHECK(socket == socket_.get()); |
Connection::OnReadPacket(data, size, packet_time); |
} |
void TCPConnection::OnReadyToSend(rtc::AsyncPacketSocket* socket) { |
- ASSERT(socket == socket_.get()); |
+ RTC_DCHECK(socket == socket_.get()); |
Connection::OnReadyToSend(); |
} |
void TCPConnection::CreateOutgoingTcpSocket() { |
- ASSERT(outgoing_); |
+ RTC_DCHECK(outgoing_); |
// TODO(guoweis): Handle failures here (unlikely since TCP). |
int opts = (remote_candidate().protocol() == SSLTCP_PROTOCOL_NAME) |
? rtc::PacketSocketFactory::OPT_TLS_FAKE |