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

#include <v8-statistics.h>

Inheritance diagram for v8::MeasureMemoryDelegate:
Collaboration diagram for v8::MeasureMemoryDelegate:

Classes

struct  Result
 

Public Member Functions

virtual ~MeasureMemoryDelegate ()=default
 
virtual bool ShouldMeasure (Local< Context > context)=0
 
virtual void MeasurementComplete (Result result)
 

Static Public Member Functions

static std::unique_ptr< MeasureMemoryDelegateDefault (Isolate *isolate, Local< Context > context, Local< Promise::Resolver > promise_resolver, MeasureMemoryMode mode)
 

Detailed Description

The delegate is used in Isolate::MeasureMemory API.

It specifies the contexts that need to be measured and gets called when the measurement is completed to report the results.

Both MeasurementComplete() callbacks will be invoked on completion. Each implementation of this class should hence implement only one of them, and leave the other empty.

Definition at line 55 of file v8-statistics.h.

Constructor & Destructor Documentation

◆ ~MeasureMemoryDelegate()

virtual v8::MeasureMemoryDelegate::~MeasureMemoryDelegate ( )
virtualdefault

Member Function Documentation

◆ Default()

std::unique_ptr< MeasureMemoryDelegate > v8::MeasureMemoryDelegate::Default ( Isolate * isolate,
Local< Context > context,
Local< Promise::Resolver > promise_resolver,
MeasureMemoryMode mode )
static

Returns a default delegate that resolves the given promise when the memory measurement completes.

Parameters
isolatethe current isolate
contextthe current context
promise_resolverthe promise resolver that is given the result of the memory measurement.
modethe detail level of the result.

Definition at line 10417 of file api.cc.

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

◆ MeasurementComplete()

virtual void v8::MeasureMemoryDelegate::MeasurementComplete ( Result result)
inlinevirtual

This function is called when memory measurement finishes.

Parameters
resultthe result of the measurement.

Reimplemented in v8::internal::MeasureMemoryDelegate.

Definition at line 93 of file v8-statistics.h.

Here is the caller graph for this function:

◆ ShouldMeasure()

virtual bool v8::MeasureMemoryDelegate::ShouldMeasure ( Local< Context > context)
pure virtual

Returns true if the size of the given context needs to be measured.

Implemented in v8::internal::MeasureMemoryDelegate.


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