]> git.sesse.net Git - casparcg/blobdiff - dependencies64/cef/linux/include/capi/cef_v8_capi.h
Upgrade CEF to 3.3029.1611.g44e39a8 / Chromium 58.0.3029.81.
[casparcg] / dependencies64 / cef / linux / include / capi / cef_v8_capi.h
similarity index 85%
rename from dependencies64/cef/include/capi/cef_v8_capi.h
rename to dependencies64/cef/linux/include/capi/cef_v8_capi.h
index 4953be31e8983fbe2bab0d785d98fc5fac617b3b..a659b8da0d6e960de271403d618f07233e0a706d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
+// Copyright (c) 2017 Marshall A. Greenblatt. All rights reserved.
 //
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
@@ -63,7 +63,7 @@ typedef struct _cef_v8context_t {
   ///
   // Base structure.
   ///
-  cef_base_t base;
+  cef_base_ref_counted_t base;
 
   ///
   // Returns the task runner associated with this context. V8 handles can only
@@ -123,14 +123,16 @@ typedef struct _cef_v8context_t {
       struct _cef_v8context_t* that);
 
   ///
-  // Evaluates the specified JavaScript code using this context's global object.
+  // 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).
   ///
   int (CEF_CALLBACK *eval)(struct _cef_v8context_t* self,
-      const cef_string_t* code, struct _cef_v8value_t** retval,
-      struct _cef_v8exception_t** exception);
+      const cef_string_t* code, const cef_string_t* script_url, int start_line,
+      struct _cef_v8value_t** retval, struct _cef_v8exception_t** exception);
 } cef_v8context_t;
 
 
