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

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

Issue 2583333002: Revert of Dont post delayed DoWork for disabled queues. (Closed)
Patch Set: Created 4 years 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.cc
diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc
index f78e39d2ef4f6d176905f87c830c62f3f762c232..2885ccdf52c2ec39fe0b6c21178b6b8002374722 100644
--- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc
+++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc
@@ -276,15 +276,11 @@
main_thread_only().delayed_incoming_queue.push(std::move(pending_task));
// If |pending_task| is at the head of the queue, then make sure a wakeup
- // is requested if the queue is enabled. Note we still want to schedule a
- // wakeup even if blocked by a fence, because we'd break throttling logic
- // otherwise.
- base::TimeTicks next_delayed_task =
- main_thread_only().delayed_incoming_queue.top().delayed_run_time;
- if (next_delayed_task == delayed_run_time && IsQueueEnabled()) {
- LazyNow lazy_now(now);
- main_thread_only().time_domain->ScheduleDelayedWork(this, delayed_run_time,
- &lazy_now);
+ // is requested.
+ if (main_thread_only().delayed_incoming_queue.top().delayed_run_time ==
+ delayed_run_time) {
+ main_thread_only().time_domain->ScheduleDelayedWork(
+ this, pending_task.delayed_run_time, now);
}
TraceQueueSize(false);
@@ -820,19 +816,10 @@
return;
if (enable) {
- if (!main_thread_only().delayed_incoming_queue.empty()) {
- LazyNow lazy_now = main_thread_only().time_domain->CreateLazyNow();
- main_thread_only().time_domain->ScheduleDelayedWork(
- this,
- main_thread_only().delayed_incoming_queue.top().delayed_run_time,
- &lazy_now);
- }
// Note it's the job of the selector to tell the TaskQueueManager if
- // an immediate DoWork needs posting.
+ // a DoWork needs posting.
main_thread_only().task_queue_manager->selector_.EnableQueue(this);
} else {
- if (!main_thread_only().delayed_incoming_queue.empty())
- main_thread_only().time_domain->CancelDelayedWork(this);
main_thread_only().task_queue_manager->selector_.DisableQueue(this);
}
}

Powered by Google App Engine
This is Rietveld 408576698