v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::platform::DefaultForegroundTaskRunner Class Reference

#include <default-foreground-task-runner.h>

Inheritance diagram for v8::platform::DefaultForegroundTaskRunner:
Collaboration diagram for v8::platform::DefaultForegroundTaskRunner:

Classes

struct  DelayedEntry
 
struct  DelayedEntryCompare
 
class  RunTaskScope
 

Public Types

using TimeFunction = double (*)()
 

Public Member Functions

 DefaultForegroundTaskRunner (IdleTaskSupport idle_task_support, TimeFunction time_function)
 
void Terminate ()
 
std::unique_ptr< TaskPopTaskFromQueue (MessageLoopBehavior wait_for_work)
 
std::unique_ptr< IdleTaskPopTaskFromIdleQueue ()
 
double MonotonicallyIncreasingTime ()
 
bool IdleTasksEnabled () override
 
bool NonNestableTasksEnabled () const override
 
bool NonNestableDelayedTasksEnabled () const override
 

Private Types

enum  Nestability { kNestable , kNonNestable }
 
using TaskQueueEntry = std::pair<Nestability, std::unique_ptr<Task>>
 

Private Member Functions

void PostTaskImpl (std::unique_ptr< Task > task, const SourceLocation &location) override
 
void PostDelayedTaskImpl (std::unique_ptr< Task > task, double delay_in_seconds, const SourceLocation &location) override
 
void PostIdleTaskImpl (std::unique_ptr< IdleTask > task, const SourceLocation &location) override
 
void PostNonNestableTaskImpl (std::unique_ptr< Task > task, const SourceLocation &location) override
 
void PostNonNestableDelayedTaskImpl (std::unique_ptr< Task > task, double delay_in_seconds, const SourceLocation &location) override
 
void WaitForTaskLocked ()
 
std::unique_ptr< TaskPostTaskLocked (std::unique_ptr< Task > task, Nestability nestability)
 
void PostDelayedTaskLocked (std::unique_ptr< Task > task, double delay_in_seconds, Nestability nestability)
 
std::unique_ptr< TaskPopTaskFromDelayedQueueLocked (Nestability *nestability)
 
bool HasPoppableTaskInQueue () const
 
std::vector< std::unique_ptr< Task > > MoveExpiredDelayedTasksLocked ()
 

Private Attributes

bool terminated_ = false
 
base::Mutex mutex_
 
base::ConditionVariable event_loop_control_
 
int nesting_depth_ = 0
 
std::deque< TaskQueueEntrytask_queue_
 
IdleTaskSupport idle_task_support_
 
std::queue< std::unique_ptr< IdleTask > > idle_task_queue_
 
std::priority_queue< DelayedEntry, std::vector< DelayedEntry >, DelayedEntryComparedelayed_task_queue_
 
TimeFunction time_function_
 

Detailed Description

Definition at line 19 of file default-foreground-task-runner.h.

Member Typedef Documentation

◆ TaskQueueEntry

using v8::platform::DefaultForegroundTaskRunner::TaskQueueEntry = std::pair<Nestability, std::unique_ptr<Task>>
private

Definition at line 99 of file default-foreground-task-runner.h.

◆ TimeFunction

Member Enumeration Documentation

◆ Nestability

Enumerator
kNestable 
kNonNestable 

Definition at line 65 of file default-foreground-task-runner.h.

Constructor & Destructor Documentation

◆ DefaultForegroundTaskRunner()

v8::platform::DefaultForegroundTaskRunner::DefaultForegroundTaskRunner ( IdleTaskSupport idle_task_support,
TimeFunction time_function )

Definition at line 25 of file default-foreground-task-runner.cc.

Member Function Documentation

◆ HasPoppableTaskInQueue()

bool v8::platform::DefaultForegroundTaskRunner::HasPoppableTaskInQueue ( ) const
private

Definition at line 120 of file default-foreground-task-runner.cc.

Here is the caller graph for this function:

◆ IdleTasksEnabled()

bool v8::platform::DefaultForegroundTaskRunner::IdleTasksEnabled ( )
override

Definition at line 102 of file default-foreground-task-runner.cc.

◆ MonotonicallyIncreasingTime()

double v8::platform::DefaultForegroundTaskRunner::MonotonicallyIncreasingTime ( )

Definition at line 65 of file default-foreground-task-runner.cc.

Here is the caller graph for this function:

◆ MoveExpiredDelayedTasksLocked()

std::vector< std::unique_ptr< Task > > v8::platform::DefaultForegroundTaskRunner::MoveExpiredDelayedTasksLocked ( )
private

Definition at line 129 of file default-foreground-task-runner.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ NonNestableDelayedTasksEnabled()

bool v8::platform::DefaultForegroundTaskRunner::NonNestableDelayedTasksEnabled ( ) const
override

Definition at line 116 of file default-foreground-task-runner.cc.

◆ NonNestableTasksEnabled()

bool v8::platform::DefaultForegroundTaskRunner::NonNestableTasksEnabled ( ) const
override

Definition at line 112 of file default-foreground-task-runner.cc.

