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

Unified Diff: components/scheduler/child/task_queue_manager.cc

Issue 1252143002: scheduler: Don't run multiple tasks per batch in a nested run loop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Build fix. Created 5 years, 5 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 | components/scheduler/child/task_queue_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/scheduler/child/task_queue_manager.cc
diff --git a/components/scheduler/child/task_queue_manager.cc b/components/scheduler/child/task_queue_manager.cc
index 5f06d6a7fe98298be636e572ff14068acad98f60..55bd4f74d7eab2af51214e93b185530a32b2046d 100644
--- a/components/scheduler/child/task_queue_manager.cc
+++ b/components/scheduler/child/task_queue_manager.cc
@@ -155,6 +155,11 @@ void TaskQueueManager::DoWork(bool posted_from_main_thread) {
TaskQueue::WakeupPolicy::CAN_WAKE_OTHER_QUEUES;
if (!UpdateWorkQueues(should_trigger_wakeup, &previous_task))
return;
+
+ // Only run a single task per batch in nested run loops so that we can
+ // properly exit the nested loop when someone calls RunLoop::Quit().
+ if (main_task_runner_->IsNested())
+ break;
}
}
« no previous file with comments | « no previous file | components/scheduler/child/task_queue_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698