@@ -159,7 +161,7 @@ typedef struct _cef_v8handler_t {
   ///
   // Base structure.
   ///
-  cef_base_t base;
+  cef_base_ref_counted_t base;
 
   ///
   // Handle execution of the function identified by |name|. |object| is the
@@ -177,15 +179,15 @@ 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 be called on the thread associated with
-// the V8 accessor.
+// identifiers are registered by calling cef_v8value_t::set_value(). The
+// functions of this structure will be called on the thread associated with the
+// V8 accessor.
 ///
 typedef struct _cef_v8accessor_t {
   ///
   // Base structure.
   ///
-  cef_base_t base;
+  cef_base_ref_counted_t base;
 
   ///
   // Handle retrieval the accessor value identified by |name|. |object| is the
@@ -211,6 +213,70 @@ typedef struct _cef_v8accessor_t {
 } cef_v8accessor_t;
 
 
+///
+// Structure that should be implemented to handle V8 interceptor calls. The
+// functions of this structure will be called on the thread associated with the
+// V8 interceptor. Interceptor's named property handlers (with first argument of
+// type CefString) are called when object is indexed by string. Indexed property
+// handlers (with first argument of type int) are called when object is indexed
+// by integer.
+///
+typedef struct _cef_v8interceptor_t {
+  ///
+  // Base structure.
+  ///
+  cef_base_ref_counted_t base;
+
+  ///
+  // Handle retrieval of the interceptor value identified by |name|. |object| is
+  // the receiver ('this' object) of the interceptor. If retrieval succeeds, set
+  // |retval| to the return value. If the requested value does not exist, don't
+  // set either |retval| or |exception|. If retrieval fails, set |exception| to
+  // the exception that will be thrown. If the property has an associated
+  // accessor, it will be called only if you don't set |retval|. Return true (1)
+  // if interceptor retrieval was handled, false (0) otherwise.
+  ///
+  int (CEF_CALLBACK *get_byname)(struct _cef_v8interceptor_t* self,
+      const cef_string_t* name, struct _cef_v8value_t* object,
+      struct _cef_v8value_t** retval, cef_string_t* exception);
+
+  ///
+  // Handle retrieval of the interceptor value identified by |index|. |object|
+  // is the receiver ('this' object) of the interceptor. If retrieval succeeds,
+  // set |retval| to the return value. If the requested value does not exist,
+  // don't set either |retval| or |exception|. If retrieval fails, set
+  // |exception| to the exception that will be thrown. Return true (1) if
+  // interceptor retrieval was handled, false (0) otherwise.
+  ///
+  int (CEF_CALLBACK *get_byindex)(struct _cef_v8interceptor_t* self, int index,
+      struct _cef_v8value_t* object, struct _cef_v8value_t** retval,
+      cef_string_t* exception);
+
+  ///
+  // Handle assignment of the interceptor value identified by |name|. |object|
+  // is the receiver ('this' object) of the interceptor. |value| is the new
+  // value being assigned to the interceptor. If assignment fails, set
+  // |exception| to the exception that will be thrown. This setter will always
+  // be called, even when the property has an associated accessor. Return true
+  // (1) if interceptor assignment was handled, false (0) otherwise.
+  ///
+  int (CEF_CALLBACK *set_byname)(struct _cef_v8interceptor_t* self,
+      const cef_string_t* name, struct _cef_v8value_t* object,
+      struct _cef_v8value_t* value, cef_string_t* exception);
+
+  ///
+  // Handle assignment of the interceptor value identified by |index|. |object|
+  // is the receiver ('this' object) of the interceptor. |value| is the new
+  // value being assigned to the interceptor. If assignment fails, set
+  // |exception| to the exception that will be thrown. Return true (1) if
+  // interceptor assignment was handled, false (0) otherwise.
+  ///
+  int (CEF_CALLBACK *set_byindex)(struct _cef_v8interceptor_t* self, int index,
+      struct _cef_v8value_t* object, struct _cef_v8value_t* value,
+      cef_string_t* exception);
+} cef_v8interceptor_t;
+
+
 ///
 // Structure representing a V8 exception. The functions of this structure may be
 // called on any render process thread.
@@ -219,7 +285,7 @@ typedef struct _cef_v8exception_t {
   ///
   // Base structure.
   ///
-  cef_base_t base;
+  cef_base_ref_counted_t base;
 
   ///
   // Returns the exception message.
@@ -286,7 +352,7 @@ typedef struct _cef_v8value_t {
   ///
   // Base structure.
   ///
-  cef_base_t base;
+  cef_base_ref_counted_t base;
 
   ///
   // Returns true (1) if the underlying handle is valid and it can be accessed
@@ -358,38 +424,32 @@ typedef struct _cef_v8value_t {
       struct _cef_v8value_t* that);
 
   ///
-  // Return a bool value.  The underlying data will be converted to if
-  // necessary.
+  // Return a bool value.
   ///
   int (CEF_CALLBACK *get_bool_value)(struct _cef_v8value_t* self);
 
   ///
-  // Return an int value.  The underlying data will be converted to if
-  // necessary.
+  // Return an int value.
   ///
   int32 (CEF_CALLBACK *get_int_value)(struct _cef_v8value_t* self);
 
   ///
-  // Return an unisgned int value.  The underlying data will be converted to if
-  // necessary.
+  // Return an unsigned int value.
   ///
   uint32 (CEF_CALLBACK *get_uint_value)(struct _cef_v8value_t* self);
 
   ///
-  // Return a double value.  The underlying data will be converted to if
-  // necessary.
+  // Return a double value.
   ///
   double (CEF_CALLBACK *get_double_value)(struct _cef_v8value_t* self);
 
   ///
-  // Return a Date value.  The underlying data will be converted to if
-  // necessary.
+  // Return a Date value.
   ///
   cef_time_t (CEF_CALLBACK *get_date_value)(struct _cef_v8value_t* self);
 
   ///
-  // Return a string value.  The underlying data will be converted to if
-  // necessary.
+  // Return a string value.
   ///
   // The resulting string must be freed by calling cef_string_userfree_free().
   cef_string_userfree_t (CEF_CALLBACK *get_string_value)(
@@ -525,12 +585,12 @@ typedef struct _cef_v8value_t {
   // called on user created objects.
   ///
   int (CEF_CALLBACK *set_user_data)(struct _cef_v8value_t* self,
-      struct _cef_base_t* user_data);
+      struct _cef_base_ref_counted_t* user_data);
 
   ///
   // Returns the user data, if any, assigned to this object.
   ///
-  struct _cef_base_t* (CEF_CALLBACK *get_user_data)(
+  struct _cef_base_ref_counted_t* (CEF_CALLBACK *get_user_data)(
       struct _cef_v8value_t* self);
 
   ///
@@ -640,9 +700,9 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_double(double value);
 
 ///
 // Create a new cef_v8value_t object of type Date. This function should only be
-// called from within the scope of a cef_v8context_tHandler, cef_v8handler_t or
-// cef_v8accessor_t callback, or in combination with calling enter() and exit()
-// on a stored cef_v8context_t reference.
+// called from within the scope of a cef_render_process_handler_t,
+// cef_v8handler_t or cef_v8accessor_t callback, or in combination with calling
+// enter() and exit() on a stored cef_v8context_t reference.
 ///
 CEF_EXPORT cef_v8value_t* cef_v8value_create_date(const cef_time_t* date);
 
@@ -652,28 +712,30 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_date(const cef_time_t* date);
 CEF_EXPORT cef_v8value_t* cef_v8value_create_string(const cef_string_t* value);
 
 ///
-// Create a new cef_v8value_t object of type object with optional accessor. This
-// function should only be called from within the scope of a
-// cef_v8context_tHandler, cef_v8handler_t or cef_v8accessor_t callback, or in
-// combination with calling enter() and exit() on a stored cef_v8context_t
-// reference.
+// Create a new cef_v8value_t object of type object with optional accessor
+// and/or interceptor. This function should only be called from within the scope
+// of a cef_render_process_handler_t, cef_v8handler_t or cef_v8accessor_t
+// callback, or in combination with calling enter() and exit() on a stored
+// cef_v8context_t reference.
 ///
-CEF_EXPORT cef_v8value_t* cef_v8value_create_object(cef_v8accessor_t* accessor);
+CEF_EXPORT cef_v8value_t* cef_v8value_create_object(cef_v8accessor_t* accessor,
+    cef_v8interceptor_t* interceptor);
 
 ///
 // Create a new cef_v8value_t object of type array with the specified |length|.
 // If |length| is negative the returned array will have length 0. This function
-// should only be called from within the scope of a cef_v8context_tHandler,
-// cef_v8handler_t or cef_v8accessor_t callback, or in combination with calling
-// enter() and exit() on a stored cef_v8context_t reference.
+// should only be called from within the scope of a
+// cef_render_process_handler_t, cef_v8handler_t or cef_v8accessor_t callback,
+// or in combination with calling enter() and exit() on a stored cef_v8context_t
+// reference.
 ///
 CEF_EXPORT cef_v8value_t* cef_v8value_create_array(int length);
 
 ///
 // Create a new cef_v8value_t object of type function. This function should only
-// be called from within the scope of a cef_v8context_tHandler, cef_v8handler_t
-// or cef_v8accessor_t callback, or in combination with calling enter() and
-// exit() on a stored cef_v8context_t reference.
+// be called from within the scope of a cef_render_process_handler_t,
+// cef_v8handler_t or cef_v8accessor_t callback, or in combination with calling
+// enter() and exit() on a stored cef_v8context_t reference.
 ///
 CEF_EXPORT cef_v8value_t* cef_v8value_create_function(const cef_string_t* name,
     cef_v8handler_t* handler);
@@ -690,7 +752,7 @@ typedef struct _cef_v8stack_trace_t {
   ///
   // Base structure.
   ///
-  cef_base_t base;
+  cef_base_ref_counted_t base;
 
   ///
   // Returns true (1) if the underlying handle is valid and it can be accessed
@@ -730,7 +792,7 @@ typedef struct _cef_v8stack_frame_t {
   ///
   // Base structure.
   ///
-  cef_base_t base;
+  cef_base_ref_counted_t base;
 
   ///
   // Returns true (1) if the underlying handle is valid and it can be accessed