0

task posting v3: remove all calls to task_runner_util.h manually

This also removes task_runner_util.h and task_runner_util_unittests.cc.

This is the last part of a chrome-wide refactor changing calls like
base::PostTaskAndReplyWithResult(task_runner[...] to calls like
task_runner->PostTaskAndReplyWithResult([...]

Bug: 1026641
Change-Id: I86e5b09ee5b62f55aa03c878102644a438f85301
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4062277
Commit-Queue: Sean Maher <spvw@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Owners-Override: Gabriel Charette <gab@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1078168}
This commit is contained in:
Sean Maher
2022-12-01 18:22:23 +00:00
committed by Chromium LUCI CQ
parent 59cd8f2751
commit acb01c42ec
22 changed files with 67 additions and 88 deletions
base
chrome/browser
sync_file_system
ui
components
account_manager_core
captive_portal
history
services
content
google_apis/drive
media/device_monitors
remoting/host/file_transfer
storage/browser/blob
third_party/blink/renderer
core
modules
mediarecorder
platform
media

@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "base/task/task_runner_util.h" #include "base/task/task_runner.h"
#include <memory> #include <memory>
#include <utility> #include <utility>

@@ -16,7 +16,6 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/callback.h" #include "base/callback.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/task/task_runner_util.h"
#include "base/threading/thread_checker.h" #include "base/threading/thread_checker.h"
#include "base/win/winrt_foundation_helpers.h" #include "base/win/winrt_foundation_helpers.h"
@@ -64,7 +63,7 @@ namespace win {
// //
// // Offloading a heavy computation: // // Offloading a heavy computation:
// auto my_op = WRL::Make<base::win::AsyncOperation<FooBar*>>(); // auto my_op = WRL::Make<base::win::AsyncOperation<FooBar*>>();
// base::PostTaskAndReplyWithResult( // base::ThreadPool::PostTaskAndReplyWithResult(
// base::BindOnce(MakeFooBar), my_op->callback()); // base::BindOnce(MakeFooBar), my_op->callback());
namespace internal { namespace internal {

@@ -180,8 +180,8 @@ class DriveBackendSyncTest : public testing::Test,
base::RunLoop run_loop; base::RunLoop run_loop;
bool success = false; bool success = false;
FileTracker tracker; FileTracker tracker;
PostTaskAndReplyWithResult( worker_task_runner_->PostTaskAndReplyWithResult(
worker_task_runner_.get(), FROM_HERE, FROM_HERE,
base::BindOnce(&MetadataDatabase::FindAppRootTracker, base::BindOnce(&MetadataDatabase::FindAppRootTracker,
base::Unretained(metadata_database()), app_id, &tracker), base::Unretained(metadata_database()), app_id, &tracker),
base::BindOnce(&SetValueAndCallClosure<bool>, run_loop.QuitClosure(), base::BindOnce(&SetValueAndCallClosure<bool>, run_loop.QuitClosure(),
@@ -205,8 +205,8 @@ class DriveBackendSyncTest : public testing::Test,
FileTracker tracker; FileTracker tracker;
base::FilePath result_path; base::FilePath result_path;
base::FilePath normalized_path = path.NormalizePathSeparators(); base::FilePath normalized_path = path.NormalizePathSeparators();
PostTaskAndReplyWithResult( worker_task_runner_->PostTaskAndReplyWithResult(
worker_task_runner_.get(), FROM_HERE, FROM_HERE,
base::BindOnce(&MetadataDatabase::FindNearestActiveAncestor, base::BindOnce(&MetadataDatabase::FindNearestActiveAncestor,
base::Unretained(metadata_database()), app_id, base::Unretained(metadata_database()), app_id,
normalized_path, &tracker, &result_path), normalized_path, &tracker, &result_path),
@@ -365,8 +365,8 @@ class DriveBackendSyncTest : public testing::Test,
base::RunLoop run_loop; base::RunLoop run_loop;
int64_t largest_fetched_change_id = -1; int64_t largest_fetched_change_id = -1;
PostTaskAndReplyWithResult( worker_task_runner_->PostTaskAndReplyWithResult(
worker_task_runner_.get(), FROM_HERE, FROM_HERE,
base::BindOnce(&MetadataDatabase::GetLargestFetchedChangeID, base::BindOnce(&MetadataDatabase::GetLargestFetchedChangeID,
base::Unretained(metadata_database())), base::Unretained(metadata_database())),
base::BindOnce(&SetValueAndCallClosure<int64_t>, base::BindOnce(&SetValueAndCallClosure<int64_t>,
@@ -533,8 +533,8 @@ class DriveBackendSyncTest : public testing::Test,
size_t CountMetadata() { size_t CountMetadata() {
size_t count = 0; size_t count = 0;
base::RunLoop run_loop; base::RunLoop run_loop;
PostTaskAndReplyWithResult( worker_task_runner_->PostTaskAndReplyWithResult(
worker_task_runner_.get(), FROM_HERE, FROM_HERE,
base::BindOnce(&MetadataDatabase::CountFileMetadata, base::BindOnce(&MetadataDatabase::CountFileMetadata,
base::Unretained(metadata_database())), base::Unretained(metadata_database())),
base::BindOnce(&SetValueAndCallClosure<size_t>, run_loop.QuitClosure(), base::BindOnce(&SetValueAndCallClosure<size_t>, run_loop.QuitClosure(),
@@ -546,8 +546,8 @@ class DriveBackendSyncTest : public testing::Test,
size_t CountTracker() { size_t CountTracker() {
size_t count = 0; size_t count = 0;
base::RunLoop run_loop; base::RunLoop run_loop;
PostTaskAndReplyWithResult( worker_task_runner_->PostTaskAndReplyWithResult(
worker_task_runner_.get(), FROM_HERE, FROM_HERE,
base::BindOnce(&MetadataDatabase::CountFileTracker, base::BindOnce(&MetadataDatabase::CountFileTracker,
base::Unretained(metadata_database())), base::Unretained(metadata_database())),
base::BindOnce(&SetValueAndCallClosure<size_t>, run_loop.QuitClosure(), base::BindOnce(&SetValueAndCallClosure<size_t>, run_loop.QuitClosure(),

@@ -538,8 +538,8 @@ void SyncEngine::DumpFiles(const GURL& origin, ListCallback callback) {
ListCallback tracked_callback = callback_tracker_.Register( ListCallback tracked_callback = callback_tracker_.Register(
std::move(abort_closure), std::move(split_callback.second)); std::move(abort_closure), std::move(split_callback.second));
PostTaskAndReplyWithResult( worker_task_runner_->PostTaskAndReplyWithResult(
worker_task_runner_.get(), FROM_HERE, FROM_HERE,
base::BindOnce(&SyncWorkerInterface::DumpFiles, base::BindOnce(&SyncWorkerInterface::DumpFiles,
base::Unretained(sync_worker_.get()), origin), base::Unretained(sync_worker_.get()), origin),
std::move(tracked_callback)); std::move(tracked_callback));
@@ -559,8 +559,8 @@ void SyncEngine::DumpDatabase(ListCallback callback) {
ListCallback tracked_callback = callback_tracker_.Register( ListCallback tracked_callback = callback_tracker_.Register(
std::move(abort_closure), std::move(split_callback.second)); std::move(abort_closure), std::move(split_callback.second));
PostTaskAndReplyWithResult( worker_task_runner_->PostTaskAndReplyWithResult(
worker_task_runner_.get(), FROM_HERE, FROM_HERE,
base::BindOnce(&SyncWorkerInterface::DumpDatabase, base::BindOnce(&SyncWorkerInterface::DumpDatabase,
base::Unretained(sync_worker_.get())), base::Unretained(sync_worker_.get())),
std::move(tracked_callback)); std::move(tracked_callback));

@@ -31,7 +31,6 @@
#include "base/ranges/algorithm.h" #include "base/ranges/algorithm.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/task/task_runner_util.h"
#include "base/test/bind.h" #include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h" #include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_command_line.h" #include "base/test/scoped_command_line.h"

@@ -21,7 +21,6 @@
#include "base/notreached.h" #include "base/notreached.h"
#include "base/ranges/algorithm.h" #include "base/ranges/algorithm.h"
#include "base/task/sequenced_task_runner.h" #include "base/task/sequenced_task_runner.h"
#include "base/task/task_runner_util.h"
#include "base/task/thread_pool.h" #include "base/task/thread_pool.h"
#include "build/chromeos_buildflags.h" #include "build/chromeos_buildflags.h"
#include "components/account_manager_core/account.h" #include "components/account_manager_core/account.h"
@@ -362,8 +361,8 @@ void AccountManager::Initialize(
if (!IsEphemeralMode()) { if (!IsEphemeralMode()) {
DCHECK(task_runner_); DCHECK(task_runner_);
PostTaskAndReplyWithResult( task_runner_->PostTaskAndReplyWithResult(
task_runner_.get(), FROM_HERE, FROM_HERE,
base::BindOnce(&AccountManager::LoadAccountsFromDisk, tokens_file_path), base::BindOnce(&AccountManager::LoadAccountsFromDisk, tokens_file_path),
base::BindOnce( base::BindOnce(
&AccountManager::InsertAccountsAndRunInitializationCallbacks, &AccountManager::InsertAccountsAndRunInitializationCallbacks,

@@ -9,7 +9,6 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/task/task_runner_util.h"
#include "net/base/load_flags.h" #include "net/base/load_flags.h"
#include "net/http/http_response_headers.h" #include "net/http/http_response_headers.h"
#include "net/http/http_util.h" #include "net/http/http_util.h"

@@ -30,7 +30,6 @@
#include "base/observer_list.h" #include "base/observer_list.h"
#include "base/sequence_checker.h" #include "base/sequence_checker.h"
#include "base/task/single_thread_task_runner.h" #include "base/task/single_thread_task_runner.h"
#include "base/task/task_runner_util.h"
#include "base/task/thread_pool.h" #include "base/task/thread_pool.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "base/trace_event/trace_event.h" #include "base/trace_event/trace_event.h"
@@ -374,8 +373,8 @@ void HistoryService::GetCountsAndLastVisitForOriginsForTesting(
GetCountsAndLastVisitForOriginsCallback callback) const { GetCountsAndLastVisitForOriginsCallback callback) const {
DCHECK(backend_task_runner_) << "History service being called after cleanup"; DCHECK(backend_task_runner_) << "History service being called after cleanup";
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
PostTaskAndReplyWithResult( backend_task_runner_->PostTaskAndReplyWithResult(
backend_task_runner_.get(), FROM_HERE, FROM_HERE,
base::BindOnce(&HistoryBackend::GetCountsAndLastVisitForOrigins, base::BindOnce(&HistoryBackend::GetCountsAndLastVisitForOrigins,
history_backend_, origins), history_backend_, origins),
std::move(callback)); std::move(callback));
@@ -777,8 +776,8 @@ void HistoryService::CanSetOnDemandFavicons(
return; return;
} }
PostTaskAndReplyWithResult( backend_task_runner_->PostTaskAndReplyWithResult(
backend_task_runner_.get(), FROM_HERE, FROM_HERE,
base::BindOnce(&HistoryBackend::CanSetOnDemandFavicons, history_backend_, base::BindOnce(&HistoryBackend::CanSetOnDemandFavicons, history_backend_,
page_url, icon_type), page_url, icon_type),
std::move(callback)); std::move(callback));
@@ -797,8 +796,8 @@ void HistoryService::SetOnDemandFavicons(
return; return;
} }
PostTaskAndReplyWithResult( backend_task_runner_->PostTaskAndReplyWithResult(
backend_task_runner_.get(), FROM_HERE, FROM_HERE,
base::BindOnce(&HistoryBackend::SetOnDemandFavicons, history_backend_, base::BindOnce(&HistoryBackend::SetOnDemandFavicons, history_backend_,
page_url, icon_type, icon_url, bitmaps), page_url, icon_type, icon_url, bitmaps),
std::move(callback)); std::move(callback));
@@ -981,17 +980,18 @@ void HistoryService::CreateDownload(const DownloadRow& create_info,
DownloadCreateCallback callback) { DownloadCreateCallback callback) {
DCHECK(backend_task_runner_) << "History service being called after cleanup"; DCHECK(backend_task_runner_) << "History service being called after cleanup";
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
PostTaskAndReplyWithResult(backend_task_runner_.get(), FROM_HERE, backend_task_runner_->PostTaskAndReplyWithResult(
base::BindOnce(&HistoryBackend::CreateDownload, FROM_HERE,
history_backend_, create_info), base::BindOnce(&HistoryBackend::CreateDownload, history_backend_,
std::move(callback)); create_info),
std::move(callback));
} }
void HistoryService::GetNextDownloadId(DownloadIdCallback callback) { void HistoryService::GetNextDownloadId(DownloadIdCallback callback) {
DCHECK(backend_task_runner_) << "History service being called after cleanup"; DCHECK(backend_task_runner_) << "History service being called after cleanup";
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
PostTaskAndReplyWithResult( backend_task_runner_->PostTaskAndReplyWithResult(
backend_task_runner_.get(), FROM_HERE, FROM_HERE,
base::BindOnce(&HistoryBackend::GetNextDownloadId, history_backend_), base::BindOnce(&HistoryBackend::GetNextDownloadId, history_backend_),
std::move(callback)); std::move(callback));
} }
@@ -1001,8 +1001,8 @@ void HistoryService::GetNextDownloadId(DownloadIdCallback callback) {
void HistoryService::QueryDownloads(DownloadQueryCallback callback) { void HistoryService::QueryDownloads(DownloadQueryCallback callback) {
DCHECK(backend_task_runner_) << "History service being called after cleanup"; DCHECK(backend_task_runner_) << "History service being called after cleanup";
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
PostTaskAndReplyWithResult( backend_task_runner_->PostTaskAndReplyWithResult(
backend_task_runner_.get(), FROM_HERE, FROM_HERE,
base::BindOnce(&HistoryBackend::QueryDownloads, history_backend_), base::BindOnce(&HistoryBackend::QueryDownloads, history_backend_),
std::move(callback)); std::move(callback));
} }

@@ -17,7 +17,6 @@
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/task/task_runner_util.h"
#include "base/task/thread_pool.h" #include "base/task/thread_pool.h"
#include "base/test/bind.h" #include "base/test/bind.h"
#include "base/test/task_environment.h" #include "base/test/task_environment.h"

@@ -30,7 +30,6 @@
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/task/sequenced_task_runner.h" #include "base/task/sequenced_task_runner.h"
#include "base/task/task_runner_util.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "base/trace_event/trace_event.h" #include "base/trace_event/trace_event.h"
#include "base/trace_event/traced_value.h" #include "base/trace_event/traced_value.h"
@@ -273,8 +272,8 @@ class CacheStorage::SimpleCacheLoader : public CacheStorage::CacheLoader {
CacheAndErrorCallback callback) override { CacheAndErrorCallback callback) override {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
PostTaskAndReplyWithResult( cache_task_runner_->PostTaskAndReplyWithResult(
cache_task_runner_.get(), FROM_HERE, FROM_HERE,
base::BindOnce(&SimpleCacheLoader::PrepareNewCacheDirectoryInPool, base::BindOnce(&SimpleCacheLoader::PrepareNewCacheDirectoryInPool,
directory_path_), directory_path_),
base::BindOnce(&SimpleCacheLoader::PrepareNewCacheCreateCache, base::BindOnce(&SimpleCacheLoader::PrepareNewCacheCreateCache,
@@ -386,8 +385,8 @@ class CacheStorage::SimpleCacheLoader : public CacheStorage::CacheLoader {
base::FilePath index_path = base::FilePath index_path =
directory_path_.AppendASCII(CacheStorage::kIndexFileName); directory_path_.AppendASCII(CacheStorage::kIndexFileName);
PostTaskAndReplyWithResult( cache_task_runner_->PostTaskAndReplyWithResult(
cache_task_runner_.get(), FROM_HERE, FROM_HERE,
base::BindOnce(&SimpleCacheLoader::WriteIndexWriteToFileInPool, base::BindOnce(&SimpleCacheLoader::WriteIndexWriteToFileInPool,
tmp_path, index_path, serialized, quota_manager_proxy_, tmp_path, index_path, serialized, quota_manager_proxy_,
bucket_locator_), bucket_locator_),
@@ -414,8 +413,8 @@ class CacheStorage::SimpleCacheLoader : public CacheStorage::CacheLoader {
void LoadIndex(CacheStorageIndexLoadCallback callback) override { void LoadIndex(CacheStorageIndexLoadCallback callback) override {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
PostTaskAndReplyWithResult( cache_task_runner_->PostTaskAndReplyWithResult(
cache_task_runner_.get(), FROM_HERE, FROM_HERE,
base::BindOnce(&SimpleCacheLoader::ReadAndMigrateIndexInPool, base::BindOnce(&SimpleCacheLoader::ReadAndMigrateIndexInPool,
directory_path_, quota_manager_proxy_, bucket_locator_), directory_path_, quota_manager_proxy_, bucket_locator_),
base::BindOnce(&SimpleCacheLoader::LoadIndexDidReadIndex, base::BindOnce(&SimpleCacheLoader::LoadIndexDidReadIndex,

@@ -29,7 +29,6 @@
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/task/sequenced_task_runner.h" #include "base/task/sequenced_task_runner.h"
#include "base/task/task_runner_util.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "components/services/storage/public/cpp/buckets/bucket_locator.h" #include "components/services/storage/public/cpp/buckets/bucket_locator.h"
#include "components/services/storage/public/cpp/constants.h" #include "components/services/storage/public/cpp/constants.h"
@@ -853,8 +852,8 @@ void CacheStorageManager::DeleteStorageKeyDataGotAllBucketInfo(
} else { } else {
// This must be for an unmigrated cache storage instance using an origin // This must be for an unmigrated cache storage instance using an origin
// path, so just directly delete the directory. // path, so just directly delete the directory.
PostTaskAndReplyWithResult( cache_task_runner_->PostTaskAndReplyWithResult(
cache_task_runner_.get(), FROM_HERE, FROM_HERE,
base::BindOnce(&DeleteDir, CacheStorageManager::ConstructBucketPath( base::BindOnce(&DeleteDir, CacheStorageManager::ConstructBucketPath(
profile_path_, bucket_locator, owner)), profile_path_, bucket_locator, owner)),
base::BindOnce(&DeleteBucketDidDeleteDir, barrier_callback)); base::BindOnce(&DeleteBucketDidDeleteDir, barrier_callback));
@@ -1019,8 +1018,8 @@ void CacheStorageManager::DeleteBucketDidClose(
return; return;
} }
PostTaskAndReplyWithResult( cache_task_runner_->PostTaskAndReplyWithResult(
cache_task_runner_.get(), FROM_HERE, FROM_HERE,
base::BindOnce(&DeleteDir, CacheStorageManager::ConstructBucketPath( base::BindOnce(&DeleteDir, CacheStorageManager::ConstructBucketPath(
profile_path_, bucket_locator, owner)), profile_path_, bucket_locator, owner)),
base::BindOnce(&DeleteBucketDidDeleteDir, std::move(callback))); base::BindOnce(&DeleteBucketDidDeleteDir, std::move(callback)));

@@ -20,7 +20,6 @@
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/synchronization/waitable_event.h" #include "base/synchronization/waitable_event.h"
#include "base/task/sequenced_task_runner.h" #include "base/task/sequenced_task_runner.h"
#include "base/task/task_runner_util.h"
#include "base/task/thread_pool.h" #include "base/task/thread_pool.h"
#include "base/threading/thread.h" #include "base/threading/thread.h"
#include "build/build_config.h" #include "build/build_config.h"

@@ -9,7 +9,6 @@
#include "base/strings/string_piece.h" #include "base/strings/string_piece.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/task/sequenced_task_runner.h" #include "base/task/sequenced_task_runner.h"
#include "base/task/task_runner_util.h"
#include "base/test/task_environment.h" #include "base/test/task_environment.h"
#include "base/values.h" #include "base/values.h"
#include "build/build_config.h" #include "build/build_config.h"

@@ -17,7 +17,6 @@
#include "base/location.h" #include "base/location.h"
#include "base/memory/raw_ptr.h" #include "base/memory/raw_ptr.h"
#include "base/task/sequenced_task_runner.h" #include "base/task/sequenced_task_runner.h"
#include "base/task/task_runner_util.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "base/values.h" #include "base/values.h"
#include "google_apis/drive/drive_api_parser.h" #include "google_apis/drive/drive_api_parser.h"
@@ -170,8 +169,8 @@ class DriveApiDataRequest : public DriveApiPartialFieldRequest {
switch (error) { switch (error) {
case HTTP_SUCCESS: case HTTP_SUCCESS:
case HTTP_CREATED: case HTTP_CREATED:
base::PostTaskAndReplyWithResult( blocking_task_runner()->PostTaskAndReplyWithResult(
blocking_task_runner(), FROM_HERE, FROM_HERE,
base::BindOnce(&DriveApiDataRequest::Parse, base::BindOnce(&DriveApiDataRequest::Parse,
std::move(response_body)), std::move(response_body)),
base::BindOnce(&DriveApiDataRequest::OnDataParsed, base::BindOnce(&DriveApiDataRequest::OnDataParsed,

@@ -19,7 +19,6 @@
#include "base/strings/string_piece.h" #include "base/strings/string_piece.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/task/sequenced_task_runner.h" #include "base/task/sequenced_task_runner.h"
#include "base/task/task_runner_util.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "base/values.h" #include "base/values.h"
#include "google_apis/common/request_sender.h" #include "google_apis/common/request_sender.h"
@@ -66,9 +65,8 @@ void ParseJsonOnBlockingPool(
base::TaskRunner* blocking_task_runner, base::TaskRunner* blocking_task_runner,
std::string json, std::string json,
base::OnceCallback<void(std::unique_ptr<base::Value> value)> callback) { base::OnceCallback<void(std::unique_ptr<base::Value> value)> callback) {
base::PostTaskAndReplyWithResult( blocking_task_runner->PostTaskAndReplyWithResult(
blocking_task_runner, FROM_HERE, FROM_HERE, base::BindOnce(&google_apis::ParseJson, std::move(json)),
base::BindOnce(&google_apis::ParseJson, std::move(json)),
std::move(callback)); std::move(callback));
} }
@@ -479,8 +477,8 @@ void MultipartUploadRequestBase::Prepare(PrepareCallback callback) {
// |UrlFetchRequestBase::Cancel| and OnPrepareUploadContent won't be called. // |UrlFetchRequestBase::Cancel| and OnPrepareUploadContent won't be called.
std::string* const upload_content_type = new std::string(); std::string* const upload_content_type = new std::string();
std::string* const upload_content_data = new std::string(); std::string* const upload_content_data = new std::string();
PostTaskAndReplyWithResult( blocking_task_runner_->PostTaskAndReplyWithResult(
blocking_task_runner_.get(), FROM_HERE, FROM_HERE,
base::BindOnce(&GetMultipartContent, boundary_, metadata_json_, base::BindOnce(&GetMultipartContent, boundary_, metadata_json_,
content_type_, local_path_, content_type_, local_path_,
base::Unretained(upload_content_type), base::Unretained(upload_content_type),

@@ -16,7 +16,6 @@
#include "base/mac/scoped_nsobject.h" #include "base/mac/scoped_nsobject.h"
#include "base/memory/raw_ptr.h" #include "base/memory/raw_ptr.h"
#include "base/ranges/algorithm.h" #include "base/ranges/algorithm.h"
#include "base/task/task_runner_util.h"
#include "base/threading/thread_checker.h" #include "base/threading/thread_checker.h"
namespace { namespace {
@@ -239,8 +238,8 @@ void SuspendObserverDelegate::StartObserver(
// Enumerate the devices in Device thread and post the observers start to be // Enumerate the devices in Device thread and post the observers start to be
// done on UI thread. The devices array is retained in |device_thread| and // done on UI thread. The devices array is retained in |device_thread| and
// released in DoStartObserver(). // released in DoStartObserver().
base::PostTaskAndReplyWithResult( device_thread->PostTaskAndReplyWithResult(
device_thread.get(), FROM_HERE, base::BindOnce(base::RetainBlock(^{ FROM_HERE, base::BindOnce(base::RetainBlock(^{
return [ListCameras() retain]; return [ListCameras() retain];
})), })),
base::BindOnce(&SuspendObserverDelegate::DoStartObserver, this)); base::BindOnce(&SuspendObserverDelegate::DoStartObserver, this));
@@ -252,8 +251,8 @@ void SuspendObserverDelegate::OnDeviceChanged(
// Enumerate the devices in Device thread and post the consolidation of the // Enumerate the devices in Device thread and post the consolidation of the
// new devices and the old ones to be done on main thread. The devices array // new devices and the old ones to be done on main thread. The devices array
// is retained in |device_thread| and released in DoOnDeviceChanged(). // is retained in |device_thread| and released in DoOnDeviceChanged().
PostTaskAndReplyWithResult( device_thread->PostTaskAndReplyWithResult(
device_thread.get(), FROM_HERE, base::BindOnce(base::RetainBlock(^{ FROM_HERE, base::BindOnce(base::RetainBlock(^{
return [ListCameras() retain]; return [ListCameras() retain];
})), })),
base::BindOnce(&SuspendObserverDelegate::DoOnDeviceChanged, this)); base::BindOnce(&SuspendObserverDelegate::DoOnDeviceChanged, this));

@@ -14,7 +14,6 @@
#include "base/path_service.h" #include "base/path_service.h"
#include "base/sequence_checker.h" #include "base/sequence_checker.h"
#include "base/task/sequenced_task_runner.h" #include "base/task/sequenced_task_runner.h"
#include "base/task/task_runner_util.h"
#include "base/task/thread_pool.h" #include "base/task/thread_pool.h"
#include "base/threading/sequenced_task_runner_handle.h" #include "base/threading/sequenced_task_runner_handle.h"
#include "build/build_config.h" #include "build/build_config.h"
@@ -166,8 +165,8 @@ void LocalFileReader::Open(OpenCallback callback) {
SetState(FileOperations::kBusy); SetState(FileOperations::kBusy);
file_task_runner_ = CreateFileTaskRunner(); file_task_runner_ = CreateFileTaskRunner();
file_proxy_.emplace(file_task_runner_.get()); file_proxy_.emplace(file_task_runner_.get());
base::PostTaskAndReplyWithResult( file_task_runner_->PostTaskAndReplyWithResult(
file_task_runner_.get(), FROM_HERE, base::BindOnce(&EnsureUserContext), FROM_HERE, base::BindOnce(&EnsureUserContext),
base::BindOnce(&LocalFileReader::OnEnsureUserResult, base::BindOnce(&LocalFileReader::OnEnsureUserResult,
weak_ptr_factory_.GetWeakPtr(), std::move(callback))); weak_ptr_factory_.GetWeakPtr(), std::move(callback)));
} }
@@ -310,8 +309,8 @@ void LocalFileWriter::Open(const base::FilePath& filename, Callback callback) {
SetState(FileOperations::kBusy); SetState(FileOperations::kBusy);
file_task_runner_ = CreateFileTaskRunner(); file_task_runner_ = CreateFileTaskRunner();
file_proxy_.emplace(file_task_runner_.get()); file_proxy_.emplace(file_task_runner_.get());
base::PostTaskAndReplyWithResult( file_task_runner_->PostTaskAndReplyWithResult(
file_task_runner_.get(), FROM_HERE, base::BindOnce([] { FROM_HERE, base::BindOnce([] {
return EnsureUserContext().AndThen( return EnsureUserContext().AndThen(
[](absl::monostate) { return GetDesktopDirectory(); }); [](absl::monostate) { return GetDesktopDirectory(); });
}), }),
@@ -393,9 +392,8 @@ void LocalFileWriter::OnGetTargetDirectoryResult(
base::FilePath temp_filepath = base::FilePath temp_filepath =
destination_filepath_.AddExtensionASCII(kTempFileExtension); destination_filepath_.AddExtensionASCII(kTempFileExtension);
PostTaskAndReplyWithResult( file_task_runner_->PostTaskAndReplyWithResult(
file_task_runner_.get(), FROM_HERE, FROM_HERE, base::BindOnce(&base::GetUniquePath, temp_filepath),
base::BindOnce(&base::GetUniquePath, temp_filepath),
base::BindOnce(&LocalFileWriter::CreateTempFile, base::BindOnce(&LocalFileWriter::CreateTempFile,
weak_ptr_factory_.GetWeakPtr(), std::move(callback))); weak_ptr_factory_.GetWeakPtr(), std::move(callback)));
} }
@@ -488,9 +486,8 @@ void LocalFileWriter::OnCloseResult(Callback callback,
return; return;
} }
base::PostTaskAndReplyWithResult( file_task_runner_->PostTaskAndReplyWithResult(
file_task_runner_.get(), FROM_HERE, FROM_HERE, base::BindOnce(&base::GetUniquePath, destination_filepath_),
base::BindOnce(&base::GetUniquePath, destination_filepath_),
base::BindOnce(&LocalFileWriter::MoveToDestination, base::BindOnce(&LocalFileWriter::MoveToDestination,
weak_ptr_factory_.GetWeakPtr(), std::move(callback))); weak_ptr_factory_.GetWeakPtr(), std::move(callback)));
} }
@@ -508,8 +505,8 @@ void LocalFileWriter::MoveToDestination(Callback callback,
destination_filepath_ = std::move(destination_filepath); destination_filepath_ = std::move(destination_filepath);
PostTaskAndReplyWithResult( file_task_runner_->PostTaskAndReplyWithResult(
file_task_runner_.get(), FROM_HERE, FROM_HERE,
base::BindOnce(&base::Move, temp_filepath_, destination_filepath_), base::BindOnce(&base::Move, temp_filepath_, destination_filepath_),
base::BindOnce(&LocalFileWriter::OnMoveResult, base::BindOnce(&LocalFileWriter::OnMoveResult,
weak_ptr_factory_.GetWeakPtr(), std::move(callback))); weak_ptr_factory_.GetWeakPtr(), std::move(callback)));

@@ -26,7 +26,6 @@
#include "base/system/sys_info.h" #include "base/system/sys_info.h"
#include "base/task/single_thread_task_runner.h" #include "base/task/single_thread_task_runner.h"
#include "base/task/task_runner.h" #include "base/task/task_runner.h"
#include "base/task/task_runner_util.h"
#include "base/threading/scoped_blocking_call.h" #include "base/threading/scoped_blocking_call.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "base/trace_event/trace_event.h" #include "base/trace_event/trace_event.h"
@@ -753,10 +752,10 @@ void BlobMemoryController::CalculateBlobStorageLimits() {
return; return;
did_schedule_limit_calculation_ = true; did_schedule_limit_calculation_ = true;
if (file_runner_) { if (file_runner_) {
PostTaskAndReplyWithResult( file_runner_->PostTaskAndReplyWithResult(
file_runner_.get(), FROM_HERE, FROM_HERE,
base::BindOnce(&CalculateBlobStorageLimitsImpl, blob_storage_dir_, base::BindOnce(&CalculateBlobStorageLimitsImpl, blob_storage_dir_, true,
true, amount_of_memory_for_testing_), amount_of_memory_for_testing_),
base::BindOnce(&BlobMemoryController::OnStorageLimitsCalculated, base::BindOnce(&BlobMemoryController::OnStorageLimitsCalculated,
weak_factory_.GetWeakPtr())); weak_factory_.GetWeakPtr()));
} else { } else {

@@ -22,7 +22,6 @@ specific_include_rules = {
"+base/strings/string_split.h", "+base/strings/string_split.h",
"+base/strings/utf_string_conversions.h", "+base/strings/utf_string_conversions.h",
"+base/task/current_thread.h", "+base/task/current_thread.h",
"+base/task/task_runner_util.h",
"+base/threading/thread.h", "+base/threading/thread.h",
"+components/viz/test", "+components/viz/test",
"+media/base", "+media/base",

@@ -21,7 +21,6 @@
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/task/single_thread_task_runner.h" #include "base/task/single_thread_task_runner.h"
#include "base/task/task_runner_util.h"
#include "base/test/bind.h" #include "base/test/bind.h"
#include "base/test/gmock_callback_support.h" #include "base/test/gmock_callback_support.h"
#include "base/test/mock_callback.h" #include "base/test/mock_callback.h"

@@ -4,7 +4,6 @@ include_rules = [
"+base/memory/unsafe_shared_memory_region.h", "+base/memory/unsafe_shared_memory_region.h",
"+base/memory/shared_memory_mapping.h", "+base/memory/shared_memory_mapping.h",
"+base/strings/string_piece.h", "+base/strings/string_piece.h",
"+base/task/task_runner_util.h",
"+base/threading/sequenced_task_runner_handle.h", "+base/threading/sequenced_task_runner_handle.h",
"+base/threading/thread_restrictions.h", "+base/threading/thread_restrictions.h",
"+cc/paint", "+cc/paint",

@@ -13,7 +13,6 @@ include_rules = [
"+base/strings/utf_string_conversions.h", "+base/strings/utf_string_conversions.h",
"+base/task/bind_post_task.h", "+base/task/bind_post_task.h",
"+base/task/task_runner.h", "+base/task/task_runner.h",
"+base/task/task_runner_util.h",
"+base/threading/thread.h", "+base/threading/thread.h",
"+cc/layers", "+cc/layers",
"+components/viz/common", "+components/viz/common",