cef_v8value_t

Structure 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 cef_v8context_t::get_task_runner() function.

version(cef && embedded_cef_bindings)
extern (C)
struct cef_v8value_t {}

Members

Variables

adjust_externally_allocated_memory
int function(cef_v8value_t* self, int change_in_bytes) nothrow adjust_externally_allocated_memory;

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 cef_v8value_t 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 function returns the number of bytes associated with the object after the adjustment. This function can only be called on user created objects.

base
cef_base_ref_counted_t base;

Base structure.

clear_exception
int function(cef_v8value_t* self) nothrow clear_exception;

Clears the last exception and returns true (1) on success.

delete_value_byindex
int function(cef_v8value_t* self, int index) nothrow delete_value_byindex;

Deletes the value with the specified identifier and returns true (1) on success. Returns false (0) if this function is called incorrectly, deletion fails or an exception is thrown. For read-only and don't-delete values this function will return true (1) even though deletion failed.

delete_value_bykey
int function(cef_v8value_t* self, const(cef_string_t)* key) nothrow delete_value_bykey;

Deletes the value with the specified identifier and returns true (1) on success. Returns false (0) if this function is called incorrectly or an exception is thrown. For read-only and don't-delete values this function will return true (1) even though deletion failed.

execute_function
cef_v8value_t* function(cef_v8value_t* self, cef_v8value_t* object, size_t argumentsCount, cef_v8value_t** arguments) nothrow execute_function;

Execute the function using the current V8 context. This function should only be called from within the scope of a cef_v8handler_t or cef_v8accessor_t callback, or in combination with calling enter() and exit() on a stored cef_v8context_t reference. |object| is the receiver ('this' object) of the function. If |object| is NULL 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 function is called incorrectly or an exception is thrown.

execute_function_with_context
cef_v8value_t* function(cef_v8value_t* self, cef_v8context_t* context, cef_v8value_t* object, size_t argumentsCount, cef_v8value_t** arguments) nothrow execute_function_with_context;

Execute the function using the specified V8 context. |object| is the receiver ('this' object) of the function. If |object| is NULL 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 function is called incorrectly or an exception is thrown.

get_array_buffer_byte_length
size_t function(cef_v8value_t* self) nothrow get_array_buffer_byte_length;

Returns the length (in bytes) of the ArrayBuffer.

get_array_buffer_data
void* function(cef_v8value_t* self) nothrow get_array_buffer_data;

Returns a pointer to the beginning of the memory block for this ArrayBuffer backing store. The returned pointer is valid as long as the cef_v8value_t is alive.

get_array_buffer_release_callback
cef_v8array_buffer_release_callback_t* function(cef_v8value_t* self) nothrow get_array_buffer_release_callback;

Returns the ReleaseCallback object associated with the ArrayBuffer or NULL if the ArrayBuffer was not created with CreateArrayBuffer.

get_array_length
int function(cef_v8value_t* self) nothrow get_array_length;

Returns the number of elements in the array.

get_bool_value
int function(cef_v8value_t* self) nothrow get_bool_value;

Return a bool value.

get_date_value
cef_basetime_t function(cef_v8value_t* self) nothrow get_date_value;

Return a Date value.

get_double_value
double function(cef_v8value_t* self) nothrow get_double_value;

Return a double value.

get_exception
cef_v8exception_t* function(cef_v8value_t* self) nothrow get_exception;

Returns the exception resulting from the last function call. This attribute exists only in the scope of the current CEF value object.

get_externally_allocated_memory
int function(cef_v8value_t* self) nothrow get_externally_allocated_memory;

Returns the amount of externally allocated memory registered for the object.

get_function_handler
cef_v8handler_t* function(cef_v8value_t* self) nothrow get_function_handler;

Returns the function handler or NULL if not a CEF-created function.

get_function_name
cef_string_userfree_t function(cef_v8value_t* self) nothrow get_function_name;

Returns the function name.

get_int_value
int function(cef_v8value_t* self) nothrow get_int_value;

Return an int value.

get_keys
int function(cef_v8value_t* self, cef_string_list_t keys) nothrow get_keys;

Read the keys for the object's values into the specified vector. Integer- based keys will also be returned as strings.

get_string_value
cef_string_userfree_t function(cef_v8value_t* self) nothrow get_string_value;

Return a string value.

get_uint_value
uint function(cef_v8value_t* self) nothrow get_uint_value;

Return an unsigned int value.

get_user_data
cef_base_ref_counted_t* function(cef_v8value_t* self) nothrow get_user_data;

Returns the user data, if any, assigned to this object.

get_value_byindex
cef_v8value_t* function(cef_v8value_t* self, int index) nothrow get_value_byindex;

Returns the value with the specified identifier on success. Returns NULL if this function is called incorrectly or an exception is thrown.

get_value_bykey
cef_v8value_t* function(cef_v8value_t* self, const(cef_string_t)* key) nothrow get_value_bykey;

Returns the value with the specified identifier on success. Returns NULL if this function is called incorrectly or an exception is thrown.

has_exception
int function(cef_v8value_t* self) nothrow has_exception;

