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

Unified Diff: webrtc/base/socketpool.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/base/socketaddress.cc ('k') | webrtc/base/socketstream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/socketpool.cc
diff --git a/webrtc/base/socketpool.cc b/webrtc/base/socketpool.cc
index cdd54bb659e62fa12f5c2837d798603708d5ad74..f316193b6e50f53e118aaf417813faafbc467e30 100644
--- a/webrtc/base/socketpool.cc
+++ b/webrtc/base/socketpool.cc
@@ -151,14 +151,14 @@ ReuseSocketPool::ReuseSocketPool(SocketFactory* factory)
}
ReuseSocketPool::~ReuseSocketPool() {
- ASSERT(!checked_out_);
+ RTC_DCHECK(!checked_out_);
delete stream_;
}
StreamInterface*
ReuseSocketPool::RequestConnectedStream(const SocketAddress& remote, int* err) {
// Only one socket can be used from this "pool" at a time
- ASSERT(!checked_out_);
+ RTC_DCHECK(!checked_out_);
if (!stream_) {
LOG_F(LS_VERBOSE) << "Creating new socket";
int family = remote.family();
@@ -198,8 +198,8 @@ ReuseSocketPool::RequestConnectedStream(const SocketAddress& remote, int* err) {
void
ReuseSocketPool::ReturnConnectedStream(StreamInterface* stream) {
- ASSERT(stream == stream_);
- ASSERT(checked_out_);
+ RTC_DCHECK(stream == stream_);
+ RTC_DCHECK(checked_out_);
checked_out_ = false;
// Until the socket is reused, monitor it to determine if it closes.
stream_->SignalEvent.connect(this, &ReuseSocketPool::OnStreamEvent);
@@ -207,8 +207,8 @@ ReuseSocketPool::ReturnConnectedStream(StreamInterface* stream) {
void
ReuseSocketPool::OnStreamEvent(StreamInterface* stream, int events, int err) {
- ASSERT(stream == stream_);
- ASSERT(!checked_out_);
+ RTC_DCHECK(stream == stream_);
+ RTC_DCHECK(!checked_out_);
// If the stream was written to and then immediately returned to us then
// we may get a writable notification for it, which we should ignore.
@@ -220,7 +220,7 @@ ReuseSocketPool::OnStreamEvent(StreamInterface* stream, int events, int err) {
// If the peer sent data, we can't process it, so drop the connection.
// If the socket has closed, clean it up.
// In either case, we'll reconnect it the next time it is used.
- ASSERT(0 != (events & (SE_READ|SE_CLOSE)));
+ RTC_DCHECK(0 != (events & (SE_READ | SE_CLOSE)));
if (0 != (events & SE_CLOSE)) {
LOG_F(LS_VERBOSE) << "Connection closed with error: " << err;
} else {
@@ -250,7 +250,7 @@ LoggingPoolAdapter::~LoggingPoolAdapter() {
StreamInterface* LoggingPoolAdapter::RequestConnectedStream(
const SocketAddress& remote, int* err) {
if (StreamInterface* stream = pool_->RequestConnectedStream(remote, err)) {
- ASSERT(SS_CLOSED != stream->GetState());
+ RTC_DCHECK(SS_CLOSED != stream->GetState());
std::stringstream ss;
ss << label_ << "(0x" << std::setfill('0') << std::hex << std::setw(8)
<< stream << ")";
« no previous file with comments | « webrtc/base/socketaddress.cc ('k') | webrtc/base/socketstream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698