Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3402)

Unified Diff: base/threading/sequenced_worker_pool.cc

Issue 2859053006: Use constexpr TaskTraits constructor in base (part 2). (Closed)
Patch Set: self-review Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/test/scoped_task_scheduler_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/sequenced_worker_pool.cc
diff --git a/base/threading/sequenced_worker_pool.cc b/base/threading/sequenced_worker_pool.cc
index df218a623fafaa15d755e65b15c265a6df69c766..bd87e098f904109de61b3f55d069ed60d228b265 100644
--- a/base/threading/sequenced_worker_pool.cc
+++ b/base/threading/sequenced_worker_pool.cc
@@ -826,11 +826,8 @@ bool SequencedWorkerPool::Inner::PostTaskToTaskScheduler(
const TaskShutdownBehavior task_shutdown_behavior =
static_cast<TaskShutdownBehavior>(sequenced.shutdown_behavior);
- const TaskTraits traits = TaskTraits()
- .MayBlock()
- .WithBaseSyncPrimitives()
- .WithPriority(task_priority_)
- .WithShutdownBehavior(task_shutdown_behavior);
+ const TaskTraits traits = {MayBlock(), WithBaseSyncPrimitives(),
+ task_priority_, task_shutdown_behavior};
return GetTaskSchedulerTaskRunner(sequenced.sequence_token_id, traits)
->PostDelayedTask(sequenced.posted_from, std::move(sequenced.task),
delay);
@@ -880,8 +877,7 @@ bool SequencedWorkerPool::Inner::RunsTasksOnCurrentThread() const {
if (g_all_pools_state == AllPoolsState::REDIRECTED_TO_TASK_SCHEDULER) {
if (!runs_tasks_on_verifier_) {
runs_tasks_on_verifier_ = CreateTaskRunnerWithTraits(
- TaskTraits().MayBlock().WithBaseSyncPrimitives().WithPriority(
- task_priority_));
+ {MayBlock(), WithBaseSyncPrimitives(), task_priority_});
}
return runs_tasks_on_verifier_->RunsTasksOnCurrentThread();
} else {
« no previous file with comments | « base/test/scoped_task_scheduler_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698