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:

committed by
Chromium LUCI CQ

parent
59cd8f2751
commit
acb01c42ec
base
chrome/browser
sync_file_system
drive_backend
ui
app_list
components
account_manager_core
chromeos
captive_portal
history
core
browser
services
storage
dom_storage
content
browser
common
google_apis/drive
media/device_monitors
remoting/host/file_transfer
storage/browser/blob
third_party/blink/renderer
@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "base/task/task_runner_util.h"
|
||||
#include "base/task/task_runner.h"
|
||||
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include "base/bind.h"
|
||||
#include "base/callback.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "base/task/task_runner_util.h"
|
||||
#include "base/threading/thread_checker.h"
|
||||
#include "base/win/winrt_foundation_helpers.h"
|
||||
|
||||
@ -64,7 +63,7 @@ namespace win {
|
||||
//
|
||||
// // Offloading a heavy computation:
|
||||
// auto my_op = WRL::Make<base::win::AsyncOperation<FooBar*>>();
|
||||
// base::PostTaskAndReplyWithResult(
|
||||
// base::ThreadPool::PostTaskAndReplyWithResult(
|
||||
// base::BindOnce(MakeFooBar), my_op->callback());
|
||||
|
||||
namespace internal {
|
||||
|
@ -180,8 +180,8 @@ class DriveBackendSyncTest : public testing::Test,
|
||||
base::RunLoop run_loop;
|
||||
bool success = false;
|
||||
FileTracker tracker;
|
||||
PostTaskAndReplyWithResult(
|
||||
worker_task_runner_.get(), FROM_HERE,
|
||||
worker_task_runner_->PostTaskAndReplyWithResult(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&MetadataDatabase::FindAppRootTracker,
|
||||
base::Unretained(metadata_database()), app_id, &tracker),
|
||||
base::BindOnce(&SetValueAndCallClosure<bool>, run_loop.QuitClosure(),
|
||||
@ -205,8 +205,8 @@ class DriveBackendSyncTest : public testing::Test,
|
||||
FileTracker tracker;
|
||||
base::FilePath result_path;
|
||||
base::FilePath normalized_path = path.NormalizePathSeparators();
|
||||
PostTaskAndReplyWithResult(
|
||||
worker_task_runner_.get(), FROM_HERE,
|
||||
worker_task_runner_->PostTaskAndReplyWithResult(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&MetadataDatabase::FindNearestActiveAncestor,
|
||||
base::Unretained(metadata_database()), app_id,
|
||||
normalized_path, &tracker, &result_path),
|
||||
@ -365,8 +365,8 @@ class DriveBackendSyncTest : public testing::Test,
|
||||
|
||||
base::RunLoop run_loop;
|
||||
int64_t largest_fetched_change_id = -1;
|
||||
PostTaskAndReplyWithResult(
|
||||
worker_task_runner_.get(), FROM_HERE,
|
||||
worker_task_runner_->PostTaskAndReplyWithResult(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&MetadataDatabase::GetLargestFetchedChangeID,
|
||||
base::Unretained(metadata_database())),
|
||||
base::BindOnce(&SetValueAndCallClosure<int64_t>,
|
||||
@ -533,8 +533,8 @@ class DriveBackendSyncTest : public testing::Test,
|
||||
size_t CountMetadata() {
|
||||
size_t count = 0;
|
||||
base::RunLoop run_loop;
|
||||
PostTaskAndReplyWithResult(
|
||||
worker_task_runner_.get(), FROM_HERE,
|
||||
worker_task_runner_->PostTaskAndReplyWithResult(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&MetadataDatabase::CountFileMetadata,
|
||||
base::Unretained(metadata_database())),
|
||||
base::BindOnce(&SetValueAndCallClosure<size_t>, run_loop.QuitClosure(),
|
||||
@ -546,8 +546,8 @@ class DriveBackendSyncTest : public testing::Test,
|
||||
size_t CountTracker() {
|
||||
size_t count = 0;
|
||||
base::RunLoop run_loop;
|
||||
PostTaskAndReplyWithResult(
|
||||
worker_task_runner_.get(), FROM_HERE,
|
||||
worker_task_runner_->PostTaskAndReplyWithResult(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&MetadataDatabase::CountFileTracker,
|
||||
base::Unretained(metadata_database())),
|
||||
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(
|
||||
std::move(abort_closure), std::move(split_callback.second));
|
||||
|
||||
PostTaskAndReplyWithResult(
|
||||
worker_task_runner_.get(), FROM_HERE,
|
||||
worker_task_runner_->PostTaskAndReplyWithResult(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&SyncWorkerInterface::DumpFiles,
|
||||
base::Unretained(sync_worker_.get()), origin),
|
||||
std::move(tracked_callback));
|
||||
@ -559,8 +559,8 @@ void SyncEngine::DumpDatabase(ListCallback callback) {
|
||||
ListCallback tracked_callback = callback_tracker_.Register(
|
||||
std::move(abort_closure), std::move(split_callback.second));
|
||||
|
||||
PostTaskAndReplyWithResult(
|
||||
worker_task_runner_.get(), FROM_HERE,
|
||||
worker_task_runner_->PostTaskAndReplyWithResult(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&SyncWorkerInterface::DumpDatabase,
|
||||
base::Unretained(sync_worker_.get())),
|
||||
std::move(tracked_callback));
|
||||
|
@ -31,7 +31,6 @@
|
||||
#include "base/ranges/algorithm.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/task/task_runner_util.h"
|
||||
#include "base/test/bind.h"
|
||||
#include "base/test/metrics/histogram_tester.h"
|
||||
#include "base/test/scoped_command_line.h"
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include "base/notreached.h"
|
||||
#include "base/ranges/algorithm.h"
|
||||
#include "base/task/sequenced_task_runner.h"
|
||||
#include "base/task/task_runner_util.h"
|
||||
#include "base/task/thread_pool.h"
|
||||
#include "build/chromeos_buildflags.h"
|
||||
#include "components/account_manager_core/account.h"
|
||||
@ -362,8 +361,8 @@ void AccountManager::Initialize(
|
||||
|
||||
if (!IsEphemeralMode()) {
|
||||
DCHECK(task_runner_);
|
||||
PostTaskAndReplyWithResult(
|
||||
task_runner_.get(), FROM_HERE,
|
||||
task_runner_->PostTaskAndReplyWithResult(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&AccountManager::LoadAccountsFromDisk, tokens_file_path),
|
||||
base::BindOnce(
|
||||
&AccountManager::InsertAccountsAndRunInitializationCallbacks,
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "base/bind.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/task/task_runner_util.h"
|
||||
#include "net/base/load_flags.h"
|
||||
#include "net/http/http_response_headers.h"
|
||||
#include "net/http/http_util.h"
|
||||
|
@ -30,7 +30,6 @@
|
||||
#include "base/observer_list.h"
|
||||
#include "base/sequence_checker.h"
|
||||
#include "base/task/single_thread_task_runner.h"
|
||||
#include "base/task/task_runner_util.h"
|
||||
#include "base/task/thread_pool.h"
|
||||
#include "base/time/time.h"
|
||||
#include "base/trace_event/trace_event.h"
|
||||
@ -374,8 +373,8 @@ void HistoryService::GetCountsAndLastVisitForOriginsForTesting(
|
||||
GetCountsAndLastVisitForOriginsCallback callback) const {
|
||||
DCHECK(backend_task_runner_) << "History service being called after cleanup";
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
PostTaskAndReplyWithResult(
|
||||
backend_task_runner_.get(), FROM_HERE,
|
||||
backend_task_runner_->PostTaskAndReplyWithResult(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&HistoryBackend::GetCountsAndLastVisitForOrigins,
|
||||
history_backend_, origins),
|
||||
std::move(callback));
|
||||
@ -777,8 +776,8 @@ void HistoryService::CanSetOnDemandFavicons(
|
||||
return;
|
||||
}
|
||||
|
||||
PostTaskAndReplyWithResult(
|
||||
backend_task_runner_.get(), FROM_HERE,
|
||||
backend_task_runner_->PostTaskAndReplyWithResult(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&HistoryBackend::CanSetOnDemandFavicons, history_backend_,
|
||||
page_url, icon_type),
|
||||
std::move(callback));
|
||||
@ -797,8 +796,8 @@ void HistoryService::SetOnDemandFavicons(
|
||||
return;
|
||||
}
|
||||
|
||||
PostTaskAndReplyWithResult(
|
||||
backend_task_runner_.get(), FROM_HERE,
|
||||
backend_task_runner_->PostTaskAndReplyWithResult(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&HistoryBackend::SetOnDemandFavicons, history_backend_,
|
||||
page_url, icon_type, icon_url, bitmaps),
|
||||
std::move(callback));
|
||||
@ -981,17 +980,18 @@ void HistoryService::CreateDownload(const DownloadRow& create_info,
|
||||
DownloadCreateCallback callback) {
|
||||
DCHECK(backend_task_runner_) << "History service being called after cleanup";
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
PostTaskAndReplyWithResult(backend_task_runner_.get(), FROM_HERE,
|
||||
base::BindOnce(&HistoryBackend::CreateDownload,
|
||||
history_backend_, create_info),
|
||||
std::move(callback));
|
||||
backend_task_runner_->PostTaskAndReplyWithResult(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&HistoryBackend::CreateDownload, history_backend_,
|
||||
create_info),
|
||||
std::move(callback));
|
||||
}
|
||||
|
||||
void HistoryService::GetNextDownloadId(DownloadIdCallback callback) {
|
||||
DCHECK(backend_task_runner_) << "History service being called after cleanup";
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
PostTaskAndReplyWithResult(
|
||||
backend_task_runner_.get(), FROM_HERE,
|
||||
backend_task_runner_->PostTaskAndReplyWithResult(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&HistoryBackend::GetNextDownloadId, history_backend_),
|
||||
std::move(callback));
|
||||
}
|
||||
@ -1001,8 +1001,8 @@ void HistoryService::GetNextDownloadId(DownloadIdCallback callback) {
|
||||
void HistoryService::QueryDownloads(DownloadQueryCallback callback) {
|
||||
DCHECK(backend_task_runner_) << "History service being called after cleanup";
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
PostTaskAndReplyWithResult(
|
||||
backend_task_runner_.get(), FROM_HERE,
|
||||
backend_task_runner_->PostTaskAndReplyWithResult(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&HistoryBackend::QueryDownloads, history_backend_),
|
||||
std::move(callback));
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/task/task_runner_util.h"
|
||||
#include "base/task/thread_pool.h"
|
||||
#include "base/test/bind.h"
|
||||
#include "base/test/task_environment.h"
|
||||
|
@ -30,7 +30,6 @@
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/task/sequenced_task_runner.h"
|
||||
#include "base/task/task_runner_util.h"
|
||||
#include "base/time/time.h"
|
||||
#include "base/trace_event/trace_event.h"
|
||||
#include "base/trace_event/traced_value.h"
|
||||
@ -273,8 +272,8 @@ class CacheStorage::SimpleCacheLoader : public CacheStorage::CacheLoader {
|
||||
CacheAndErrorCallback callback) override {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
|
||||
PostTaskAndReplyWithResult(
|
||||
cache_task_runner_.get(), FROM_HERE,
|
||||
cache_task_runner_->PostTaskAndReplyWithResult(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&SimpleCacheLoader::PrepareNewCacheDirectoryInPool,
|
||||
directory_path_),
|
||||
base::BindOnce(&SimpleCacheLoader::PrepareNewCacheCreateCache,
|
||||
@ -386,8 +385,8 @@ class CacheStorage::SimpleCacheLoader : public CacheStorage::CacheLoader {
|
||||
base::FilePath index_path =
|
||||
directory_path_.AppendASCII(CacheStorage::kIndexFileName);
|
||||
|
||||
PostTaskAndReplyWithResult(
|
||||
cache_task_runner_.get(), FROM_HERE,
|
||||
cache_task_runner_->PostTaskAndReplyWithResult(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&SimpleCacheLoader::WriteIndexWriteToFileInPool,
|
||||
tmp_path, index_path, serialized, quota_manager_proxy_,
|
||||
bucket_locator_),
|
||||
@ -414,8 +413,8 @@ class CacheStorage::SimpleCacheLoader : public CacheStorage::CacheLoader {
|
||||
void LoadIndex(CacheStorageIndexLoadCallback callback) override {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
|
||||
PostTaskAndReplyWithResult(
|
||||
cache_task_runner_.get(), FROM_HERE,
|
||||
cache_task_runner_->PostTaskAndReplyWithResult(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&SimpleCacheLoader::ReadAndMigrateIndexInPool,
|
||||
directory_path_, quota_manager_proxy_, bucket_locator_),
|
||||
base::BindOnce(&SimpleCacheLoader::LoadIndexDidReadIndex,
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/task/sequenced_task_runner.h"
|
||||
#include "base/task/task_runner_util.h"
|
||||
#include "base/time/time.h"
|
||||
#include "components/services/storage/public/cpp/buckets/bucket_locator.h"
|
||||
#include "components/services/storage/public/cpp/constants.h"
|
||||
@ -853,8 +852,8 @@ void CacheStorageManager::DeleteStorageKeyDataGotAllBucketInfo(
|
||||
} else {
|
||||
// This must be for an unmigrated cache storage instance using an origin
|
||||
// path, so just directly delete the directory.
|
||||
PostTaskAndReplyWithResult(
|
||||
cache_task_runner_.get(), FROM_HERE,
|
||||
cache_task_runner_->PostTaskAndReplyWithResult(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&DeleteDir, CacheStorageManager::ConstructBucketPath(
|
||||
profile_path_, bucket_locator, owner)),
|
||||
base::BindOnce(&DeleteBucketDidDeleteDir, barrier_callback));
|
||||
@ -1019,8 +1018,8 @@ void CacheStorageManager::DeleteBucketDidClose(
|
||||
return;
|
||||
}
|
||||
|
||||
PostTaskAndReplyWithResult(
|
||||
cache_task_runner_.get(), FROM_HERE,
|
||||
cache_task_runner_->PostTaskAndReplyWithResult(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&DeleteDir, CacheStorageManager::ConstructBucketPath(
|
||||
profile_path_, bucket_locator, owner)),
|
||||
base::BindOnce(&DeleteBucketDidDeleteDir, std::move(callback)));
|
||||
|
@ -20,7 +20,6 @@
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/synchronization/waitable_event.h"
|
||||
#include "base/task/sequenced_task_runner.h"
|
||||
#include "base/task/task_runner_util.h"
|
||||
#include "base/task/thread_pool.h"
|
||||
#include "base/threading/thread.h"
|
||||
#include "build/build_config.h"
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "base/strings/string_piece.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/task/sequenced_task_runner.h"
|
||||
#include "base/task/task_runner_util.h"
|
||||
#include "base/test/task_environment.h"
|
||||
#include "base/values.h"
|
||||
#include "build/build_config.h"
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include "base/location.h"
|
||||
#include "base/memory/raw_ptr.h"
|
||||
#include "base/task/sequenced_task_runner.h"
|
||||
#include "base/task/task_runner_util.h"
|
||||
#include "base/time/time.h"
|
||||
#include "base/values.h"
|
||||
#include "google_apis/drive/drive_api_parser.h"
|
||||
@ -170,8 +169,8 @@ class DriveApiDataRequest : public DriveApiPartialFieldRequest {
|
||||
switch (error) {
|
||||
case HTTP_SUCCESS:
|
||||
case HTTP_CREATED:
|
||||
base::PostTaskAndReplyWithResult(
|
||||
blocking_task_runner(), FROM_HERE,
|
||||
blocking_task_runner()->PostTaskAndReplyWithResult(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&DriveApiDataRequest::Parse,
|
||||
std::move(response_body)),
|
||||
base::BindOnce(&DriveApiDataRequest::OnDataParsed,
|
||||
|
@ -19,7 +19,6 @@
|
||||
#include "base/strings/string_piece.h"
|
||||
#include "base/strings/stringprintf.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/values.h"
|
||||
#include "google_apis/common/request_sender.h"
|
||||
@ -66,9 +65,8 @@ void ParseJsonOnBlockingPool(
|
||||
base::TaskRunner* blocking_task_runner,
|
||||
std::string json,
|
||||
base::OnceCallback<void(std::unique_ptr<base::Value> value)> callback) {
|
||||
base::PostTaskAndReplyWithResult(
|
||||
blocking_task_runner, FROM_HERE,
|
||||
base::BindOnce(&google_apis::ParseJson, std::move(json)),
|
||||
blocking_task_runner->PostTaskAndReplyWithResult(
|
||||
FROM_HERE, base::BindOnce(&google_apis::ParseJson, std::move(json)),
|
||||
std::move(callback));
|
||||
}
|
||||
|
||||
@ -479,8 +477,8 @@ void MultipartUploadRequestBase::Prepare(PrepareCallback callback) {
|
||||
// |UrlFetchRequestBase::Cancel| and OnPrepareUploadContent won't be called.
|
||||
std::string* const upload_content_type = new std::string();
|
||||
std::string* const upload_content_data = new std::string();
|
||||
PostTaskAndReplyWithResult(
|
||||
blocking_task_runner_.get(), FROM_HERE,
|
||||
blocking_task_runner_->PostTaskAndReplyWithResult(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&GetMultipartContent, boundary_, metadata_json_,
|
||||
content_type_, local_path_,
|
||||
base::Unretained(upload_content_type),
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include "base/mac/scoped_nsobject.h"
|
||||
#include "base/memory/raw_ptr.h"
|
||||
#include "base/ranges/algorithm.h"
|
||||
#include "base/task/task_runner_util.h"
|
||||
#include "base/threading/thread_checker.h"
|
||||
|
||||
namespace {
|
||||
@ -239,8 +238,8 @@ void SuspendObserverDelegate::StartObserver(
|
||||
// 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
|
||||
// released in DoStartObserver().
|
||||
base::PostTaskAndReplyWithResult(
|
||||
device_thread.get(), FROM_HERE, base::BindOnce(base::RetainBlock(^{
|
||||
device_thread->PostTaskAndReplyWithResult(
|
||||
FROM_HERE, base::BindOnce(base::RetainBlock(^{
|
||||
return [ListCameras() retain];
|
||||
})),
|
||||
base::BindOnce(&SuspendObserverDelegate::DoStartObserver, this));
|
||||
@ -252,8 +251,8 @@ void SuspendObserverDelegate::OnDeviceChanged(
|
||||
// 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
|
||||
// is retained in |device_thread| and released in DoOnDeviceChanged().
|
||||
PostTaskAndReplyWithResult(
|
||||
device_thread.get(), FROM_HERE, base::BindOnce(base::RetainBlock(^{
|
||||
device_thread->PostTaskAndReplyWithResult(
|
||||
FROM_HERE, base::BindOnce(base::RetainBlock(^{
|
||||
return [ListCameras() retain];
|
||||
})),
|
||||
base::BindOnce(&SuspendObserverDelegate::DoOnDeviceChanged, this));
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include "base/path_service.h"
|
||||
#include "base/sequence_checker.h"
|
||||
#include "base/task/sequenced_task_runner.h"
|
||||
#include "base/task/task_runner_util.h"
|
||||
#include "base/task/thread_pool.h"
|
||||
#include "base/threading/sequenced_task_runner_handle.h"
|
||||
#include "build/build_config.h"
|
||||
@ -166,8 +165,8 @@ void LocalFileReader::Open(OpenCallback callback) {
|
||||
SetState(FileOperations::kBusy);
|
||||
file_task_runner_ = CreateFileTaskRunner();
|
||||
file_proxy_.emplace(file_task_runner_.get());
|
||||
base::PostTaskAndReplyWithResult(
|
||||
file_task_runner_.get(), FROM_HERE, base::BindOnce(&EnsureUserContext),
|
||||
file_task_runner_->PostTaskAndReplyWithResult(
|
||||
FROM_HERE, base::BindOnce(&EnsureUserContext),
|
||||
base::BindOnce(&LocalFileReader::OnEnsureUserResult,
|
||||
weak_ptr_factory_.GetWeakPtr(), std::move(callback)));
|
||||
}
|
||||
@ -310,8 +309,8 @@ void LocalFileWriter::Open(const base::FilePath& filename, Callback callback) {
|
||||
SetState(FileOperations::kBusy);
|
||||
file_task_runner_ = CreateFileTaskRunner();
|
||||
file_proxy_.emplace(file_task_runner_.get());
|
||||
base::PostTaskAndReplyWithResult(
|
||||
file_task_runner_.get(), FROM_HERE, base::BindOnce([] {
|
||||
file_task_runner_->PostTaskAndReplyWithResult(
|
||||
FROM_HERE, base::BindOnce([] {
|
||||
return EnsureUserContext().AndThen(
|
||||
[](absl::monostate) { return GetDesktopDirectory(); });
|
||||
}),
|
||||
@ -393,9 +392,8 @@ void LocalFileWriter::OnGetTargetDirectoryResult(
|
||||
base::FilePath temp_filepath =
|
||||
destination_filepath_.AddExtensionASCII(kTempFileExtension);
|
||||
|
||||
PostTaskAndReplyWithResult(
|
||||
file_task_runner_.get(), FROM_HERE,
|
||||
base::BindOnce(&base::GetUniquePath, temp_filepath),
|
||||
file_task_runner_->PostTaskAndReplyWithResult(
|
||||
FROM_HERE, base::BindOnce(&base::GetUniquePath, temp_filepath),
|
||||
base::BindOnce(&LocalFileWriter::CreateTempFile,
|
||||
weak_ptr_factory_.GetWeakPtr(), std::move(callback)));
|
||||
}
|
||||
@ -488,9 +486,8 @@ void LocalFileWriter::OnCloseResult(Callback callback,
|
||||
return;
|
||||
}
|
||||
|
||||
base::PostTaskAndReplyWithResult(
|
||||
file_task_runner_.get(), FROM_HERE,
|
||||
base::BindOnce(&base::GetUniquePath, destination_filepath_),
|
||||
file_task_runner_->PostTaskAndReplyWithResult(
|
||||
FROM_HERE, base::BindOnce(&base::GetUniquePath, destination_filepath_),
|
||||
base::BindOnce(&LocalFileWriter::MoveToDestination,
|
||||
weak_ptr_factory_.GetWeakPtr(), std::move(callback)));
|
||||
}
|
||||
@ -508,8 +505,8 @@ void LocalFileWriter::MoveToDestination(Callback callback,
|
||||
|
||||
destination_filepath_ = std::move(destination_filepath);
|
||||
|
||||
PostTaskAndReplyWithResult(
|
||||
file_task_runner_.get(), FROM_HERE,
|
||||
file_task_runner_->PostTaskAndReplyWithResult(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&base::Move, temp_filepath_, destination_filepath_),
|
||||
base::BindOnce(&LocalFileWriter::OnMoveResult,
|
||||
weak_ptr_factory_.GetWeakPtr(), std::move(callback)));
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include "base/system/sys_info.h"
|
||||
#include "base/task/single_thread_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/time/time.h"
|
||||
#include "base/trace_event/trace_event.h"
|
||||
@ -753,10 +752,10 @@ void BlobMemoryController::CalculateBlobStorageLimits() {
|
||||
return;
|
||||
did_schedule_limit_calculation_ = true;
|
||||
if (file_runner_) {
|
||||
PostTaskAndReplyWithResult(
|
||||
file_runner_.get(), FROM_HERE,
|
||||
base::BindOnce(&CalculateBlobStorageLimitsImpl, blob_storage_dir_,
|
||||
true, amount_of_memory_for_testing_),
|
||||
file_runner_->PostTaskAndReplyWithResult(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&CalculateBlobStorageLimitsImpl, blob_storage_dir_, true,
|
||||
amount_of_memory_for_testing_),
|
||||
base::BindOnce(&BlobMemoryController::OnStorageLimitsCalculated,
|
||||
weak_factory_.GetWeakPtr()));
|
||||
} else {
|
||||
|
@ -22,7 +22,6 @@ specific_include_rules = {
|
||||
"+base/strings/string_split.h",
|
||||
"+base/strings/utf_string_conversions.h",
|
||||
"+base/task/current_thread.h",
|
||||
"+base/task/task_runner_util.h",
|
||||
"+base/threading/thread.h",
|
||||
"+components/viz/test",
|
||||
"+media/base",
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/task/single_thread_task_runner.h"
|
||||
#include "base/task/task_runner_util.h"
|
||||
#include "base/test/bind.h"
|
||||
#include "base/test/gmock_callback_support.h"
|
||||
#include "base/test/mock_callback.h"
|
||||
|
@ -4,7 +4,6 @@ include_rules = [
|
||||
"+base/memory/unsafe_shared_memory_region.h",
|
||||
"+base/memory/shared_memory_mapping.h",
|
||||
"+base/strings/string_piece.h",
|
||||
"+base/task/task_runner_util.h",
|
||||
"+base/threading/sequenced_task_runner_handle.h",
|
||||
"+base/threading/thread_restrictions.h",
|
||||
"+cc/paint",
|
||||
|
@ -13,7 +13,6 @@ include_rules = [
|
||||
"+base/strings/utf_string_conversions.h",
|
||||
"+base/task/bind_post_task.h",
|
||||
"+base/task/task_runner.h",
|
||||
"+base/task/task_runner_util.h",
|
||||
"+base/threading/thread.h",
|
||||
"+cc/layers",
|
||||
"+components/viz/common",
|
||||
|
Reference in New Issue
Block a user