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

Unified Diff: third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h

Issue 2786083005: scheduler: Maintain a constant enqueue order for every task (Closed)
Patch Set: WASM workaround no longer needed 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
Index: third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h
diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h
index 02be214e55591f00dd7fc00dd2c297678b504743..8dd17c140d3e346bebb2c1b3f21210ce751aa40f 100644
--- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h
+++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h
@@ -49,8 +49,7 @@ class WorkQueueSets;
// Delayed tasks are initially posted to delayed_incoming_queue and a wake-up
// is scheduled with the TimeDomain. When the delay has elapsed, the TimeDomain
// calls UpdateDelayedWorkQueue and ready delayed tasks are moved into the
-// delayed_work_queue. Note the EnqueueOrder (used for ordering) for a delayed
-// task is not set until it's moved into the delayed_work_queue.
+// delayed_work_queue.
//
// TaskQueueImpl uses the WorkQueueSets and the TaskQueueSelector to implement
// prioritization. Task selection is done by the TaskQueueSelector and when a
@@ -85,8 +84,7 @@ class BLINK_PLATFORM_EXPORT TaskQueueImpl final : public TaskQueue {
Task();
Task(const tracked_objects::Location& posted_from,
base::OnceClosure task,
- base::TimeTicks desired_run_time,
- EnqueueOrder sequence_number,
+ EnqueueOrder enqueue_order,
bool nestable);
Task(const tracked_objects::Location& posted_from,
@@ -101,28 +99,10 @@ class BLINK_PLATFORM_EXPORT TaskQueueImpl final : public TaskQueue {
}
EnqueueOrder enqueue_order() const {
-#ifndef NDEBUG
- DCHECK(enqueue_order_set_);
-#endif
return enqueue_order_;
}
- void set_enqueue_order(EnqueueOrder enqueue_order) {
-#ifndef NDEBUG
- DCHECK(!enqueue_order_set_);
- enqueue_order_set_ = true;
-#endif
- enqueue_order_ = enqueue_order;
- }
-
-#ifndef NDEBUG
- bool enqueue_order_set() const { return enqueue_order_set_; }
-#endif
-
private:
-#ifndef NDEBUG
- bool enqueue_order_set_;
-#endif
// Similar to sequence number, but ultimately the |enqueue_order_| is what
// the scheduler uses for task ordering. For immediate tasks |enqueue_order|
// is set when posted, but for delayed tasks it's not defined until they are
@@ -219,7 +199,7 @@ class BLINK_PLATFORM_EXPORT TaskQueueImpl final : public TaskQueue {
}
void PushImmediateIncomingTaskForTest(TaskQueueImpl::Task&& task);
- EnqueueOrder GetFenceForTest() const;
+ SequenceNumber GetFenceForTest() const;
class QueueEnabledVoterImpl : public QueueEnabledVoter {
public:
@@ -284,7 +264,7 @@ class BLINK_PLATFORM_EXPORT TaskQueueImpl final : public TaskQueue {
int is_enabled_refcount;
int voter_refcount;
base::trace_event::BlameContext* blame_context; // Not owned.
- EnqueueOrder current_fence;
+ SequenceNumber current_fence;
base::TimeTicks scheduled_time_domain_wake_up;
};
@@ -317,8 +297,7 @@ class BLINK_PLATFORM_EXPORT TaskQueueImpl final : public TaskQueue {
void PushOntoImmediateIncomingQueueLocked(
const tracked_objects::Location& posted_from,
base::OnceClosure task,
- base::TimeTicks desired_run_time,
- EnqueueOrder sequence_number,
+ EnqueueOrder enqueue_order,
bool nestable);
// Extracts all the tasks from the immediate incoming queue and clears it.

Powered by Google App Engine
This is Rietveld 408576698