Commit b7526e4f authored by Patrick Monette's avatar Patrick Monette Committed by Commit Bot

[Task Manager] Properly clear worker tasks on profile shutdown.

Fixes PerProfileWorkerTaskTracker so that the WorkerTaskTracker is
notified when there are outstanding tasks that are about to be
deleted.

Bug: 1060506
Change-Id: Ic81ad1557c1e27a8fc96fc079f7447efcc2ce7f3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2110350
Auto-Submit: Patrick Monette <pmonette@chromium.org>
Commit-Queue: Ahmed Fakhry <afakhry@chromium.org>
Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#751915}
parent 60f281dd
...@@ -47,7 +47,16 @@ PerProfileWorkerTaskTracker::PerProfileWorkerTaskTracker( ...@@ -47,7 +47,16 @@ PerProfileWorkerTaskTracker::PerProfileWorkerTaskTracker(
} }
} }
PerProfileWorkerTaskTracker::~PerProfileWorkerTaskTracker() = default; PerProfileWorkerTaskTracker::~PerProfileWorkerTaskTracker() {
// Notify the |worker_task_provider_| for all outstanding tasks that are about
// to be deleted.
for (const auto& kv : dedicated_worker_tasks_)
worker_task_provider_->OnWorkerTaskRemoved(kv.second.get());
for (const auto& kv : shared_worker_tasks_)
worker_task_provider_->OnWorkerTaskRemoved(kv.second.get());
for (const auto& kv : service_worker_tasks_)
worker_task_provider_->OnWorkerTaskRemoved(kv.second.get());
}
void PerProfileWorkerTaskTracker::OnWorkerStarted( void PerProfileWorkerTaskTracker::OnWorkerStarted(
content::DedicatedWorkerId dedicated_worker_id, content::DedicatedWorkerId dedicated_worker_id,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment