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

Unified Diff: base/message_loop/message_loop.cc

Issue 65173003: Kick the pump when allowing nestable tasks on a message loop (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: unit test Created 7 years, 1 month 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
Index: base/message_loop/message_loop.cc
diff --git a/base/message_loop/message_loop.cc b/base/message_loop/message_loop.cc
index e03572675aa8528a04034463e9c25cb35b2a98f7..3f9d01c8620f9de69d734783e8b340661cd019ea 100644
--- a/base/message_loop/message_loop.cc
+++ b/base/message_loop/message_loop.cc
@@ -358,13 +358,12 @@ Closure MessageLoop::QuitWhenIdleClosure() {
}
void MessageLoop::SetNestableTasksAllowed(bool allowed) {
- if (nestable_tasks_allowed_ != allowed) {
- nestable_tasks_allowed_ = allowed;
- if (!nestable_tasks_allowed_)
- return;
- // Start the native pump if we are not already pumping.
+ if (allowed) {
+ // Kick the native pump just in case we enter a OS-driven nested message
+ // loop.
pump_->ScheduleWork();
}
+ nestable_tasks_allowed_ = allowed;
}
bool MessageLoop::NestableTasksAllowed() const {
« no previous file with comments | « no previous file | base/message_loop/message_loop_unittest.cc » ('j') | base/message_loop/message_loop_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698