Commit 67b84b88 authored by Sami Kyostila's avatar Sami Kyostila Committed by Commit Bot

base/task: Require traits to be given to PostDelayedTask

This change makes it a requirement to pass in TaskTraits to
base::PostDelayedTask(), bringing it in line with the other task posting
APIs.

This patch has no functional changes.

Bug: 968047
Change-Id: I67daf3c1560f9c386578d458a45a3c791786141e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1985773
Commit-Queue: Sami Kyöstilä <skyostil@chromium.org>
Reviewed-by: default avatarGabriel Charette <gab@chromium.org>
Auto-Submit: Sami Kyöstilä <skyostil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#742786}
parent 49fe87ef
...@@ -71,13 +71,9 @@ TaskExecutor* GetTaskExecutorForTraits(const TaskTraits& traits) { ...@@ -71,13 +71,9 @@ TaskExecutor* GetTaskExecutorForTraits(const TaskTraits& traits) {
} // namespace } // namespace
bool PostTask(const Location& from_here, OnceClosure task) { bool PostTask(const Location& from_here, OnceClosure task) {
return PostDelayedTask(from_here, std::move(task), TimeDelta()); // TODO(skyostil): Make task traits required here too.
} return PostDelayedTask(from_here, {ThreadPool()}, std::move(task),
TimeDelta());
bool PostDelayedTask(const Location& from_here,
OnceClosure task,
TimeDelta delay) {
return PostDelayedTask(from_here, {ThreadPool()}, std::move(task), delay);
} }
bool PostTaskAndReply(const Location& from_here, bool PostTaskAndReply(const Location& from_here,
......
...@@ -106,14 +106,6 @@ inline bool PostTask(OnceClosure task, ...@@ -106,14 +106,6 @@ inline bool PostTask(OnceClosure task,
return PostTask(from_here, std::move(task)); return PostTask(from_here, std::move(task));
} }
// Equivalent to calling PostDelayedTask with default TaskTraits.
//
// Use PostDelayedTask to specify a BEST_EFFORT priority if the task doesn't
// have to run as soon as |delay| expires.
BASE_EXPORT bool PostDelayedTask(const Location& from_here,
OnceClosure task,
TimeDelta delay);
// Equivalent to calling PostTaskAndReply with default TaskTraits. // Equivalent to calling PostTaskAndReply with default TaskTraits.
BASE_EXPORT bool PostTaskAndReply(const Location& from_here, BASE_EXPORT bool PostTaskAndReply(const Location& from_here,
OnceClosure task, OnceClosure task,
......
This diff is collapsed.
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