Chromium Code Reviews

Unified Diff: base/task_scheduler/post_task.cc

Issue 2637843002: Migrate base::TaskRunner from Closure to OnceClosure (Closed)
Patch Set: rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « base/task_scheduler/post_task.h ('k') | base/task_scheduler/scheduler_single_thread_task_runner_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task_scheduler/post_task.cc
diff --git a/base/task_scheduler/post_task.cc b/base/task_scheduler/post_task.cc
index 0781e85920c586bf23b62e8d8d8b043fb77511e7..6f9adae27f4cc3312928d773a522058761e7ea32 100644
--- a/base/task_scheduler/post_task.cc
+++ b/base/task_scheduler/post_task.cc
@@ -21,7 +21,7 @@ class PostTaskAndReplyTaskRunner : public internal::PostTaskAndReplyImpl {
private:
bool PostTask(const tracked_objects::Location& from_here,
- Closure task) override {
+ OnceClosure task) override {
PostTaskWithTraits(from_here, traits_, std::move(task));
return true;
}
@@ -32,43 +32,43 @@ class PostTaskAndReplyTaskRunner : public internal::PostTaskAndReplyImpl {
} // namespace
-void PostTask(const tracked_objects::Location& from_here, Closure task) {
+void PostTask(const tracked_objects::Location& from_here, OnceClosure task) {
PostDelayedTask(from_here, std::move(task), TimeDelta());
}
void PostDelayedTask(const tracked_objects::Location& from_here,
- Closure task,
+ OnceClosure task,
TimeDelta delay) {
PostDelayedTaskWithTraits(from_here, TaskTraits(), std::move(task), delay);
}
void PostTaskAndReply(const tracked_objects::Location& from_here,
- Closure task,
- Closure reply) {
+ OnceClosure task,
+ OnceClosure reply) {
PostTaskWithTraitsAndReply(from_here, TaskTraits(), std::move(task),
std::move(reply));
}
void PostTaskWithTraits(const tracked_objects::Location& from_here,
const TaskTraits& traits,
- Closure task) {
+ OnceClosure task) {
PostDelayedTaskWithTraits(from_here, traits, std::move(task), TimeDelta());
}
void PostDelayedTaskWithTraits(const tracked_objects::Location& from_here,
const TaskTraits& traits,
- Closure task,
+ OnceClosure task,
TimeDelta delay) {
DCHECK(TaskScheduler::GetInstance())
<< "Ref. Prerequisite section of post_task.h";
TaskScheduler::GetInstance()->PostDelayedTaskWithTraits(
- from_here, traits, std::move(task), delay);
+ from_here, traits, std::move(task), std::move(delay));
}
void PostTaskWithTraitsAndReply(const tracked_objects::Location& from_here,
const TaskTraits& traits,
- Closure task,
- Closure reply) {
+ OnceClosure task,
+ OnceClosure reply) {
PostTaskAndReplyTaskRunner(traits).PostTaskAndReply(
from_here, std::move(task), std::move(reply));
}
« no previous file with comments | « base/task_scheduler/post_task.h ('k') | base/task_scheduler/scheduler_single_thread_task_runner_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine