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

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

Issue 2533603002: [scheduler] Add options to TaskQueue::InsertFence (Closed)
Patch Set: More nits 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
« no previous file with comments | « third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler_unittest.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 4f48b0024cec6e19689cc5c8f130d600a5ff713e..ac36e75926a4782d0284fa312d650b15bae76e80 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,18 @@ 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;
- // 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;
+ enum class InsertFencePosition {
+ NOW, // Tasks posted on the queue up till this point further may run.
+ // All further tasks are blocked.
+ BEGINNING_OF_TIME, // No tasks posted on this queue may run.
+ };
+
+ // Inserts a barrier into the task queue which prevents tasks with an enqueue
+ // order greater than the fence from running until either the fence has been
+ // removed or a subsequent fence has unblocked some tasks within the queue.
+ // Note: delayed tasks get their enqueue order set once their delay has
+ // expired, and non-delayed tasks get their enqueue order set when posted.
+ virtual void InsertFence(InsertFencePosition position) = 0;
// Removes any previously added fence and unblocks execution of any tasks
// blocked by it.
« no previous file with comments | « third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698