Index: components/scheduler/base/time_domain.h |
diff --git a/components/scheduler/base/time_domain.h b/components/scheduler/base/time_domain.h |
index 476a68eb5f4299f78b66d2b069fef24320a1b37a..1f58150bdffc73674003840c28d1ea464b6ea7db 100644 |
--- a/components/scheduler/base/time_domain.h |
+++ b/components/scheduler/base/time_domain.h |
@@ -43,6 +43,20 @@ class SCHEDULER_EXPORT TimeDomain : public base::RefCounted<TimeDomain> { |
// runtime for the next one and it returns true. Returns false otherwise. |
bool NextScheduledRunTime(base::TimeTicks* out_time) const; |
+ class SCHEDULER_EXPORT Observer { |
+ public: |
+ virtual ~Observer() {} |
+ |
+ // Called when RegisterAsUpdatableTaskQueue is called. Can fire from any |
+ // thread. |
+ virtual void OnRegisterAsUpdatableTaskQueue() = 0; |
Sami
2015/11/24 12:48:48
How about OnHasNewWork, OnNewIncomingWork, OnNewIm
alex clarke (OOO till 29th)
2015/11/25 12:29:36
Done.
|
+ |
+ // Called when RequestWakeup is called. Called only from the main thread. |
+ virtual void OnRequestWakeup() = 0; |
+ }; |
+ |
+ void SetObserver(Observer* observer); |
+ |
protected: |
friend class internal::TaskQueueImpl; |
friend class TaskQueueManager; |
@@ -115,6 +129,8 @@ class SCHEDULER_EXPORT TimeDomain : public base::RefCounted<TimeDomain> { |
// only be accessed from the main thread. |
std::set<internal::TaskQueueImpl*> updatable_queue_set_; |
+ Observer* observer_; |
+ |
base::ThreadChecker main_thread_checker_; |
DISALLOW_COPY_AND_ASSIGN(TimeDomain); |