Commit 5c06b1d6 authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

Migrate off base::ThreadPool()-as-a-trait in /chrome/browser/media/history

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.

R=steimel@chromium.org

Bug: 1026641
Change-Id: I86672714403013e0c9cd53df3b9919b497e72552
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2078423
Commit-Queue: Gabriel Charette <gab@chromium.org>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Reviewed-by: default avatarTommy Steimel <steimel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745503}
parent 53fba918
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "base/feature_list.h" #include "base/feature_list.h"
#include "base/task/post_task.h" #include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "chrome/browser/history/history_service_factory.h" #include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/media/history/media_history_keyed_service_factory.h" #include "chrome/browser/media/history/media_history_keyed_service_factory.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
...@@ -25,8 +26,8 @@ MediaHistoryKeyedService::MediaHistoryKeyedService(Profile* profile) ...@@ -25,8 +26,8 @@ MediaHistoryKeyedService::MediaHistoryKeyedService(Profile* profile)
if (history) if (history)
history->AddObserver(this); history->AddObserver(this);
auto db_task_runner = base::CreateUpdateableSequencedTaskRunner( auto db_task_runner = base::ThreadPool::CreateUpdateableSequencedTaskRunner(
{base::ThreadPool(), base::MayBlock(), base::TaskPriority::USER_VISIBLE, {base::MayBlock(), base::TaskPriority::USER_VISIBLE,
base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}); base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN});
media_history_store_ = media_history_store_ =
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "base/optional.h" #include "base/optional.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/task/post_task.h" #include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "base/task/thread_pool/pooled_sequenced_task_runner.h" #include "base/task/thread_pool/pooled_sequenced_task_runner.h"
#include "base/test/bind_test_util.h" #include "base/test/bind_test_util.h"
#include "base/test/test_timeouts.h" #include "base/test/test_timeouts.h"
...@@ -47,9 +48,8 @@ class MediaHistoryStoreUnitTest : public testing::Test { ...@@ -47,9 +48,8 @@ class MediaHistoryStoreUnitTest : public testing::Test {
// Set up the media history store. // Set up the media history store.
scoped_refptr<base::UpdateableSequencedTaskRunner> task_runner = scoped_refptr<base::UpdateableSequencedTaskRunner> task_runner =
base::CreateUpdateableSequencedTaskRunner( base::ThreadPool::CreateUpdateableSequencedTaskRunner(
{base::ThreadPool(), base::MayBlock(), {base::MayBlock(), base::WithBaseSyncPrimitives()});
base::WithBaseSyncPrimitives()});
media_history_store_ = std::make_unique<MediaHistoryStore>( media_history_store_ = std::make_unique<MediaHistoryStore>(
profile_builder.Build().get(), task_runner); profile_builder.Build().get(), task_runner);
......
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