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

Unified Diff: third_party/WebKit/public/platform/scheduler/base/task_queue.h

Issue 2798563003: [scheduler] Add TaskQueue::Observer (Closed)
Patch Set: Rebased Created 3 years, 8 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 | « third_party/WebKit/Source/platform/scheduler/renderer/throttled_time_domain.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/public/platform/scheduler/base/task_queue.h
diff --git a/third_party/WebKit/public/platform/scheduler/base/task_queue.h b/third_party/WebKit/public/platform/scheduler/base/task_queue.h
index da4102e477edd7e008de9833827167e9542a197c..de227cc40f376a60f8b96c724160cf3e6c9f7efa 100644
--- a/third_party/WebKit/public/platform/scheduler/base/task_queue.h
+++ b/third_party/WebKit/public/platform/scheduler/base/task_queue.h
@@ -27,6 +27,20 @@ class BLINK_PLATFORM_EXPORT TaskQueue : public base::SingleThreadTaskRunner {
public:
TaskQueue() {}
+ class BLINK_PLATFORM_EXPORT Observer {
+ public:
+ virtual ~Observer() {}
+
+ // Notify observer that the time at which this queue wants to run
+ // the next task has changed. |next_wakeup| can be in the past
+ // (e.g. base::TimeTicks() can be used to notify about immediate work).
+ // Can be called on any thread
+ // All methods but SetObserver, SetTimeDomain and GetTimeDomain can be
+ // called on |queue|.
+ virtual void OnQueueNextWakeUpChanged(TaskQueue* queue,
+ base::TimeTicks next_wake_up) = 0;
+ };
+
// Unregisters the task queue after which no tasks posted to it will run and
// the TaskQueueManager's reference to it will be released soon.
virtual void UnregisterTaskQueue() = 0;
@@ -208,6 +222,8 @@ class BLINK_PLATFORM_EXPORT TaskQueue : public base::SingleThreadTaskRunner {
virtual bool BlockedByFence() const = 0;
+ virtual void SetObserver(Observer* observer) = 0;
+
protected:
~TaskQueue() override {}
« no previous file with comments | « third_party/WebKit/Source/platform/scheduler/renderer/throttled_time_domain.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698