Chromium Embedded Framework (CEF)
109.0.1+gcd5e37a+chromium-109.0.5414.8
|
Class representing a V8 value handle. More...
#include "include/cef_v8.h"
Public Types | |
typedef cef_v8_accesscontrol_t | AccessControl |
typedef cef_v8_propertyattribute_t | PropertyAttribute |
Public Member Functions | |
virtual bool | IsValid ()=0 |
Returns true if the underlying handle is valid and it can be accessed on the current thread. More... | |
virtual bool | IsUndefined ()=0 |
True if the value type is undefined. More... | |
virtual bool | IsNull ()=0 |
True if the value type is null. More... | |
virtual bool | IsBool ()=0 |
True if the value type is bool. More... | |
virtual bool | IsInt ()=0 |
True if the value type is int. More... | |
virtual bool | IsUInt ()=0 |
True if the value type is unsigned int. More... | |
virtual bool | IsDouble ()=0 |
True if the value type is double. More... | |
virtual bool | IsDate ()=0 |
True if the value type is Date. More... | |
virtual bool | IsString ()=0 |
True if the value type is string. More... | |
virtual bool | IsObject ()=0 |
True if the value type is object. More... | |
virtual bool | IsArray ()=0 |
True if the value type is array. More... | |
virtual bool | IsArrayBuffer ()=0 |
True if the value type is an ArrayBuffer. More... | |
virtual bool | IsFunction ()=0 |
True if the value type is function. More... | |
virtual bool | IsPromise ()=0 |
True if the value type is a Promise. More... | |
virtual bool | IsSame (CefRefPtr< CefV8Value > that)=0 |
Returns true if this object is pointing to the same handle as |that| object. More... | |
virtual bool | GetBoolValue ()=0 |
Return a bool value. More... | |
virtual int32 | GetIntValue ()=0 |
Return an int value. More... | |
virtual uint32 | GetUIntValue ()=0 |
Return an unsigned int value. More... | |
virtual double | GetDoubleValue ()=0 |
Return a double value. More... | |
virtual CefBaseTime | GetDateValue ()=0 |
Return a Date value. More... | |
virtual CefString | GetStringValue ()=0 |
Return a string value. More... | |
virtual bool | IsUserCreated ()=0 |
OBJECT METHODS - These methods are only available on objects. More... | |
virtual bool | HasException ()=0 |
Returns true if the last method call resulted in an exception. More... | |
virtual CefRefPtr< CefV8Exception > | GetException ()=0 |
Returns the exception resulting from the last method call. More... | |
virtual bool | ClearException ()=0 |
Clears the last exception and returns true on success. More... | |
virtual bool | WillRethrowExceptions ()=0 |
Returns true if this object will re-throw future exceptions. More... | |
virtual bool | SetRethrowExceptions (bool rethrow)=0 |
Set whether this object will re-throw future exceptions. More... | |
virtual bool | HasValue (const CefString &key)=0 |
Returns true if the object has a value with the specified identifier. More... | |
virtual bool | HasValue (int index)=0 |
Returns true if the object has a value with the specified identifier. More... | |
virtual bool | DeleteValue (const CefString &key)=0 |
Deletes the value with the specified identifier and returns true on success. More... | |
virtual bool | DeleteValue (int index)=0 |
Deletes the value with the specified identifier and returns true on success. More... | |
virtual CefRefPtr< CefV8Value > | GetValue (const CefString &key)=0 |
Returns the value with the specified identifier on success. More... | |
virtual CefRefPtr< CefV8Value > | GetValue (int index)=0 |
Returns the value with the specified identifier on success. More... | |
virtual bool | SetValue (const CefString &key, CefRefPtr< CefV8Value > value, PropertyAttribute attribute)=0 |
Associates a value with the specified identifier and returns true on success. More... | |
virtual bool | SetValue (int index, CefRefPtr< CefV8Value > value)=0 |
Associates a value with the specified identifier and returns true on success. More... | |
virtual bool | SetValue (const CefString &key, AccessControl settings, PropertyAttribute attribute)=0 |
Registers an identifier and returns true on success. More... | |
virtual bool | GetKeys (std::vector< CefString > &keys)=0 |
Read the keys for the object's values into the specified vector. More... | |
virtual bool | SetUserData (CefRefPtr< CefBaseRefCounted > user_data)=0 |
Sets the user data for this object and returns true on success. More... | |
virtual CefRefPtr< CefBaseRefCounted > | GetUserData ()=0 |
Returns the user data, if any, assigned to this object. More... | |
virtual int | GetExternallyAllocatedMemory ()=0 |
Returns the amount of externally allocated memory registered for the object. More... | |
virtual int | AdjustExternallyAllocatedMemory (int change_in_bytes)=0 |
Adjusts the amount of registered external memory for the object. More... | |
virtual int | GetArrayLength ()=0 |
Returns the number of elements in the array. More... | |
virtual CefRefPtr< CefV8ArrayBufferReleaseCallback > | GetArrayBufferReleaseCallback ()=0 |
Returns the ReleaseCallback object associated with the ArrayBuffer or NULL if the ArrayBuffer was not created with CreateArrayBuffer. More... | |
virtual bool | NeuterArrayBuffer ()=0 |
Prevent the ArrayBuffer from using it's memory block by setting the length to zero. More... | |
virtual CefString | GetFunctionName ()=0 |
Returns the function name. More... | |
virtual CefRefPtr< CefV8Handler > | GetFunctionHandler ()=0 |
Returns the function handler or NULL if not a CEF-created function. More... | |
virtual CefRefPtr< CefV8Value > | ExecuteFunction (CefRefPtr< CefV8Value > object, const CefV8ValueList &arguments)=0 |
Execute the function using the current V8 context. More... | |
virtual CefRefPtr< CefV8Value > | ExecuteFunctionWithContext (CefRefPtr< CefV8Context > context, CefRefPtr< CefV8Value > object, const CefV8ValueList &arguments)=0 |
Execute the function using the specified V8 context. More... | |
virtual bool | ResolvePromise (CefRefPtr< CefV8Value > arg)=0 |
Resolve the Promise using the current V8 context. More... | |
virtual bool | RejectPromise (const CefString &errorMsg)=0 |
Reject the Promise using the current V8 context. More... | |
Public Member Functions inherited from CefBaseRefCounted | |
virtual void | AddRef () const =0 |
Called to increment the reference count for the object. More... | |
virtual bool | Release () const =0 |
Called to decrement the reference count for the object. More... | |
virtual bool | HasOneRef () const =0 |
Returns true if the reference count is 1. More... | |
virtual bool | HasAtLeastOneRef () const =0 |
Returns true if the reference count is at least 1. More... | |
Static Public Member Functions | |
static CefRefPtr< CefV8Value > | CreateUndefined () |
Create a new CefV8Value object of type undefined. More... | |
static CefRefPtr< CefV8Value > | CreateNull () |
Create a new CefV8Value object of type null. More... | |
static CefRefPtr< CefV8Value > | CreateBool (bool value) |
Create a new CefV8Value object of type bool. More... | |
static CefRefPtr< CefV8Value > | CreateInt (int32 value) |
Create a new CefV8Value object of type int. More... | |
static CefRefPtr< CefV8Value > | CreateUInt (uint32 value) |
Create a new CefV8Value object of type unsigned int. More... | |
static CefRefPtr< CefV8Value > | CreateDouble (double value) |
Create a new CefV8Value object of type double. More... | |
static CefRefPtr< CefV8Value > | CreateDate (CefBaseTime date) |
Create a new CefV8Value object of type Date. More... | |
static CefRefPtr< CefV8Value > | CreateString (const CefString &value) |
Create a new CefV8Value object of type string. More... | |
static CefRefPtr< CefV8Value > | CreateObject (CefRefPtr< CefV8Accessor > accessor, CefRefPtr< CefV8Interceptor > interceptor) |
Create a new CefV8Value object of type object with optional accessor and/or interceptor. More... | |
static CefRefPtr< CefV8Value > | CreateArray (int length) |
Create a new CefV8Value object of type array with the specified |length|. More... | |
static CefRefPtr< CefV8Value > | CreateArrayBuffer (void *buffer, size_t length, CefRefPtr< CefV8ArrayBufferReleaseCallback > release_callback) |
Create a new CefV8Value object of type ArrayBuffer which wraps the provided |buffer| of size |length| bytes. More... | |
static CefRefPtr< CefV8Value > | CreateFunction (const CefString &name, CefRefPtr< CefV8Handler > handler) |
Create a new CefV8Value object of type function. More... | |
static CefRefPtr< CefV8Value > | CreatePromise () |
Create a new CefV8Value object of type Promise. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from CefBaseRefCounted | |
virtual | ~CefBaseRefCounted () |
Class representing a V8 value handle.
V8 handles can only be accessed from the thread on which they are created. Valid threads for creating a V8 handle include the render process main thread (TID_RENDERER) and WebWorker threads. A task runner for posting tasks on the associated thread can be retrieved via the CefV8Context::GetTaskRunner() method.
|
pure virtual |
Adjusts the amount of registered external memory for the object.
Used to give V8 an indication of the amount of externally allocated memory that is kept alive by JavaScript objects. V8 uses this information to decide when to perform global garbage collection. Each CefV8Value tracks the amount of external memory associated with it and automatically decreases the global total by the appropriate amount on its destruction. |change_in_bytes| specifies the number of bytes to adjust by. This method returns the number of bytes associated with the object after the adjustment. This method can only be called on user created objects.
|
pure virtual |
Clears the last exception and returns true on success.
|
static |
Create a new CefV8Value object of type array with the specified |length|.
If |length| is negative the returned array will have length 0. This method should only be called from within the scope of a CefRenderProcessHandler, CefV8Handler or CefV8Accessor callback, or in combination with calling Enter() and Exit() on a stored CefV8Context reference.
|
static |
Create a new CefV8Value object of type ArrayBuffer which wraps the provided |buffer| of size |length| bytes.
The ArrayBuffer is externalized, meaning that it does not own |buffer|. The caller is responsible for freeing |buffer| when requested via a call to CefV8ArrayBufferReleaseCallback::ReleaseBuffer. This method should only be called from within the scope of a CefRenderProcessHandler, CefV8Handler or CefV8Accessor callback, or in combination with calling Enter() and Exit() on a stored CefV8Context reference.
|
static |
Create a new CefV8Value object of type bool.
|
static |
Create a new CefV8Value object of type Date.
This method should only be called from within the scope of a CefRenderProcessHandler, CefV8Handler or CefV8Accessor callback, or in combination with calling Enter() and Exit() on a stored CefV8Context reference.
|
static |
Create a new CefV8Value object of type double.
|
static |
Create a new CefV8Value object of type function.
This method should only be called from within the scope of a CefRenderProcessHandler, CefV8Handler or CefV8Accessor callback, or in combination with calling Enter() and Exit() on a stored CefV8Context reference.
|
static |
Create a new CefV8Value object of type int.
|
static |
Create a new CefV8Value object of type null.
|
static |
Create a new CefV8Value object of type object with optional accessor and/or interceptor.
This method should only be called from within the scope of a CefRenderProcessHandler, CefV8Handler or CefV8Accessor callback, or in combination with calling Enter() and Exit() on a stored CefV8Context reference.
|
static |
Create a new CefV8Value object of type Promise.
This method should only be called from within the scope of a CefRenderProcessHandler, CefV8Handler or CefV8Accessor callback, or in combination with calling Enter() and Exit() on a stored CefV8Context reference.
|
static |
Create a new CefV8Value object of type string.
|
static |
Create a new CefV8Value object of type unsigned int.
|
static |
Create a new CefV8Value object of type undefined.
|
pure virtual |
Deletes the value with the specified identifier and returns true on success.
Returns false if this method is called incorrectly or an exception is thrown. For read-only and don't-delete values this method will return true even though deletion failed.
|
pure virtual |
Deletes the value with the specified identifier and returns true on success.
Returns false if this method is called incorrectly, deletion fails or an exception is thrown. For read-only and don't-delete values this method will return true even though deletion failed.
|
pure virtual |
Execute the function using the current V8 context.
This method should only be called from within the scope of a CefV8Handler or CefV8Accessor callback, or in combination with calling Enter() and Exit() on a stored CefV8Context reference. |object| is the receiver ('this' object) of the function. If |object| is empty the current context's global object will be used. |arguments| is the list of arguments that will be passed to the function. Returns the function return value on success. Returns NULL if this method is called incorrectly or an exception is thrown.
|
pure virtual |
Execute the function using the specified V8 context.
|object| is the receiver ('this' object) of the function. If |object| is empty the specified context's global object will be used. |arguments| is the list of arguments that will be passed to the function. Returns the function return value on success. Returns NULL if this method is called incorrectly or an exception is thrown.
|
pure virtual |
Returns the ReleaseCallback object associated with the ArrayBuffer or NULL if the ArrayBuffer was not created with CreateArrayBuffer.
|
pure virtual |
Returns the number of elements in the array.
|
pure virtual |
Return a bool value.
|
pure virtual |
Return a Date value.
|
pure virtual |
Return a double value.
|
pure virtual |
Returns the exception resulting from the last method call.
This attribute exists only in the scope of the current CEF value object.
|
pure virtual |
Returns the amount of externally allocated memory registered for the object.
|
pure virtual |
Returns the function handler or NULL if not a CEF-created function.
|
pure virtual |
Returns the function name.
|
pure virtual |
Return an int value.
|
pure virtual |
Read the keys for the object's values into the specified vector.
Integer- based keys will also be returned as strings.
|
pure virtual |
Return a string value.
|
pure virtual |
Return an unsigned int value.
|
pure virtual |
Returns the user data, if any, assigned to this object.
|
pure virtual |
Returns the value with the specified identifier on success.
Returns NULL if this method is called incorrectly or an exception is thrown.
|
pure virtual |
Returns the value with the specified identifier on success.
Returns NULL if this method is called incorrectly or an exception is thrown.
|
pure virtual |
Returns true if the last method call resulted in an exception.
This attribute exists only in the scope of the current CEF value object.
|
pure virtual |
Returns true if the object has a value with the specified identifier.
|
pure virtual |
Returns true if the object has a value with the specified identifier.
|
pure virtual |
True if the value type is array.
|
pure virtual |
True if the value type is an ArrayBuffer.
|
pure virtual |
True if the value type is bool.
|
pure virtual |
True if the value type is Date.
|
pure virtual |
True if the value type is double.
|
pure virtual |
True if the value type is function.
|
pure virtual |
True if the value type is int.
|
pure virtual |
True if the value type is null.
|
pure virtual |
True if the value type is object.
|
pure virtual |
True if the value type is a Promise.
|
pure virtual |
Returns true if this object is pointing to the same handle as |that| object.
|
pure virtual |
True if the value type is string.
|
pure virtual |
True if the value type is unsigned int.
|
pure virtual |
True if the value type is undefined.
|
pure virtual |
OBJECT METHODS - These methods are only available on objects.
Arrays and functions are also objects. String- and integer-based keys can be used interchangably with the framework converting between them as necessary. Returns true if this is a user created object.
|
pure virtual |
Returns true if the underlying handle is valid and it can be accessed on the current thread.
Do not call any other methods if this method returns false.
|
pure virtual |
Prevent the ArrayBuffer from using it's memory block by setting the length to zero.
This operation cannot be undone. If the ArrayBuffer was created with CreateArrayBuffer then CefV8ArrayBufferReleaseCallback::ReleaseBuffer will be called to release the underlying buffer.
|
pure virtual |
Reject the Promise using the current V8 context.
This method should only be called from within the scope of a CefV8Handler or CefV8Accessor callback, or in combination with calling Enter() and Exit() on a stored CefV8Context reference. Returns true on success. Returns false if this method is called incorrectly or an exception is thrown.
|
pure virtual |
Resolve the Promise using the current V8 context.
This method should only be called from within the scope of a CefV8Handler or CefV8Accessor callback, or in combination with calling Enter() and Exit() on a stored CefV8Context reference. |arg| is the argument passed to the resolved promise. Returns true on success. Returns false if this method is called incorrectly or an exception is thrown.
|
pure virtual |
Set whether this object will re-throw future exceptions.
By default exceptions are not re-thrown. If a exception is re-thrown the current context should not be accessed again until after the exception has been caught and not re-thrown. Returns true on success. This attribute exists only in the scope of the current CEF value object.
|
pure virtual |
Sets the user data for this object and returns true on success.
Returns false if this method is called incorrectly. This method can only be called on user created objects.
|
pure virtual |
Registers an identifier and returns true on success.
Access to the identifier will be forwarded to the CefV8Accessor instance passed to CefV8Value::CreateObject(). Returns false if this method is called incorrectly or an exception is thrown. For read-only values this method will return true even though assignment failed.
|
pure virtual |
Associates a value with the specified identifier and returns true on success.
Returns false if this method is called incorrectly or an exception is thrown. For read-only values this method will return true even though assignment failed.
|
pure virtual |
Associates a value with the specified identifier and returns true on success.
Returns false if this method is called incorrectly or an exception is thrown. For read-only values this method will return true even though assignment failed.
|
pure virtual |
Returns true if this object will re-throw future exceptions.
This attribute exists only in the scope of the current CEF value object.