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

Unified Diff: base/message_pump_libevent.cc

Issue 7262011: Change MessagePumpLibevent::Run to handle IO events before doing idle (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: A better solution Created 9 years, 6 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 | « base/message_pump_libevent.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_pump_libevent.cc
===================================================================
--- base/message_pump_libevent.cc (revision 90695)
+++ base/message_pump_libevent.cc (working copy)
@@ -107,6 +107,7 @@
MessagePumpLibevent::MessagePumpLibevent()
: keep_running_(true),
in_run_(false),
+ processed_io_events_(false),
event_base_(event_base_new()),
wakeup_pipe_in_(-1),
wakeup_pipe_out_(-1) {
@@ -226,6 +227,10 @@
if (!keep_running_)
break;
+ event_base_loop(event_base_, EVLOOP_NONBLOCK);
+ did_work |= processed_io_events_;
+ processed_io_events_ = false;
+
did_work |= delegate->DoDelayedWork(&delayed_work_time_);
if (!keep_running_)
break;
@@ -295,6 +300,7 @@
void MessagePumpLibevent::DidProcessIOEvent() {
FOR_EACH_OBSERVER(IOObserver, io_observers_, DidProcessIOEvent());
+ processed_io_events_ = true;
}
bool MessagePumpLibevent::Init() {
« no previous file with comments | « base/message_pump_libevent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698