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

Unified Diff: components/scheduler/renderer/throttling_helper.cc

Issue 1958283005: Throttling Helper to disable task queue until PumpThrottledTasks called (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typo Created 4 years, 7 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: components/scheduler/renderer/throttling_helper.cc
diff --git a/components/scheduler/renderer/throttling_helper.cc b/components/scheduler/renderer/throttling_helper.cc
index c4843b2d19b92693a51fe158cdd9686cf0d11ef8..31fcb7de54db1bfa34a454ad6f2705819ee7051a 100644
--- a/components/scheduler/renderer/throttling_helper.cc
+++ b/components/scheduler/renderer/throttling_helper.cc
@@ -53,6 +53,7 @@ void ThrottlingHelper::IncreaseThrottleRefCount(TaskQueue* task_queue) {
// The insert was succesful so we need to throttle the queue.
task_queue->SetTimeDomain(time_domain_.get());
task_queue->SetPumpPolicy(TaskQueue::PumpPolicy::MANUAL);
+ task_queue->SetQueueEnabled(false);
if (!task_queue->IsEmpty()) {
if (task_queue->HasPendingImmediateWork()) {
@@ -76,6 +77,7 @@ void ThrottlingHelper::DecreaseThrottleRefCount(TaskQueue* task_queue) {
task_queue->SetTimeDomain(renderer_scheduler_->real_time_domain());
task_queue->SetPumpPolicy(TaskQueue::PumpPolicy::AUTO);
+ task_queue->SetQueueEnabled(true);
}
}
@@ -118,6 +120,7 @@ void ThrottlingHelper::PumpThrottledTasks() {
if (task_queue->IsEmpty())
continue;
+ task_queue->SetQueueEnabled(true);
task_queue->PumpQueue(false);
}
// Make sure NextScheduledRunTime gives us an up-to date result.

Powered by Google App Engine
This is Rietveld 408576698