Overview   Project   Class   Tree   Index 
CEF3 C++ API Docs - Version 75.1.4+g4210896+chromium-75.0.3770.100
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD

(default)
Class CefV8Context

CefBaseRefCounted
   |
   +--CefV8Context

   in cef_v8.h

class CefV8Context
extends CefBaseRefCounted

Class 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 CefV8Context::GetTaskRunner() method.


Method Summary
 virtual bool Enter()= 0
          Enter this context.
 virtual bool Eval( const CefString& code, const CefString& script_url, int start_line, CefRefPtr< CefV8Value >& retval, CefRefPtr< CefV8Exception >& exception )= 0
          Execute a string of JavaScript code in this V8 context.
 virtual bool Exit()= 0
          Exit this context.
 virtual CefRefPtr< CefBrowser > GetBrowser()= 0
          Returns the browser for this context.
 static CefRefPtr< CefV8Context > GetCurrentContext()
          Returns the current (top) context object in the V8 context stack.
 static CefRefPtr< CefV8Context > GetEnteredContext()
          Returns the entered (bottom) context object in the V8 context stack.
 virtual CefRefPtr< CefFrame > GetFrame()= 0
          Returns the frame for this context.
 virtual CefRefPtr< CefV8Value > GetGlobal()= 0
          Returns the global object for this context.
 virtual CefRefPtr< CefTaskRunner > GetTaskRunner()= 0
          Returns the task runner associated with this context.
 static bool InContext()
          Returns true if V8 is currently inside a context.
 virtual bool IsSame( CefRefPtr< CefV8Context > that )= 0
          Returns true if this object is pointing to the same handle as |that| object.
 virtual bool IsValid()= 0
          Returns true if the underlying handle is valid and it can be accessed on the current thread.
   
Methods inherited from class CefBaseRefCounted
AddRef, Release, HasOneRef, HasAtLeastOneRef
 

Method Detail

Enter

public virtual bool Enter()= 0;
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 if the scope was entered successfully.

Eval

public virtual bool Eval( const CefString& code, const CefString& script_url, int start_line, CefRefPtr< CefV8Value >& retval, CefRefPtr< CefV8Exception >& exception )= 0;
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. On failure |exception| will be set to the exception, if any, and the function will return false.

Exit

public virtual bool Exit()= 0;
Exit this context. Call this method only after calling Enter(). Returns true if the scope was exited successfully.

GetBrowser

public virtual CefRefPtr< CefBrowser > GetBrowser()= 0;
Returns the browser for this context. This method will return an empty reference for WebWorker contexts.

GetCurrentContext

public static CefRefPtr< CefV8Context > GetCurrentContext();
Returns the current (top) context object in the V8 context stack.

GetEnteredContext

public static CefRefPtr< CefV8Context > GetEnteredContext();
Returns the entered (bottom) context object in the V8 context stack.

GetFrame

public virtual CefRefPtr< CefFrame > GetFrame()= 0;
Returns the frame for this context. This method will return an empty reference for WebWorker contexts.

GetGlobal

public virtual CefRefPtr< CefV8Value > GetGlobal()= 0;
Returns the global object for this context. The context must be entered before calling this method.

GetTaskRunner

public virtual CefRefPtr< CefTaskRunner > GetTaskRunner()= 0;
Returns the task runner associated with this context. V8 handles can only be accessed from the thread on which they are created. This method can be called on any render process thread.

InContext

public static bool InContext();
Returns true if V8 is currently inside a context.

IsSame

public virtual bool IsSame( CefRefPtr< CefV8Context > that )= 0;
Returns true if this object is pointing to the same handle as |that| object.

IsValid

public virtual bool IsValid()= 0;
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.

 Overview   Project   Class   Tree   Index 
CEF3 C++ API Docs - Version 75.1.4+g4210896+chromium-75.0.3770.100
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD

Chromium Embedded Framework (CEF) Copyright © 2016 Marshall A. Greenblatt