Commit e5d2aa60 authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

Migrate off BrowserThread::DeleteSoon in /chrome/browser/extensions/api/messaging

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=sergeyu@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: I4f27cfa3d6a83257fcbce08a7b85b82795a9baa0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1894880
Auto-Submit: Gabriel Charette <gab@chromium.org>
Reviewed-by: default avatarSergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712106}
parent 390ae8b4
......@@ -26,6 +26,7 @@
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/post_task.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/test_timeouts.h"
#include "base/threading/platform_thread.h"
......@@ -39,6 +40,7 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/testing_profile.h"
#include "components/version_info/version_info.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/test/browser_task_environment.h"
#include "extensions/common/extension.h"
......@@ -122,8 +124,8 @@ class NativeMessagingTest : public ::testing::Test,
void TearDown() override {
if (native_message_host_) {
BrowserThread::DeleteSoon(
BrowserThread::IO, FROM_HERE, native_message_host_.release());
base::DeleteSoon(FROM_HERE, {BrowserThread::IO},
native_message_host_.release());
}
base::RunLoop().RunUntilIdle();
}
......
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