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

Unified Diff: third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc

Issue 2471153002: [scheduler] Use Finch to control background throttling. (Closed)
Patch Set: Fix test and address comments Created 4 years, 1 month 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/renderer/task_queue_throttler.cc
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc b/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc
index bb262a10f0076c1067657781b9c1b6ad0cb754e4..64b93af39e2fe497200e2def193de4d0259e444c 100644
--- a/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc
+++ b/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc
@@ -22,9 +22,6 @@ namespace blink {
namespace scheduler {
namespace {
-constexpr base::TimeDelta kMaxBudgetLevel = base::TimeDelta::FromSeconds(1);
-constexpr base::TimeDelta kMaxThrottlingDuration =
- base::TimeDelta::FromMinutes(1);
base::Optional<base::TimeTicks> NextTaskRunTime(LazyNow* lazy_now,
TaskQueue* queue) {
@@ -272,8 +269,6 @@ TaskQueueThrottler::TaskQueueThrottler(
tick_clock_(renderer_scheduler->tick_clock()),
tracing_category_(tracing_category),
time_domain_(new ThrottledTimeDomain(this, tracing_category)),
- max_budget_level_(kMaxBudgetLevel),
- max_throttling_duration_(kMaxThrottlingDuration),
allow_throttling_(true),
weak_factory_(this) {
pump_throttled_tasks_closure_.Reset(base::Bind(
@@ -515,10 +510,12 @@ void TaskQueueThrottler::MaybeSchedulePumpThrottledTasks(
}
TaskQueueThrottler::TimeBudgetPool* TaskQueueThrottler::CreateTimeBudgetPool(
- const char* name) {
+ const char* name,
+ base::Optional<base::TimeDelta> max_budget_level,
+ base::Optional<base::TimeDelta> max_throttling_duration) {
TimeBudgetPool* time_budget_pool =
- new TimeBudgetPool(name, this, tick_clock_->NowTicks(), max_budget_level_,
- max_throttling_duration_);
+ new TimeBudgetPool(name, this, tick_clock_->NowTicks(), max_budget_level,
+ max_throttling_duration);
time_budget_pools_[time_budget_pool] = base::WrapUnique(time_budget_pool);
return time_budget_pool;
}

Powered by Google App Engine
This is Rietveld 408576698