Returns true (1) if the last function call resulted in an exception. This attribute exists only in the scope of the current CEF value object.

has_value_byindex
int function(cef_v8value_t* self, int index) nothrow has_value_byindex;

Returns true (1) if the object has a value with the specified identifier.

has_value_bykey
int function(cef_v8value_t* self, const(cef_string_t)* key) nothrow has_value_bykey;

Returns true (1) if the object has a value with the specified identifier.

is_array
int function(cef_v8value_t* self) nothrow is_array;

True if the value type is array.

is_array_buffer
int function(cef_v8value_t* self) nothrow is_array_buffer;

True if the value type is an ArrayBuffer.

is_bool
int function(cef_v8value_t* self) nothrow is_bool;

True if the value type is bool.

is_date
int function(cef_v8value_t* self) nothrow is_date;

True if the value type is Date.

is_double
int function(cef_v8value_t* self) nothrow is_double;

True if the value type is double.

is_function
int function(cef_v8value_t* self) nothrow is_function;

True if the value type is function.

is_int
int function(cef_v8value_t* self) nothrow is_int;

True if the value type is int.

is_null
int function(cef_v8value_t* self) nothrow is_null;

True if the value type is null.

is_object
int function(cef_v8value_t* self) nothrow is_object;

True if the value type is object.

is_promise
int function(cef_v8value_t* self) nothrow is_promise;

True if the value type is a Promise.

is_same
int function(cef_v8value_t* self, cef_v8value_t* that) nothrow is_same;

Returns true (1) if this object is pointing to the same handle as |that| object.

is_string
int function(cef_v8value_t* self) nothrow is_string;

True if the value type is string.

is_uint
int function(cef_v8value_t* self) nothrow is_uint;

True if the value type is unsigned int.

is_undefined
int function(cef_v8value_t* self) nothrow is_undefined;

True if the value type is undefined.

is_user_created
int function(cef_v8value_t* self) nothrow is_user_created;

Returns true (1) if this is a user created object.

is_valid
int function(cef_v8value_t* self) nothrow is_valid;

Returns true (1) if the underlying handle is valid and it can be accessed on the current thread. Do not call any other functions if this function returns false (0).

neuter_array_buffer
int function(cef_v8value_t* self) nothrow neuter_array_buffer;

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 cef_v8array_buffer_release_callback_t::ReleaseBuffer will be called to release the underlying buffer.

reject_promise
int function(cef_v8value_t* self, const(cef_string_t)* errorMsg) nothrow reject_promise;

Reject the Promise using the current V8 context. This function should only be called from within the scope of a cef_v8handler_t or cef_v8accessor_t callback, or in combination with calling enter() and exit() on a stored cef_v8context_t reference. Returns true (1) on success. Returns false (0) if this function is called incorrectly or an exception is thrown.

resolve_promise
int function(cef_v8value_t* self, cef_v8value_t* arg) nothrow resolve_promise;

Resolve the Promise using the current V8 context. This function should only be called from within the scope of a cef_v8handler_t or cef_v8accessor_t callback, or in combination with calling enter() and exit() on a stored cef_v8context_t reference. |arg| is the argument passed to the resolved promise. Returns true (1) on success. Returns false (0) if this function is called incorrectly or an exception is thrown.

set_rethrow_exceptions
int function(cef_v8value_t* self, int rethrow) nothrow set_rethrow_exceptions;

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 (1) on success. This attribute exists only in the scope of the current CEF value object.

set_user_data
int function(cef_v8value_t* self, cef_base_ref_counted_t* user_data) nothrow set_user_data;

Sets the user data for this object and returns true (1) on success. Returns false (0) if this function is called incorrectly. This function can only be called on user created objects.

set_value_byaccessor
int function(cef_v8value_t* self, const(cef_string_t)* key, cef_v8_accesscontrol_t settings, cef_v8_propertyattribute_t attribute) nothrow set_value_byaccessor;

Registers an identifier and returns true (1) on success. Access to the identifier will be forwarded to the cef_v8accessor_t instance passed to cef_v8value_t::cef_v8value_create_object(). Returns false (0) if this function is called incorrectly or an exception is thrown. For read-only values this function will return true (1) even though assignment failed.

set_value_byindex
int function(cef_v8value_t* self, int index, cef_v8value_t* value) nothrow set_value_byindex;

Associates a value with the specified identifier and returns true (1) on success. Returns false (0) if this function is called incorrectly or an exception is thrown. For read-only values this function will return true (1) even though assignment failed.

set_value_bykey
int function(cef_v8value_t* self, const(cef_string_t)* key, cef_v8value_t* value, cef_v8_propertyattribute_t attribute) nothrow set_value_bykey;

Associates a value with the specified identifier and returns true (1) on success. Returns false (0) if this function is called incorrectly or an exception is thrown. For read-only values this function will return true (1) even though assignment failed.

will_rethrow_exceptions
int function(cef_v8value_t* self) nothrow will_rethrow_exceptions;

Returns true (1) if this object will re-throw future exceptions. This attribute exists only in the scope of the current CEF value object.

Meta