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

Migrate off base::ThreadPool()-as-a-trait in /components/feedback

This CL is a logical no-op.

It manually covers the use cases the script
(https://crbug.com/1026641#c22) didn't cover in
https://chromium-review.googlesource.com/c/chromium/src/+/2026350.

A few of the affected files were also migrated to
content::GetUIThreadTaskRunner() whenever surrounding code consistency
was at stake (but the bulk of that migration is staged to happen after
this one so this wasn't a priority in this batch).

Most files intentionally kept base/task/post_task.h as an include. It is
still required because of a cyclical dependency during the migration
preventing base/task/thread_pool.h from implicitly providing
base/task/task_traits.h to its users (callers that explicitly store
TaskTraits and include task_traits.h don't have this problem). The
post_task.h include will be cleaned up in a later phase.

This CL was uploaded by git cl split.

TBR=zork@chromium.org

Bug: 1026641
Change-Id: I0d5281aa9d38d020299fe80e923f20f6f2fabc8b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2078429Reviewed-by: default avatarGabriel Charette <gab@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745948}
parent 8b2c60e3
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/bind_helpers.h" #include "base/bind_helpers.h"
#include "base/task/post_task.h"
#include "base/task/task_traits.h" #include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
#include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
...@@ -54,10 +54,10 @@ SystemLogsFetcher::SystemLogsFetcher( ...@@ -54,10 +54,10 @@ SystemLogsFetcher::SystemLogsFetcher(
num_pending_requests_(0), num_pending_requests_(0),
task_runner_for_anonymizer_( task_runner_for_anonymizer_(
scrub_data scrub_data
? base::CreateSequencedTaskRunner( ? base::ThreadPool::CreateSequencedTaskRunner(
// User visible because this is called when the user is // User visible because this is called when the user is
// looking at the send feedback dialog, watching a spinner. // looking at the send feedback dialog, watching a spinner.
{base::ThreadPool(), base::TaskPriority::USER_VISIBLE, {base::TaskPriority::USER_VISIBLE,
base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}) base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN})
: nullptr), : nullptr),
anonymizer_(scrub_data ? std::make_unique<feedback::AnonymizerTool>( anonymizer_(scrub_data ? std::make_unique<feedback::AnonymizerTool>(
...@@ -142,7 +142,7 @@ void SystemLogsFetcher::RunCallbackAndDeleteSoon() { ...@@ -142,7 +142,7 @@ void SystemLogsFetcher::RunCallbackAndDeleteSoon() {
DCHECK(!callback_.is_null()); DCHECK(!callback_.is_null());
std::move(callback_).Run(std::move(response_)); std::move(callback_).Run(std::move(response_));
base::DeleteSoon(FROM_HERE, {BrowserThread::UI}, this); content::GetUIThreadTaskRunner({})->DeleteSoon(FROM_HERE, this);
} }
} // namespace system_logs } // namespace system_logs
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