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

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

Issue 2718293003: scheduler: Ensure consistent delayed task ordering between task queues (Closed)
Patch Set: Review comments Created 3 years, 10 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/time_domain.h
diff --git a/third_party/WebKit/Source/platform/scheduler/base/time_domain.h b/third_party/WebKit/Source/platform/scheduler/base/time_domain.h
index c2b828a8bddf288660b917a7d94825b0122c0491..4c965977c2556fbccb15878d912b56fbf3a43f82 100644
--- a/third_party/WebKit/Source/platform/scheduler/base/time_domain.h
+++ b/third_party/WebKit/Source/platform/scheduler/base/time_domain.h
@@ -94,7 +94,7 @@ class BLINK_PLATFORM_EXPORT TimeDomain {
// TimeDomain reaches |delayed_run_time|. This supersedes any previously
// registered wakeup for |queue|.
void ScheduleDelayedWork(internal::TaskQueueImpl* queue,
- base::TimeTicks delayed_run_time,
+ internal::TaskQueueImpl::DelayedWakeUp wake_up,
base::TimeTicks now);
// Cancels any scheduled calls to TaskQueueImpl::WakeUpForDelayedWork for
@@ -137,14 +137,12 @@ class BLINK_PLATFORM_EXPORT TimeDomain {
}
private:
- struct DelayedWakeup {
- base::TimeTicks time;
+ struct ScheduledDelayedWakeUp {
+ internal::TaskQueueImpl::DelayedWakeUp wake_up;
internal::TaskQueueImpl* queue;
- bool operator<=(const DelayedWakeup& other) const {
- if (time == other.time)
- return queue <= other.queue;
- return time < other.time;
+ bool operator<=(const ScheduledDelayedWakeUp& other) const {
+ return wake_up <= other.wake_up;
}
void SetHeapHandle(HeapHandle handle) {
@@ -161,7 +159,7 @@ class BLINK_PLATFORM_EXPORT TimeDomain {
}
};
- IntrusiveHeap<DelayedWakeup> delayed_wakeup_queue_;
+ IntrusiveHeap<ScheduledDelayedWakeUp> delayed_wakeup_queue_;
Observer* const observer_; // NOT OWNED.

Powered by Google App Engine
This is Rietveld 408576698