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

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

Issue 2533603002: [scheduler] Add options to TaskQueue::InsertFence (Closed)
Patch Set: Reupload Created 4 years, 1 month 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
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 4f48b0024cec6e19689cc5c8f130d600a5ff713e..527a2c54ff2e0a3f117d0b923cd284defa7f1079 100644
--- a/third_party/WebKit/public/platform/scheduler/base/task_queue.h
+++ b/third_party/WebKit/public/platform/scheduler/base/task_queue.h
@@ -172,12 +172,20 @@ class BLINK_PLATFORM_EXPORT TaskQueue : public base::SingleThreadTaskRunner {
// Returns the queue's current TimeDomain. Can be called from any thread.
virtual TimeDomain* GetTimeDomain() const = 0;
+ enum class InsertFencePosition {
+ NOW,
alex clarke (OOO till 29th) 2016/11/25 16:20:49 I'm thinking ahead in case we ever add a third val
altimin 2016/11/25 16:59:26 Done.
+ BEGINNING_OF_TIME,
+ };
+
// Inserts a barrier into the task queue which inhibits non-delayed tasks
- // posted after this point, or delayed tasks which are not yet ready to run,
- // from being executed until the fence is cleared. If a fence already existed
- // the one supersedes it and previously blocked tasks will now run up until
- // the new fence is hit.
- virtual void InsertFence() = 0;
+ // posted after given point, or delayed tasks which are not yet ready to run,
+ // from being executed until the fence is cleared. If the fence is installed
+ // at the beginning of time, it will block all tasks in this queue,
+ // effectively disabling it.
+ //
+ // If a fence already existed the one supersedes it and previously blocked
+ // tasks will now run up until the new fence is hit.
+ virtual void InsertFence(InsertFencePosition position) = 0;
// Removes any previously added fence and unblocks execution of any tasks
// blocked by it.

Powered by Google App Engine
This is Rietveld 408576698