#include "third_party/blink/renderer/core/scheduler/scripted_idle_task_controller.h"
#include "base/debug/crash_logging.h"
#include "base/location.h"
#include "base/metrics/histogram_macros.h"
#include "base/not_fatal_until.h"
#include "third_party/blink/public/mojom/frame/lifecycle.mojom-shared.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_idle_request_options.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/inspector/inspector_trace_events.h"
#include "third_party/blink/renderer/core/probe/core_probes.h"
#include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h"
#include "third_party/blink/renderer/platform/scheduler/public/thread_scheduler.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
namespace blink {
namespace {
void UpdateMaxIdleTasksCrashKey(size_t num_pending_idle_tasks) { … }
void UpdateMaxSchedulerIdleTasksCrashKey(
size_t num_pending_scheduler_idle_tasks) { … }
}
ScriptedIdleTaskController::DelayedTaskCanceler::DelayedTaskCanceler() =
default;
ScriptedIdleTaskController::DelayedTaskCanceler::DelayedTaskCanceler(
base::DelayedTaskHandle delayed_task_handle)
: … { … }
ScriptedIdleTaskController::DelayedTaskCanceler::DelayedTaskCanceler(
DelayedTaskCanceler&&) = default;
ScriptedIdleTaskController::DelayedTaskCanceler&
ScriptedIdleTaskController::DelayedTaskCanceler::operator=(
ScriptedIdleTaskController::DelayedTaskCanceler&&) = default;
ScriptedIdleTaskController::DelayedTaskCanceler::~DelayedTaskCanceler() { … }
const char ScriptedIdleTaskController::kSupplementName[] = …;
ScriptedIdleTaskController& ScriptedIdleTaskController::From(
ExecutionContext& context) { … }
ScriptedIdleTaskController::ScriptedIdleTaskController(
ExecutionContext* context)
: … { … }
ScriptedIdleTaskController::~ScriptedIdleTaskController() = default;
void ScriptedIdleTaskController::Trace(Visitor* visitor) const { … }
int ScriptedIdleTaskController::NextCallbackId() { … }
ScriptedIdleTaskController::CallbackId
ScriptedIdleTaskController::RegisterCallback(
IdleTask* idle_task,
const IdleRequestOptions* options) { … }
void ScriptedIdleTaskController::ScheduleCallback(CallbackId id,
uint32_t timeout_millis) { … }
void ScriptedIdleTaskController::CancelCallback(CallbackId id) { … }
void ScriptedIdleTaskController::PostIdleTask(CallbackId id,
DelayedTaskCanceler canceler) { … }
void ScriptedIdleTaskController::IdleTaskFired(
CallbackId id,
ScriptedIdleTaskController::DelayedTaskCanceler ,
base::TimeTicks deadline) { … }
void ScriptedIdleTaskController::TimeoutFired(CallbackId id) { … }
void ScriptedIdleTaskController::CallbackFired(
CallbackId id,
base::TimeTicks deadline,
IdleDeadline::CallbackType callback_type) { … }
void ScriptedIdleTaskController::RunCallback(
CallbackId id,
base::TimeTicks deadline,
IdleDeadline::CallbackType callback_type) { … }
void ScriptedIdleTaskController::ContextDestroyed() { … }
void ScriptedIdleTaskController::ContextLifecycleStateChanged(
mojom::FrameLifecycleState state) { … }
void ScriptedIdleTaskController::ContextPaused() { … }
void ScriptedIdleTaskController::ContextUnpaused() { … }
}