Support custom V8 bindings on WebWorker threads (issue #451).

- Add CefRenderProcessHandler callbacks for WebWorker context creation, release and uncaught exceptions.
- Add CefTaskRunner class that supports posting of tasks to standard threads and WebWorker threads.
- Organize V8 internal state information on a per-thread/per-Isolate basis.
- Add webkit_451.patch that provides the WebKit implementation.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@972 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2013-01-03 17:24:24 +00:00
parent f30fbb3d48
commit afe3cb1d67
44 changed files with 2434 additions and 406 deletions

View File

@@ -105,10 +105,11 @@ CEF_EXPORT int cef_register_extension(const cef_string_t* extension_name,
const cef_string_t* javascript_code, struct _cef_v8handler_t* handler);
///
// Structure representing a V8 context handle. Static functions may only be
// called on a render process thread that has entered a V8 isolate (usually the
// render process main thread). Non-static functions may only be called on the
// thread that initially returned the handle.
// Structure 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 cef_v8context_t::get_task_runner() function.
///
typedef struct _cef_v8context_t {
///
@@ -116,6 +117,14 @@ typedef struct _cef_v8context_t {
///
cef_base_t base;
///
// 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.
///
struct _cef_task_runner_t* (CEF_CALLBACK *get_task_runner)(
struct _cef_v8context_t* self);
///
// 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
@@ -124,13 +133,15 @@ typedef struct _cef_v8context_t {
int (CEF_CALLBACK *is_valid)(struct _cef_v8context_t* self);
///
// Returns the browser for this context.
// Returns the browser for this context. This function will return an NULL
// reference for WebWorker contexts.
///
struct _cef_browser_t* (CEF_CALLBACK *get_browser)(
struct _cef_v8context_t* self);
///
// Returns the frame for this context.
// Returns the frame for this context. This function will return an NULL
// reference for WebWorker contexts.
///
struct _cef_frame_t* (CEF_CALLBACK *get_frame)(struct _cef_v8context_t* self);
@@ -193,8 +204,8 @@ CEF_EXPORT int cef_v8context_in_context();
///
// Structure that should be implemented to handle V8 function calls. The
// functions of this structure will only be called on a render process thread
// that the handler was registered on.
// functions of this structure will be called on the thread associated with the
// V8 function.
///
typedef struct _cef_v8handler_t {
///
@@ -219,8 +230,8 @@ typedef struct _cef_v8handler_t {
///
// Structure that should be implemented to handle V8 accessor calls. Accessor
// identifiers are registered by calling cef_v8value_t::set_value_byaccessor().
// The functions of this structure will only be called on a render process
// thread that the accessor was registered on.
// The functions of this structure will be called on the thread associated with
// the V8 accessor.
///
typedef struct _cef_v8accessor_t {
///
@@ -317,10 +328,11 @@ typedef struct _cef_v8exception_t {
///
// Structure representing a V8 value handle. Static functions may only be called
// on a render process thread that has entered a V8 isolate (usually the render
// process main thread). Non-static functions may only be called on the thread
// that initially returned the handle.
// 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.
///
typedef struct _cef_v8value_t {
///
@@ -720,10 +732,11 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_function(const cef_string_t* name,
///
// Structure representing a V8 stack trace handle. Static functions may only be
// called on a render process thread that has entered a V8 isolate (usually the
// render process main thread). Non-static functions may only be called on the
// thread that initially returned the handle.
// Structure representing a V8 stack trace 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.
///
typedef struct _cef_v8stack_trace_t {
///
@@ -759,10 +772,11 @@ CEF_EXPORT cef_v8stack_trace_t* cef_v8stack_trace_get_current(int frame_limit);
///
// Structure representing a V8 stack frame handle. Static functions may only be
// called on a render process thread that has entered a V8 isolate (usually the
// render process main thread). Non-static functions may only be called on the
// thread that initially returned the handle.
// Structure representing a V8 stack frame 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.
///
typedef struct _cef_v8stack_frame_t {
///