Index: extensions/common/one_shot_event.h |
diff --git a/extensions/common/one_shot_event.h b/extensions/common/one_shot_event.h |
index 9baa152d2c5ce96924978c451efb4efd8bdb557e..49031243ab9f2b712c05154618cc51b15b75e8bd 100644 |
--- a/extensions/common/one_shot_event.h |
+++ b/extensions/common/one_shot_event.h |
@@ -15,6 +15,7 @@ |
namespace base { |
class TaskRunner; |
+class TimeDelta; |
} |
namespace tracked_objects { |
@@ -55,8 +56,10 @@ class OneShotEvent { |
void Signal(); |
// Scheduled |task| to be called on |runner| after is_signaled() |
- // becomes true. Inside |task|, if this OneShotEvent is still |
- // alive, CHECK(is_signaled()) will never fail (which implies that |
+ // becomes true. If called with |delay|, then the task will happen |
+ // (roughly) |delay| after is_signaled(), *not* |delay| after the |
+ // post. Inside |task|, if this OneShotEvent is still alive, |
+ // CHECK(is_signaled()) will never fail (which implies that |
// OneShotEvent::Reset() doesn't exist). |
// |
// If |*this| is destroyed before being released, none of these |
@@ -78,10 +81,18 @@ class OneShotEvent { |
void Post(const tracked_objects::Location& from_here, |
const base::Closure& task, |
const scoped_refptr<base::TaskRunner>& runner) const; |
+ void PostDelayed(const tracked_objects::Location& from_here, |
+ const base::Closure& task, |
+ const base::TimeDelta& delay) const; |
private: |
struct TaskInfo; |
+ void PostImpl(const tracked_objects::Location& from_here, |
+ const base::Closure& task, |
+ const scoped_refptr<base::TaskRunner>& runner, |
+ const base::TimeDelta& delay) const; |
+ |
base::ThreadChecker thread_checker_; |
bool signaled_; |