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

Unified Diff: components/scheduler/base/task_queue_impl.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 | « no previous file | components/scheduler/base/task_queue_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/scheduler/base/task_queue_impl.cc
diff --git a/components/scheduler/base/task_queue_impl.cc b/components/scheduler/base/task_queue_impl.cc
index 5f0b4a195738556a673db891b2286de768de7102..5ce23f16f3ce201e1181628959bd6f5fa423a794 100644
--- a/components/scheduler/base/task_queue_impl.cc
+++ b/components/scheduler/base/task_queue_impl.cc
@@ -127,8 +127,8 @@ void TaskQueueImpl::UnregisterTaskQueue() {
main_thread_only().task_queue_manager = nullptr;
main_thread_only().delayed_incoming_queue = std::priority_queue<Task>();
any_thread().immediate_incoming_queue = std::queue<Task>();
- main_thread_only().immediate_work_queue->Clear();
- main_thread_only().delayed_work_queue->Clear();
+ main_thread_only().immediate_work_queue.reset();
+ main_thread_only().delayed_work_queue.reset();
}
bool TaskQueueImpl::RunsTasksOnCurrentThread() const {
@@ -488,7 +488,7 @@ const char* TaskQueueImpl::GetName() const {
}
void TaskQueueImpl::SetQueuePriority(QueuePriority priority) {
- if (!main_thread_only().task_queue_manager)
+ if (!main_thread_only().task_queue_manager || priority == GetQueuePriority())
return;
main_thread_only().task_queue_manager->selector_.SetQueuePriority(this,
priority);
« no previous file with comments | « no previous file | components/scheduler/base/task_queue_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698