◆ PopTaskFromDelayedQueueLocked()

std::unique_ptr< Task > v8::platform::DefaultForegroundTaskRunner::PopTaskFromDelayedQueueLocked ( Nestability * nestability)
private

Definition at line 169 of file default-foreground-task-runner.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PopTaskFromIdleQueue()

std::unique_ptr< IdleTask > v8::platform::DefaultForegroundTaskRunner::PopTaskFromIdleQueue ( )

Definition at line 189 of file default-foreground-task-runner.cc.

◆ PopTaskFromQueue()

std::unique_ptr< Task > v8::platform::DefaultForegroundTaskRunner::PopTaskFromQueue ( MessageLoopBehavior wait_for_work)

Definition at line 140 of file default-foreground-task-runner.cc.

Here is the call graph for this function:

◆ PostDelayedTaskImpl()

void v8::platform::DefaultForegroundTaskRunner::PostDelayedTaskImpl ( std::unique_ptr< Task > task,
double delay_in_seconds,
const SourceLocation & location )
overrideprivate

Definition at line 80 of file default-foreground-task-runner.cc.

Here is the call graph for this function:

◆ PostDelayedTaskLocked()

void v8::platform::DefaultForegroundTaskRunner::PostDelayedTaskLocked ( std::unique_ptr< Task > task,
double delay_in_seconds,
Nestability nestability )
private

Definition at line 69 of file default-foreground-task-runner.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PostIdleTaskImpl()

void v8::platform::DefaultForegroundTaskRunner::PostIdleTaskImpl ( std::unique_ptr< IdleTask > task,
const SourceLocation & location )
overrideprivate

Definition at line 94 of file default-foreground-task-runner.cc.

◆ PostNonNestableDelayedTaskImpl()

void v8::platform::DefaultForegroundTaskRunner::PostNonNestableDelayedTaskImpl ( std::unique_ptr< Task > task,
double delay_in_seconds,
const SourceLocation & location )
overrideprivate

Definition at line 87 of file default-foreground-task-runner.cc.

Here is the call graph for this function:

◆ PostNonNestableTaskImpl()

void v8::platform::DefaultForegroundTaskRunner::PostNonNestableTaskImpl ( std::unique_ptr< Task > task,
const SourceLocation & location )
overrideprivate

Definition at line 106 of file default-foreground-task-runner.cc.

Here is the call graph for this function:

◆ PostTaskImpl()

void v8::platform::DefaultForegroundTaskRunner::PostTaskImpl ( std::unique_ptr< Task > task,
const SourceLocation & location )
overrideprivate

Definition at line 59 of file default-foreground-task-runner.cc.

Here is the call graph for this function:

◆ PostTaskLocked()

std::unique_ptr< Task > v8::platform::DefaultForegroundTaskRunner::PostTaskLocked ( std::unique_ptr< Task > task,
Nestability nestability )
private

Definition at line 50 of file default-foreground-task-runner.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Terminate()

void v8::platform::DefaultForegroundTaskRunner::Terminate ( )

Definition at line 29 of file default-foreground-task-runner.cc.

◆ WaitForTaskLocked()

void v8::platform::DefaultForegroundTaskRunner::WaitForTaskLocked ( )
private

Definition at line 199 of file default-foreground-task-runner.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ delayed_task_queue_

std::priority_queue<DelayedEntry, std::vector<DelayedEntry>, DelayedEntryCompare> v8::platform::DefaultForegroundTaskRunner::delayed_task_queue_
private

Definition at line 123 of file default-foreground-task-runner.h.

◆ event_loop_control_

base::ConditionVariable v8::platform::DefaultForegroundTaskRunner::event_loop_control_
private

Definition at line 96 of file default-foreground-task-runner.h.

◆ idle_task_queue_

std::queue<std::unique_ptr<IdleTask> > v8::platform::DefaultForegroundTaskRunner::idle_task_queue_
private

Definition at line 103 of file default-foreground-task-runner.h.

◆ idle_task_support_

IdleTaskSupport v8::platform::DefaultForegroundTaskRunner::idle_task_support_
private

Definition at line 102 of file default-foreground-task-runner.h.

◆ mutex_

base::Mutex v8::platform::DefaultForegroundTaskRunner::mutex_
private

Definition at line 95 of file default-foreground-task-runner.h.

◆ nesting_depth_

int v8::platform::DefaultForegroundTaskRunner::nesting_depth_ = 0
private

Definition at line 97 of file default-foreground-task-runner.h.

◆ task_queue_

std::deque<TaskQueueEntry> v8::platform::DefaultForegroundTaskRunner::task_queue_
private

Definition at line 100 of file default-foreground-task-runner.h.

◆ terminated_

bool v8::platform::DefaultForegroundTaskRunner::terminated_ = false
private

Definition at line 94 of file default-foreground-task-runner.h.

◆ time_function_

TimeFunction v8::platform::DefaultForegroundTaskRunner::time_function_
private

Definition at line 125 of file default-foreground-task-runner.h.


The documentation for this class was generated from the following files: