Index: webrtc/base/socketstream.cc |
diff --git a/webrtc/base/socketstream.cc b/webrtc/base/socketstream.cc |
index 9dc8794ebc0f2a125f99e7f6759edc8b89c9646c..9407c96795f805194531c52278892a2f850757c7 100644 |
--- a/webrtc/base/socketstream.cc |
+++ b/webrtc/base/socketstream.cc |
@@ -10,6 +10,8 @@ |
#include "webrtc/base/socketstream.h" |
+#include "webrtc/base/checks.h" |
+ |
namespace rtc { |
SocketStream::SocketStream(AsyncSocket* socket) : socket_(NULL) { |
@@ -45,7 +47,7 @@ AsyncSocket* SocketStream::Detach() { |
} |
StreamState SocketStream::GetState() const { |
- ASSERT(socket_ != NULL); |
+ RTC_DCHECK(socket_ != NULL); |
switch (socket_->GetState()) { |
case Socket::CS_CONNECTED: |
return SS_OPEN; |
@@ -59,7 +61,7 @@ StreamState SocketStream::GetState() const { |
StreamResult SocketStream::Read(void* buffer, size_t buffer_len, |
size_t* read, int* error) { |
- ASSERT(socket_ != NULL); |
+ RTC_DCHECK(socket_ != NULL); |
int result = socket_->Recv(buffer, buffer_len, nullptr); |
if (result < 0) { |
if (socket_->IsBlocking()) |
@@ -78,7 +80,7 @@ StreamResult SocketStream::Read(void* buffer, size_t buffer_len, |
StreamResult SocketStream::Write(const void* data, size_t data_len, |
size_t* written, int* error) { |
- ASSERT(socket_ != NULL); |
+ RTC_DCHECK(socket_ != NULL); |
int result = socket_->Send(data, data_len); |
if (result < 0) { |
if (socket_->IsBlocking()) |
@@ -93,27 +95,27 @@ StreamResult SocketStream::Write(const void* data, size_t data_len, |
} |
void SocketStream::Close() { |
- ASSERT(socket_ != NULL); |
+ RTC_DCHECK(socket_ != NULL); |
socket_->Close(); |
} |
void SocketStream::OnConnectEvent(AsyncSocket* socket) { |
- ASSERT(socket == socket_); |
+ RTC_DCHECK(socket == socket_); |
SignalEvent(this, SE_OPEN | SE_READ | SE_WRITE, 0); |
} |
void SocketStream::OnReadEvent(AsyncSocket* socket) { |
- ASSERT(socket == socket_); |
+ RTC_DCHECK(socket == socket_); |
SignalEvent(this, SE_READ, 0); |
} |
void SocketStream::OnWriteEvent(AsyncSocket* socket) { |
- ASSERT(socket == socket_); |
+ RTC_DCHECK(socket == socket_); |
SignalEvent(this, SE_WRITE, 0); |
} |
void SocketStream::OnCloseEvent(AsyncSocket* socket, int err) { |
- ASSERT(socket == socket_); |
+ RTC_DCHECK(socket == socket_); |
SignalEvent(this, SE_CLOSE, err); |
} |