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

#include <v8-weak-callback-info.h>

Inheritance diagram for v8::WeakCallbackInfo< T >:
Collaboration diagram for v8::WeakCallbackInfo< T >:

Public Types

using Callback = void (*)(const WeakCallbackInfo<T>& data)
 

Public Member Functions

 WeakCallbackInfo (Isolate *isolate, T *parameter, void *embedder_fields[kEmbedderFieldsInWeakCallback], Callback *callback)
 
V8_INLINE IsolateGetIsolate () const
 
V8_INLINE TGetParameter () const
 
V8_INLINE void * GetInternalField (int index) const
 
void SetSecondPassCallback (Callback callback) const
 
- Public Member Functions inherited from cppgc::internal::ConditionalStackAllocatedBase< T >
 CPPGC_STACK_ALLOCATED ()
 

Private Attributes

Isolateisolate_
 
Tparameter_
 
Callbackcallback_
 
void * embedder_fields_ [kEmbedderFieldsInWeakCallback]
 

Detailed Description

template<typename T>
class v8::WeakCallbackInfo< T >

Definition at line 25 of file v8-weak-callback-info.h.

Member Typedef Documentation

◆ Callback

template<typename T >
using v8::WeakCallbackInfo< T >::Callback = void (*)(const WeakCallbackInfo<T>& data)

Definition at line 28 of file v8-weak-callback-info.h.

Constructor & Destructor Documentation

◆ WeakCallbackInfo()

template<typename T >
v8::WeakCallbackInfo< T >::WeakCallbackInfo ( Isolate * isolate,
T * parameter,
void * embedder_fields[kEmbedderFieldsInWeakCallback],
Callback * callback )
inline

Definition at line 30 of file v8-weak-callback-info.h.

Member Function Documentation

◆ GetInternalField()

template<class T >
void * v8::WeakCallbackInfo< T >::GetInternalField ( int index) const

Definition at line 77 of file v8-weak-callback-info.h.

Here is the call graph for this function:

◆ GetIsolate()

template<typename T >
V8_INLINE Isolate * v8::WeakCallbackInfo< T >::GetIsolate ( ) const
inline

Definition at line 38 of file v8-weak-callback-info.h.

◆ GetParameter()

template<typename T >
V8_INLINE T * v8::WeakCallbackInfo< T >::GetParameter ( ) const
inline

Definition at line 39 of file v8-weak-callback-info.h.

◆ SetSecondPassCallback()

template<typename T >
void v8::WeakCallbackInfo< T >::SetSecondPassCallback ( Callback callback) const
inline

When a weak callback is first invoked the embedders must Reset() the handle which triggered the callback. The handle itself is unusable for anything else. No other V8 API calls may be called in the first callback. Additional work requires scheduling a second invocation via SetSecondPassCallback() which will be called some time after all the initial callbacks are processed.

The second pass callback is prohibited from executing JavaScript. Embedders should schedule another callback in case this is required.

Definition at line 53 of file v8-weak-callback-info.h.

Member Data Documentation

◆ callback_

template<typename T >
Callback* v8::WeakCallbackInfo< T >::callback_
private

Definition at line 58 of file v8-weak-callback-info.h.

◆ embedder_fields_

template<typename T >
void* v8::WeakCallbackInfo< T >::embedder_fields_[kEmbedderFieldsInWeakCallback]
private

Definition at line 59 of file v8-weak-callback-info.h.

◆ isolate_

template<typename T >
Isolate* v8::WeakCallbackInfo< T >::isolate_
private

Definition at line 56 of file v8-weak-callback-info.h.

◆ parameter_

template<typename T >
T* v8::WeakCallbackInfo< T >::parameter_
private

Definition at line 57 of file v8-weak-callback-info.h.


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