summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-17 22:26:06 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-17 22:26:06 +0000
commit3fae228c4dc1f4d69c08cec45dcbb715ef29d725 (patch)
treeef0575f29b74e44071694609f74c8ae8d70fb230 /base
parent04adfd4b3b342286cc3eb465be2186b0f9dd9e6d (diff)
downloadchromium_src-3fae228c4dc1f4d69c08cec45dcbb715ef29d725.zip
chromium_src-3fae228c4dc1f4d69c08cec45dcbb715ef29d725.tar.gz
chromium_src-3fae228c4dc1f4d69c08cec45dcbb715ef29d725.tar.bz2
Minor DCHECK cleanups in libevent.
DCHECK=>DCHECK_EQ where possible. Change a DCHECK not to fire on write() returning -1 && errno==EAGAIN, since this happens normally under heavy load. Review URL: http://codereview.chromium.org/42295 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11919 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/message_pump_libevent.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/base/message_pump_libevent.cc b/base/message_pump_libevent.cc
index 0b849c5..2f828ba 100644
--- a/base/message_pump_libevent.cc
+++ b/base/message_pump_libevent.cc
@@ -65,7 +65,7 @@ void MessagePumpLibevent::OnWakeup(int socket, short flags, void* context) {
// Remove and discard the wakeup byte.
char buf;
int nread = read(socket, &buf, 1);
- DCHECK(nread == 1);
+ DCHECK_EQ(nread, 1);
// Tell libevent to break out of inner loop.
event_base_loopbreak(that->event_base_);
}
@@ -250,7 +250,8 @@ void MessagePumpLibevent::ScheduleWork() {
// Tell libevent (in a threadsafe way) that it should break out of its loop.
char buf = 0;
int nwrite = write(wakeup_pipe_in_, &buf, 1);
- DCHECK(nwrite == 1);
+ DCHECK(nwrite == 1 || errno == EAGAIN)
+ << "[nwrite:" << nwrite << "] [errno:" << errno << "]";
}
void MessagePumpLibevent::ScheduleDelayedWork(const Time& delayed_work_time) {