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

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: 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..2cc9b65cc58fca7f93e7e0181f204539bbadaed9 100644
--- a/third_party/WebKit/Source/platform/scheduler/base/time_domain.h
+++ b/third_party/WebKit/Source/platform/scheduler/base/time_domain.h
@@ -95,6 +95,7 @@ class BLINK_PLATFORM_EXPORT TimeDomain {
// registered wakeup for |queue|.
void ScheduleDelayedWork(internal::TaskQueueImpl* queue,
base::TimeTicks delayed_run_time,
+ int sequence_num,
base::TimeTicks now);
// Cancels any scheduled calls to TaskQueueImpl::WakeUpForDelayedWork for
@@ -139,11 +140,14 @@ class BLINK_PLATFORM_EXPORT TimeDomain {
private:
struct DelayedWakeup {
base::TimeTicks time;
+ int sequence_num;
internal::TaskQueueImpl* queue;
bool operator<=(const DelayedWakeup& other) const {
- if (time == other.time)
- return queue <= other.queue;
+ if (time == other.time) {
+ DCHECK_NE(sequence_num, other.sequence_num);
+ return (sequence_num - other.sequence_num) < 0;
+ }
return time < other.time;
}

Powered by Google App Engine
This is Rietveld 408576698