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

Unified Diff: base/message_loop/message_pump_libevent.cc

Issue 245923005: libeven message-pump: Fix a particular case of nested message-loop runs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: change-string Created 6 years, 8 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 | « no previous file | base/message_loop/message_pump_libevent_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop/message_pump_libevent.cc
diff --git a/base/message_loop/message_pump_libevent.cc b/base/message_loop/message_pump_libevent.cc
index 26be687c6dd1162788415e540c2e83883bc206a9..d52025a1990ac6bb1895b35be5c22fd43862f1d2 100644
--- a/base/message_loop/message_pump_libevent.cc
+++ b/base/message_loop/message_pump_libevent.cc
@@ -217,7 +217,7 @@ static void timer_callback(int fd, short events, void *context)
// Reentrant!
void MessagePumpLibevent::Run(Delegate* delegate) {
- DCHECK(keep_running_) << "Quit must have been called outside of Run!";
+ AutoReset<bool> auto_reset_keep_running(&keep_running_, true);
AutoReset<bool> auto_reset_in_run(&in_run_, true);
// event_base_loopexit() + EVLOOP_ONCE is leaky, see http://crbug.com/25641.
@@ -275,12 +275,10 @@ void MessagePumpLibevent::Run(Delegate* delegate) {
}
}
}
-
- keep_running_ = true;
}
void MessagePumpLibevent::Quit() {
- DCHECK(in_run_);
+ DCHECK(in_run_) << "Quit was called outside of Run!";
// Tell both libevent and Run that they should break out of their loops.
keep_running_ = false;
ScheduleWork();
« no previous file with comments | « no previous file | base/message_loop/message_pump_libevent_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698