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

Unified Diff: base/task_scheduler/post_task.cc

Issue 2613703003: Add base::PostDelayedTask(WithTraits). (Closed)
Patch Set: self-review Created 3 years, 11 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/task_scheduler/post_task.h ('k') | base/task_scheduler/task_scheduler.h » ('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 737a219c26039b5e28bef8661e9f74538e1ff2af..8c3e941a303a9c874123327d470c6f1853101999 100644
--- a/base/task_scheduler/post_task.cc
+++ b/base/task_scheduler/post_task.cc
@@ -30,7 +30,13 @@ class PostTaskAndReplyTaskRunner : public internal::PostTaskAndReplyImpl {
} // namespace
void PostTask(const tracked_objects::Location& from_here, const Closure& task) {
- PostTaskWithTraits(from_here, TaskTraits(), task);
+ PostDelayedTask(from_here, task, TimeDelta());
+}
+
+void PostDelayedTask(const tracked_objects::Location& from_here,
+ const Closure& task,
+ TimeDelta delay) {
+ PostDelayedTaskWithTraits(from_here, TaskTraits(), task, delay);
}
void PostTaskAndReply(const tracked_objects::Location& from_here,
@@ -42,7 +48,15 @@ void PostTaskAndReply(const tracked_objects::Location& from_here,
void PostTaskWithTraits(const tracked_objects::Location& from_here,
const TaskTraits& traits,
const Closure& task) {
- TaskScheduler::GetInstance()->PostTaskWithTraits(from_here, traits, task);
+ PostDelayedTaskWithTraits(from_here, traits, task, TimeDelta());
+}
+
+void PostDelayedTaskWithTraits(const tracked_objects::Location& from_here,
+ const TaskTraits& traits,
+ const Closure& task,
+ TimeDelta delay) {
+ TaskScheduler::GetInstance()->PostDelayedTaskWithTraits(from_here, traits,
+ task, delay);
}
void PostTaskWithTraitsAndReply(const tracked_objects::Location& from_here,
« no previous file with comments | « base/task_scheduler/post_task.h ('k') | base/task_scheduler/task_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698