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

Unified Diff: base/task_scheduler/task_scheduler.h

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.cc ('k') | base/task_scheduler/task_scheduler_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task_scheduler/task_scheduler.h
diff --git a/base/task_scheduler/task_scheduler.h b/base/task_scheduler/task_scheduler.h
index d4084c6f8a86af0d25a060c76fd958588e341aa7..5d9344bcbad7e52502f645ce3001026621d1dbe2 100644
--- a/base/task_scheduler/task_scheduler.h
+++ b/base/task_scheduler/task_scheduler.h
@@ -15,6 +15,7 @@
#include "base/single_thread_task_runner.h"
#include "base/task_runner.h"
#include "base/task_scheduler/task_traits.h"
+#include "base/time/time.h"
namespace tracked_objects {
class Location;
@@ -39,11 +40,13 @@ class BASE_EXPORT TaskScheduler {
virtual ~TaskScheduler() = default;
- // Posts |task| with specific |traits|.
+ // Posts |task| with a |delay| and specific |traits|. |delay| can be zero.
// For one off tasks that don't require a TaskRunner.
- virtual void PostTaskWithTraits(const tracked_objects::Location& from_here,
- const TaskTraits& traits,
- const Closure& task) = 0;
+ virtual void PostDelayedTaskWithTraits(
+ const tracked_objects::Location& from_here,
+ const TaskTraits& traits,
+ const Closure& task,
+ TimeDelta delay) = 0;
// Returns a TaskRunner whose PostTask invocations result in scheduling tasks
// using |traits|. Tasks may run in any order and in parallel.
« no previous file with comments | « base/task_scheduler/post_task.cc ('k') | base/task_scheduler/task_scheduler_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698