Commit 361ae1f6 authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

Migrate off BrowserThread::DeleteSoon in /chrome/browser/profiles

Instead use base::DeleteSoon which enforces usage of TaskTraits.

This CL is a no-op as-is. It was recently discovered however that some
callers did BrowserThread::DeleteSoon() with pending tasks running on
different task queues (different traits  -- e.g.

TaskTraits to make this more obvious. Please review whether calls in
this CL can be migrated as-is or need additional traits to match
potentially pending tasks.

Split from https://chromium-review.googlesource.com/c/chromium/src/+/1894109
for cursory review.

This CL was uploaded by git cl split.

R=droger@chromium.org


TaskPriority: :BEST_EFFORT) which can result in out-of-order deletion...
BrowserThread: :DeleteSoon() is being migrated to base::DeleteSoon() w/
Bug: 1019767
Change-Id: I563267ff70c01c99f28da788a361b678a60caa8d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1893539
Auto-Submit: Gabriel Charette <gab@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Commit-Queue: David Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712074}
parent f394053b
......@@ -382,8 +382,8 @@ void ProfileAttributesStorage::SaveAvatarImageAtPath(
if (downloader_iter != avatar_images_downloads_in_progress_.end()) {
// We mustn't delete the avatar downloader right here, since we're being
// called by it.
content::BrowserThread::DeleteSoon(content::BrowserThread::UI, FROM_HERE,
downloader_iter->second.release());
base::DeleteSoon(FROM_HERE, {content::BrowserThread::UI},
downloader_iter->second.release());
avatar_images_downloads_in_progress_.erase(downloader_iter);
}
......
......@@ -491,7 +491,7 @@ void ProfileIOData::ShutdownOnUIThread() {
safe_browsing_enabled_.Destroy();
bool posted = BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this);
bool posted = base::DeleteSoon(FROM_HERE, {BrowserThread::IO}, this);
if (!posted)
delete this;
}
......
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