# Interface ICefv8Context

Description
Hierarchy
Fields
Methods
Properties

## Unit

uCEFInterfaces

## Declaration

`type ICefv8Context = interface(ICefBaseRefCounted)`

## Description

Interface representing a V8 context 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 ICefV8context.GetTaskRunner() function.

UNKNOWN

<see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_v8_capi.h">CEF source file: /include/capi/cef_v8_capi.h (cef_v8_context_t))

## Hierarchy

- IInterface
- ICefBaseRefCounted
- ICefv8Context

## Overview

### Methods

| `function GetTaskRunner: ICefTaskRunner;`
| `function IsValid: Boolean;`
| `function GetBrowser: ICefBrowser;`
| `function GetFrame: ICefFrame;`
| `function GetGlobal: ICefv8Value;`
| `function Enter: Boolean;`
| `function Exit: Boolean;`
| `function IsSame(const that: ICefv8Context): Boolean;`
| `function Eval(const code: ustring; const script_url: ustring; start_line: integer; var retval: ICefv8Value; var exception: ICefV8Exception): Boolean;`

### Properties

| `property Browser : ICefBrowser read GetBrowser;`
| `property Frame : ICefFrame read GetFrame;`
| `property Global : ICefv8Value read GetGlobal;`

## Description

### Methods

| `function GetTaskRunner: ICefTaskRunner;`

Returns the task runner associated with this context. V8 handles can only be accessed from the thread on which they are created. This function can be called on any render process thread.

###### Attributes

GUID['{2295A11A-8773-41F2-AD42-308C215062D9}']

| `function IsValid: Boolean;`
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).

| `function GetBrowser: ICefBrowser;`
Returns the browser for this context. This function will return an NULL reference for WebWorker contexts.

| `function GetFrame: ICefFrame;`
Returns the frame for this context. This function will return an NULL reference for WebWorker contexts.

| `function GetGlobal: ICefv8Value;`
Returns the global object for this context. The context must be entered before calling this function.

| `function Enter: Boolean;`
Enter this context. A context must be explicitly entered before creating a V8 Object, Array, Function or Date asynchronously. exit() must be called the same number of times as enter() before releasing this context. V8 objects belong to the context in which they are created. Returns true (1) if the scope was entered successfully.

| `function Exit: Boolean;`
Exit this context. Call this function only after calling enter(). Returns true (1) if the scope was exited successfully.

| `function IsSame(const that: ICefv8Context): Boolean;`
Returns true (1) if this object is pointing to the same handle as |that| object.

| `function Eval(const code: ustring; const script_url: ustring; start_line: integer; var retval: ICefv8Value; var exception: ICefV8Exception): Boolean;`

Execute a string of JavaScript code in this V8 context. The |script_url| parameter is the URL where the script in question can be found, if any. The |start_line| parameter is the base line number to use for error reporting. On success |retval| will be set to the return value, if any, and the function will return true (1). On failure |exception| will be set to the exception, if any, and the function will return false (0).

### Properties

| `property Browser : ICefBrowser read GetBrowser;`
Returns the browser for this context. This function will return an NULL reference for WebWorker contexts.

| `property Frame : ICefFrame read GetFrame;`
Returns the frame for this context. This function will return an NULL reference for WebWorker contexts.

| `property Global : ICefv8Value read GetGlobal;`
Returns the global object for this context. The context must be entered before calling this function.

Generated by PasDoc 0.17.0.snapshot.