#include "third_party/blink/renderer/platform/scheduler/main_thread/main_thread_task_queue.h"
#include <memory>
#include <utility>
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/task/common/scoped_defer_task_posting.h"
#include "base/task/single_thread_task_runner.h"
#include "base/trace_event/base_tracing.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/renderer/platform/scheduler/common/blink_scheduler_single_thread_task_runner.h"
#include "third_party/blink/renderer/platform/scheduler/common/tracing_helper.h"
#include "third_party/blink/renderer/platform/scheduler/main_thread/frame_scheduler_impl.h"
#include "third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl.h"
#include "third_party/blink/renderer/platform/wtf/wtf.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value.h"
namespace blink {
namespace scheduler {
namespace internal {
TaskQueueImpl;
}
ChromeTrackEvent;
RendererMainThreadTaskExecution;
QueueName;
QueueName MainThreadTaskQueue::NameForQueueType(
MainThreadTaskQueue::QueueType queue_type) { … }
bool MainThreadTaskQueue::IsPerFrameTaskQueue(
MainThreadTaskQueue::QueueType queue_type) { … }
MainThreadTaskQueue::MainThreadTaskQueue(
base::sequence_manager::SequenceManager& sequence_manager,
const TaskQueue::Spec& spec,
const QueueCreationParams& params,
MainThreadSchedulerImpl* main_thread_scheduler)
: … { … }
MainThreadTaskQueue::~MainThreadTaskQueue() { … }
void MainThreadTaskQueue::OnTaskStarted(
const base::sequence_manager::Task& task,
const base::sequence_manager::TaskQueue::TaskTiming& task_timing) { … }
void MainThreadTaskQueue::OnTaskCompleted(
const base::sequence_manager::Task& task,
TaskQueue::TaskTiming* task_timing,
base::LazyNow* lazy_now) { … }
void MainThreadTaskQueue::LogTaskExecution(
perfetto::EventContext& ctx,
const base::sequence_manager::Task& task) { … }
void MainThreadTaskQueue::OnTaskRunTimeReported(
TaskQueue::TaskTiming* task_timing) { … }
void MainThreadTaskQueue::DetachTaskQueue() { … }
void MainThreadTaskQueue::SetOnIPCTaskPosted(
base::RepeatingCallback<void(const base::sequence_manager::Task&)>
on_ipc_task_posted_callback) { … }
void MainThreadTaskQueue::DetachOnIPCTaskPostedWhileInBackForwardCache() { … }
void MainThreadTaskQueue::ShutdownTaskQueue() { … }
AgentGroupScheduler* MainThreadTaskQueue::GetAgentGroupScheduler() { … }
FrameSchedulerImpl* MainThreadTaskQueue::GetFrameScheduler() const { … }
void MainThreadTaskQueue::SetFrameSchedulerForTest(
FrameSchedulerImpl* frame_scheduler) { … }
void MainThreadTaskQueue::SetWebSchedulingPriority(
WebSchedulingPriority priority) { … }
void MainThreadTaskQueue::OnWebSchedulingTaskQueueDestroyed() { … }
bool MainThreadTaskQueue::IsThrottled() const { … }
MainThreadTaskQueue::ThrottleHandle MainThreadTaskQueue::Throttle() { … }
void MainThreadTaskQueue::AddToBudgetPool(base::TimeTicks now,
BudgetPool* pool) { … }
void MainThreadTaskQueue::RemoveFromBudgetPool(base::TimeTicks now,
BudgetPool* pool) { … }
void MainThreadTaskQueue::SetWakeUpBudgetPool(
WakeUpBudgetPool* wake_up_budget_pool) { … }
void MainThreadTaskQueue::WriteIntoTrace(perfetto::TracedValue context) const { … }
void MainThreadTaskQueue::QueueTraits::WriteIntoTrace(
perfetto::TracedValue context) const { … }
scoped_refptr<base::SingleThreadTaskRunner>
MainThreadTaskQueue::CreateTaskRunner(TaskType task_type) { … }
scoped_refptr<BlinkSchedulerSingleThreadTaskRunner>
MainThreadTaskQueue::WrapTaskRunner(
scoped_refptr<base::SingleThreadTaskRunner> task_runner) { … }
}
}