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

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

Issue 1685093002: Fix bug with TaskQueueSelector and blocked queues (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix UAF Created 4 years, 10 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 | « components/scheduler/base/task_queue_impl.cc ('k') | components/scheduler/base/task_queue_selector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/scheduler/base/task_queue_manager.cc
diff --git a/components/scheduler/base/task_queue_manager.cc b/components/scheduler/base/task_queue_manager.cc
index 4e31a868176c71e584d2a8d48338b8c57854711a..009d4ff6a206150a799946be7c9da6aee510884b 100644
--- a/components/scheduler/base/task_queue_manager.cc
+++ b/components/scheduler/base/task_queue_manager.cc
@@ -195,6 +195,8 @@ void TaskQueueManager::DoWork(base::TimeTicks run_time, bool from_main_thread) {
break;
}
+ bool should_trigger_wakeup = work_queue->task_queue()->wakeup_policy() ==
+ TaskQueue::WakeupPolicy::CAN_WAKE_OTHER_QUEUES;
switch (ProcessTaskFromWorkQueue(work_queue, &previous_task)) {
case ProcessTaskResult::DEFERRED:
// If a task was deferred, try again with another task. Note that this
@@ -206,8 +208,8 @@ void TaskQueueManager::DoWork(base::TimeTicks run_time, bool from_main_thread) {
case ProcessTaskResult::TASK_QUEUE_MANAGER_DELETED:
return; // The TaskQueueManager got deleted, we must bail out.
}
- bool should_trigger_wakeup = work_queue->task_queue()->wakeup_policy() ==
- TaskQueue::WakeupPolicy::CAN_WAKE_OTHER_QUEUES;
+ work_queue = nullptr; // The queue may have been unregistered.
+
UpdateWorkQueues(should_trigger_wakeup, &previous_task);
// Only run a single task per batch in nested run loops so that we can
« no previous file with comments | « components/scheduler/base/task_queue_impl.cc ('k') | components/scheduler/base/task_queue_selector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698