Commit 35f357a8 authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

Migrate off BrowserThread::DeleteSoon in /content/public/test

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=sky@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: Ie715f5d61b1b0233b4e26cdb5603225ea169659a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1894887
Auto-Submit: Gabriel Charette <gab@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711761}
parent 75d50edf
......@@ -8,6 +8,7 @@
#include "base/message_loop/message_loop_current.h"
#include "base/run_loop.h"
#include "base/task/post_task.h"
#include "base/test/task_environment.h"
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
......@@ -18,6 +19,7 @@
#include "content/browser/renderer_host/render_view_host_factory.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/site_instance_impl.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_widget_host_iterator.h"
#include "content/public/browser/web_contents.h"
......@@ -291,9 +293,8 @@ void RenderViewHostTestHarness::TearDown() {
// queue. This is preferable to immediate deletion because it will behave
// properly if the |rph_factory_| reset above enqueued any tasks which
// depend on |browser_context_|.
BrowserThread::DeleteSoon(content::BrowserThread::UI,
FROM_HERE,
browser_context_.release());
base::DeleteSoon(FROM_HERE, {content::BrowserThread::UI},
browser_context_.release());
// Although this isn't required by many, some subclasses members require that
// the task environment is gone by the time that they are destroyed (akin to
......
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