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

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: Rebased 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 551c6c5fc530f3a4e93021a9fe296cb2ed683fa0..baf39ca80fd522891e172720641492e0b19e17a3 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) {
@@ -261,8 +258,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(
@@ -504,10 +499,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