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

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: 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 63ecf665dd52ad710f1d59ce6a828b24ea712209..fb05df9c1211c9f266215ab8d334e8113f6647b9 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
@@ -23,9 +23,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) {
@@ -259,8 +256,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),
virtual_time_(false),
weak_factory_(this) {
pump_throttled_tasks_closure_.Reset(base::Bind(
@@ -528,10 +523,12 @@ void TaskQueueThrottler::EnableVirtualTime() {
}
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