]> git.sesse.net Git - casparcg/blobdiff - dependencies64/cef/linux/include/capi/cef_base_capi.h
Upgrade CEF to 3.3029.1611.g44e39a8 / Chromium 58.0.3029.81.
[casparcg] / dependencies64 / cef / linux / include / capi / cef_base_capi.h
similarity index 63%
rename from dependencies64/cef/include/capi/cef_base_capi.h
rename to dependencies64/cef/linux/include/capi/cef_base_capi.h
index 769239c7ba67556492c8ca7b7245f7c59da6d842..681ef4daab991b1b61d8f3672dbcbc5bb09cce92 100644 (file)
@@ -31,6 +31,8 @@
 #ifndef CEF_INCLUDE_CAPI_CEF_BASE_CAPI_H_
 #define CEF_INCLUDE_CAPI_CEF_BASE_CAPI_H_
 
+#include <stdint.h>
+
 #include "include/internal/cef_export.h"
 #include "include/internal/cef_string.h"
 #include "include/internal/cef_string_list.h"
@@ -43,37 +45,56 @@ extern "C" {
 #endif
 
 ///
-// Structure defining the reference count implementation functions. All
-// framework structures must include the cef_base_t structure first.
+// All ref-counted framework structures must include this structure first.
 ///
-typedef struct _cef_base_t {
+typedef struct _cef_base_ref_counted_t {
   ///
   // Size of the data structure.
   ///
   size_t size;
 
   ///
-  // Increment the reference count.
+  // Called to increment the reference count for the object. Should be called
+  // for every new copy of a pointer to a given object.
   ///
-  int (CEF_CALLBACK *add_ref)(struct _cef_base_t* self);
+  void (CEF_CALLBACK *add_ref)(struct _cef_base_ref_counted_t* self);
 
   ///
-  // Decrement the reference count.  Delete this object when no references
-  // remain.
+  // Called to decrement the reference count for the object. If the reference
+  // count falls to 0 the object should self-delete. Returns true (1) if the
+  // resulting reference count is 0.
   ///
-  int (CEF_CALLBACK *release)(struct _cef_base_t* self);
+  int (CEF_CALLBACK *release)(struct _cef_base_ref_counted_t* self);
 
   ///
-  // Returns the current number of references.
+  // Returns true (1) if the current reference count is 1.
   ///
-  int (CEF_CALLBACK *get_refct)(struct _cef_base_t* self);
-} cef_base_t;
+  int (CEF_CALLBACK *has_one_ref)(struct _cef_base_ref_counted_t* self);
+} cef_base_ref_counted_t;
+
+
+///
+// All scoped framework structures must include this structure first.
+///
+typedef struct _cef_base_scoped_t {
+  ///
+  // Size of the data structure.
+  ///
+  size_t size;
+
+  ///
+  // Called to delete this object. May be NULL if the object is not owned.
+  ///
+  void (CEF_CALLBACK *del)(struct _cef_base_scoped_t* self);
+
+} cef_base_scoped_t;
 
 
-// Check that the structure |s|, which is defined with a cef_base_t member named
-// |base|, is large enough to contain the specified member |f|.
+// Check that the structure |s|, which is defined with a size_t member at the
+// top, is large enough to contain the specified member |f|.
 #define CEF_MEMBER_EXISTS(s, f)   \
-  ((intptr_t)&((s)->f) - (intptr_t)(s) + sizeof((s)->f) <= (s)->base.size)
+  ((intptr_t)&((s)->f) - (intptr_t)(s) + sizeof((s)->f) <= \
+  *reinterpret_cast<size_t*>(s))
 
 #define CEF_MEMBER_MISSING(s, f)  (!CEF_MEMBER_EXISTS(s, f) || !((s)->f))