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

#include <v8-microtask-queue.h>

Collaboration diagram for v8::MicrotasksScope:

Public Types

enum  Type { kRunMicrotasks , kDoNotRunMicrotasks }
 

Public Member Functions

 MicrotasksScope (Local< Context > context, Type type)
 
 MicrotasksScope (Isolate *isolate, MicrotaskQueue *microtask_queue, Type type)
 
 ~MicrotasksScope ()
 
 MicrotasksScope (const MicrotasksScope &)=delete
 
MicrotasksScopeoperator= (const MicrotasksScope &)=delete
 

Static Public Member Functions

static void PerformCheckpoint (Isolate *isolate)
 
static int GetCurrentDepth (Isolate *isolate)
 
static bool IsRunningMicrotasks (Isolate *isolate)
 

Private Attributes

internal::Isolate *const i_isolate_
 
internal::MicrotaskQueue *const microtask_queue_
 
bool run_
 

Detailed Description

This scope is used to control microtasks when MicrotasksPolicy::kScoped is used on Isolate. In this mode every non-primitive call to V8 should be done inside some MicrotasksScope. Microtasks are executed when topmost MicrotasksScope marked as kRunMicrotasks exits. kDoNotRunMicrotasks should be used to annotate calls not intended to trigger microtasks.

Definition at line 117 of file v8-microtask-queue.h.

Member Enumeration Documentation

◆ Type

Enumerator
kRunMicrotasks 
kDoNotRunMicrotasks 

Definition at line 119 of file v8-microtask-queue.h.

Constructor & Destructor Documentation

◆ MicrotasksScope() [1/3]

v8::MicrotasksScope::MicrotasksScope ( Local< Context > context,
MicrotasksScope::Type type )

Definition at line 10975 of file api.cc.

◆ MicrotasksScope() [2/3]

v8::MicrotasksScope::MicrotasksScope ( Isolate * isolate,
MicrotaskQueue * microtask_queue,
MicrotasksScope::Type type )

Definition at line 10980 of file api.cc.

Here is the call graph for this function:

◆ ~MicrotasksScope()

v8::MicrotasksScope::~MicrotasksScope ( )

Definition at line 10994 of file api.cc.

Here is the call graph for this function:

◆ MicrotasksScope() [3/3]

v8::MicrotasksScope::MicrotasksScope ( const MicrotasksScope & )
delete

Member Function Documentation

◆ GetCurrentDepth()

int v8::MicrotasksScope::GetCurrentDepth ( Isolate * isolate)
static

Returns current depth of nested kRunMicrotasks scopes.

Definition at line 11018 of file api.cc.

◆ IsRunningMicrotasks()

bool v8::MicrotasksScope::IsRunningMicrotasks ( Isolate * isolate)
static

Returns true while microtasks are being executed.

Definition at line 11025 of file api.cc.

◆ operator=()

MicrotasksScope & v8::MicrotasksScope::operator= ( const MicrotasksScope & )
delete

◆ PerformCheckpoint()

void v8::MicrotasksScope::PerformCheckpoint ( Isolate * isolate)
static

Runs microtasks if no kRunMicrotasks scope is currently active.

Definition at line 11011 of file api.cc.

Here is the caller graph for this function:

Member Data Documentation

◆ i_isolate_

internal::Isolate* const v8::MicrotasksScope::i_isolate_
private

Definition at line 145 of file v8-microtask-queue.h.

◆ microtask_queue_

internal::MicrotaskQueue* const v8::MicrotasksScope::microtask_queue_
private

Definition at line 146 of file v8-microtask-queue.h.

◆ run_

bool v8::MicrotasksScope::run_
private

Definition at line 147 of file v8-microtask-queue.h.


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