refactor: migrate base::ThreadPool() as trait to base::ThreadPool:: API (#22555)

This commit is contained in:
Shelley Vohr 2020-03-09 16:13:59 +00:00 committed by GitHub
parent 2159b4af4f
commit 3b08736ae2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 24 additions and 24 deletions

View file

@ -8,6 +8,7 @@
#include "base/files/file_util.h"
#include "base/optional.h"
#include "base/task/thread_pool.h"
#include "base/threading/thread_restrictions.h"
#include "content/public/browser/tracing_controller.h"
#include "shell/common/gin_converters/callback_converter.h"
@ -86,10 +87,8 @@ v8::Local<v8::Promise> StopRecording(gin_helper::Arguments* args) {
StopTracing(std::move(promise), base::make_optional(path));
} else {
// use a temporary file.
base::PostTaskAndReplyWithResult(
FROM_HERE,
{base::ThreadPool(), base::MayBlock(),
base::TaskPriority::USER_VISIBLE},
base::ThreadPool::PostTaskAndReplyWithResult(
FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_VISIBLE},
base::BindOnce(CreateTemporaryFileOnIO),
base::BindOnce(StopTracing, std::move(promise)));
}

View file

@ -7,6 +7,7 @@
#include <utility>
#include "base/command_line.h"
#include "base/task/thread_pool.h"
#include "chrome/browser/browser_process.h"
#include "components/net_log/chrome_net_log.h"
#include "content/public/browser/storage_partition.h"
@ -52,8 +53,8 @@ scoped_refptr<base::SequencedTaskRunner> CreateFileTaskRunner() {
//
// These operations can be skipped on shutdown since FileNetLogObserver's API
// doesn't require things to have completed until notified of completion.
return base::CreateSequencedTaskRunner(
{base::ThreadPool(), base::MayBlock(), base::TaskPriority::USER_VISIBLE,
return base::ThreadPool::CreateSequencedTaskRunner(
{base::MayBlock(), base::TaskPriority::USER_VISIBLE,
base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN});
}

View file

@ -1949,9 +1949,8 @@ void WebContents::Print(gin_helper::Arguments* args) {
settings.SetIntKey(printing::kSettingDpiVertical, dpi);
}
base::PostTaskAndReplyWithResult(
FROM_HERE,
{base::ThreadPool(), base::MayBlock(), base::TaskPriority::USER_BLOCKING},
base::ThreadPool::PostTaskAndReplyWithResult(
FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_BLOCKING},
base::BindOnce(&GetDefaultPrinterAsync),
base::BindOnce(&WebContents::OnGetDefaultPrinter,
weak_factory_.GetWeakPtr(), std::move(settings),