Commit 16b23865 authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

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

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=peter@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: I90eed14a6f9831c6fe9317a645bfd78398855a53
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1894886
Auto-Submit: Gabriel Charette <gab@chromium.org>
Reviewed-by: default avatarPeter Beverloo <peter@chromium.org>
Commit-Queue: Peter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711724}
parent 8dad40b4
......@@ -7,12 +7,14 @@
#include <utility>
#include "base/logging.h"
#include "base/task/post_task.h"
#include "build/build_config.h"
#include "chrome/browser/notifications/fullscreen_notification_blocker.h"
#include "chrome/browser/notifications/popups_only_ui_controller.h"
#include "chrome/browser/notifications/profile_notification.h"
#include "chrome/browser/notifications/screen_lock_notification_blocker.h"
#include "chrome/browser/profiles/profile.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/url_constants.h"
......@@ -270,8 +272,8 @@ void NotificationUIManagerImpl::RemoveProfileNotification(
// b) A crash like https://crbug.com/649971 because it can trigger
// shutdown process while we're still inside the call stack from UI
// framework.
content::BrowserThread::DeleteSoon(content::BrowserThread::UI, FROM_HERE,
it->second.release());
base::DeleteSoon(FROM_HERE, {content::BrowserThread::UI},
it->second.release());
profile_notifications_.erase(it);
}
......
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