#include "third_party/blink/renderer/platform/scheduler/common/throttling/cpu_time_budget_pool.h"
#include <cstdint>
#include <optional>
#include "base/check_op.h"
#include "third_party/blink/renderer/platform/scheduler/common/throttling/task_queue_throttler.h"
namespace blink {
namespace scheduler {
TaskQueue;
CPUTimeBudgetPool::CPUTimeBudgetPool(
const char* name,
TraceableVariableController* tracing_controller,
base::TimeTicks now)
: … { … }
CPUTimeBudgetPool::~CPUTimeBudgetPool() = default;
QueueBlockType CPUTimeBudgetPool::GetBlockType() const { … }
void CPUTimeBudgetPool::SetMaxBudgetLevel(
base::TimeTicks now,
std::optional<base::TimeDelta> max_budget_level) { … }
void CPUTimeBudgetPool::SetMaxThrottlingDelay(
base::TimeTicks now,
std::optional<base::TimeDelta> max_throttling_delay) { … }
void CPUTimeBudgetPool::SetTimeBudgetRecoveryRate(base::TimeTicks now,
double cpu_percentage) { … }
void CPUTimeBudgetPool::GrantAdditionalBudget(base::TimeTicks now,
base::TimeDelta budget_level) { … }
void CPUTimeBudgetPool::SetReportingCallback(
base::RepeatingCallback<void(base::TimeDelta)> reporting_callback) { … }
bool CPUTimeBudgetPool::CanRunTasksAt(base::TimeTicks moment) const { … }
base::TimeTicks CPUTimeBudgetPool::GetTimeTasksCanRunUntil(
base::TimeTicks now) const { … }
base::TimeTicks CPUTimeBudgetPool::GetNextAllowedRunTime(
base::TimeTicks desired_run_time) const { … }
void CPUTimeBudgetPool::RecordTaskRunTime(base::TimeTicks start_time,
base::TimeTicks end_time) { … }
void CPUTimeBudgetPool::OnWakeUp(base::TimeTicks now) { … }
void CPUTimeBudgetPool::WriteIntoTrace(perfetto::TracedValue context,
base::TimeTicks now) const { … }
void CPUTimeBudgetPool::Advance(base::TimeTicks now) { … }
void CPUTimeBudgetPool::EnforceBudgetLevelRestrictions() { … }
}
}