Add support for non-ref-counted interface classes (issue #2090)

This commit is contained in:
Marshall Greenblatt
2017-02-07 16:25:11 -05:00
parent 9dd0ca2661
commit 07ba48b082
98 changed files with 6369 additions and 1825 deletions

View File

@@ -49,10 +49,14 @@
extern "C" {
#endif
struct _cef_translator_test_handler_child_t;
struct _cef_translator_test_handler_t;
struct _cef_translator_test_object_child_t;
struct _cef_translator_test_object_t;
struct _cef_translator_test_ref_ptr_client_child_t;
struct _cef_translator_test_ref_ptr_client_t;
struct _cef_translator_test_ref_ptr_library_child_t;
struct _cef_translator_test_ref_ptr_library_t;
struct _cef_translator_test_scoped_client_child_t;
struct _cef_translator_test_scoped_client_t;
struct _cef_translator_test_scoped_library_child_t;
struct _cef_translator_test_scoped_library_t;
///
// Structure for testing all of the possible data transfer types.
@@ -242,124 +246,271 @@ typedef struct _cef_translator_test_t {
struct _cef_translator_test_t* self);
// LIBRARY-SIDE OBJECT VALUES
// LIBRARY-SIDE REFPTR VALUES
///
// Return an new library-side object.
///
struct _cef_translator_test_object_t* (CEF_CALLBACK *get_object)(
struct _cef_translator_test_t* self, int val);
struct _cef_translator_test_ref_ptr_library_t* (
CEF_CALLBACK *get_ref_ptr_library)(struct _cef_translator_test_t* self,
int val);
///
// Set an object. Returns the value from
// cef_translator_test_object_t::get_value(). This tests input and execution
// of a library-side object type.
// cef_translator_test_ref_ptr_library_t::get_value(). This tests input and
// execution of a library-side object type.
///
int (CEF_CALLBACK *set_object)(struct _cef_translator_test_t* self,
struct _cef_translator_test_object_t* val);
int (CEF_CALLBACK *set_ref_ptr_library)(struct _cef_translator_test_t* self,
struct _cef_translator_test_ref_ptr_library_t* val);
///
// Set an object. Returns the object passed in. This tests input and output of
// a library-side object type.
///
struct _cef_translator_test_object_t* (CEF_CALLBACK *set_object_and_return)(
struct _cef_translator_test_ref_ptr_library_t* (
CEF_CALLBACK *set_ref_ptr_library_and_return)(
struct _cef_translator_test_t* self,
struct _cef_translator_test_object_t* val);
struct _cef_translator_test_ref_ptr_library_t* val);
///
// Set a child object. Returns the value from
// cef_translator_test_object_t::get_value(). This tests input of a library-
// side child object type and execution as the parent type.
// cef_translator_test_ref_ptr_library_t::get_value(). This tests input of a
// library- side child object type and execution as the parent type.
///
int (CEF_CALLBACK *set_child_object)(struct _cef_translator_test_t* self,
struct _cef_translator_test_object_child_t* val);
int (CEF_CALLBACK *set_child_ref_ptr_library)(
struct _cef_translator_test_t* self,
struct _cef_translator_test_ref_ptr_library_child_t* val);
///
// Set a child object. Returns the object as the parent type. This tests input
// of a library-side child object type and return as the parent type.
///
struct _cef_translator_test_object_t* (
CEF_CALLBACK *set_child_object_and_return_parent)(
struct _cef_translator_test_ref_ptr_library_t* (
CEF_CALLBACK *set_child_ref_ptr_library_and_return_parent)(
struct _cef_translator_test_t* self,
struct _cef_translator_test_object_child_t* val);
struct _cef_translator_test_ref_ptr_library_child_t* val);
///
// Set an object list vlaue.
///
int (CEF_CALLBACK *set_object_list)(struct _cef_translator_test_t* self,
size_t valCount, struct _cef_translator_test_object_t* const* val,
int val1, int val2);
int (CEF_CALLBACK *set_ref_ptr_library_list)(
struct _cef_translator_test_t* self, size_t valCount,
struct _cef_translator_test_ref_ptr_library_t* const* val, int val1,
int val2);
///
// Return an object list value by out-param.
///
int (CEF_CALLBACK *get_object_list_by_ref)(
int (CEF_CALLBACK *get_ref_ptr_library_list_by_ref)(
struct _cef_translator_test_t* self, size_t* valCount,
struct _cef_translator_test_object_t** val, int val1, int val2);
struct _cef_translator_test_ref_ptr_library_t** val, int val1,
int val2);
///
// Return the number of object that will be output above.
///
size_t (CEF_CALLBACK *get_object_list_size)(
size_t (CEF_CALLBACK *get_ref_ptr_library_list_size)(
struct _cef_translator_test_t* self);
// CLIENT-SIDE OBJECT VALUES
// CLIENT-SIDE REFPTR VALUES
///
// Set an object. Returns the value from
// cef_translator_test_handler_t::get_value(). This tests input and execution
// of a client-side object type.
// cef_translator_test_ref_ptr_client_t::get_value(). This tests input and
// execution of a client-side object type.
///
int (CEF_CALLBACK *set_handler)(struct _cef_translator_test_t* self,
struct _cef_translator_test_handler_t* val);
int (CEF_CALLBACK *set_ref_ptr_client)(struct _cef_translator_test_t* self,
struct _cef_translator_test_ref_ptr_client_t* val);
///
// Set an object. Returns the handler passed in. This tests input and output
// of a client-side object type.
///
struct _cef_translator_test_handler_t* (CEF_CALLBACK *set_handler_and_return)(
struct _cef_translator_test_ref_ptr_client_t* (
CEF_CALLBACK *set_ref_ptr_client_and_return)(
struct _cef_translator_test_t* self,
struct _cef_translator_test_handler_t* val);
struct _cef_translator_test_ref_ptr_client_t* val);
///
// Set a child object. Returns the value from
// cef_translator_test_handler_t::get_value(). This tests input of a client-
// side child object type and execution as the parent type.
// cef_translator_test_ref_ptr_client_t::get_value(). This tests input of a
// client- side child object type and execution as the parent type.
///
int (CEF_CALLBACK *set_child_handler)(struct _cef_translator_test_t* self,
struct _cef_translator_test_handler_child_t* val);
int (CEF_CALLBACK *set_child_ref_ptr_client)(
struct _cef_translator_test_t* self,
struct _cef_translator_test_ref_ptr_client_child_t* val);
///
// Set a child object. Returns the object as the parent type. This tests input
// of a client-side child object type and return as the parent type.
///
struct _cef_translator_test_handler_t* (
CEF_CALLBACK *set_child_handler_and_return_parent)(
struct _cef_translator_test_ref_ptr_client_t* (
CEF_CALLBACK *set_child_ref_ptr_client_and_return_parent)(
struct _cef_translator_test_t* self,
struct _cef_translator_test_handler_child_t* val);
struct _cef_translator_test_ref_ptr_client_child_t* val);
///
// Set an object list vlaue.
///
int (CEF_CALLBACK *set_handler_list)(struct _cef_translator_test_t* self,
size_t valCount, struct _cef_translator_test_handler_t* const* val,
int val1, int val2);
int (CEF_CALLBACK *set_ref_ptr_client_list)(
struct _cef_translator_test_t* self, size_t valCount,
struct _cef_translator_test_ref_ptr_client_t* const* val, int val1,
int val2);
///
// Return an object list value by out-param.
///
int (CEF_CALLBACK *get_handler_list_by_ref)(
int (CEF_CALLBACK *get_ref_ptr_client_list_by_ref)(
struct _cef_translator_test_t* self, size_t* valCount,
struct _cef_translator_test_handler_t** val,
struct _cef_translator_test_handler_t* val1,
struct _cef_translator_test_handler_t* val2);
struct _cef_translator_test_ref_ptr_client_t** val,
struct _cef_translator_test_ref_ptr_client_t* val1,
struct _cef_translator_test_ref_ptr_client_t* val2);
///
// Return the number of object that will be output above.
///
size_t (CEF_CALLBACK *get_handler_list_size)(
size_t (CEF_CALLBACK *get_ref_ptr_client_list_size)(
struct _cef_translator_test_t* self);
// LIBRARY-SIDE OWNPTR VALUES
///
// Return an new library-side object.
///
struct _cef_translator_test_scoped_library_t* (
CEF_CALLBACK *get_own_ptr_library)(struct _cef_translator_test_t* self,
int val);
///
// Set an object. Returns the value from
// cef_translator_test_scoped_library_t::get_value(). This tests input and
// execution of a library-side object type.
///
int (CEF_CALLBACK *set_own_ptr_library)(struct _cef_translator_test_t* self,
struct _cef_translator_test_scoped_library_t* val);
///
// Set an object. Returns the object passed in. This tests input and output of
// a library-side object type.
///
struct _cef_translator_test_scoped_library_t* (
CEF_CALLBACK *set_own_ptr_library_and_return)(
struct _cef_translator_test_t* self,
struct _cef_translator_test_scoped_library_t* val);
///
// Set a child object. Returns the value from
// cef_translator_test_scoped_library_t::get_value(). This tests input of a
// library- side child object type and execution as the parent type.
///
int (CEF_CALLBACK *set_child_own_ptr_library)(
struct _cef_translator_test_t* self,
struct _cef_translator_test_scoped_library_child_t* val);
///
// Set a child object. Returns the object as the parent type. This tests input
// of a library-side child object type and return as the parent type.
///
struct _cef_translator_test_scoped_library_t* (
CEF_CALLBACK *set_child_own_ptr_library_and_return_parent)(
struct _cef_translator_test_t* self,
struct _cef_translator_test_scoped_library_child_t* val);
// CLIENT-SIDE OWNPTR VALUES
///
// Set an object. Returns the value from
// cef_translator_test_scoped_client_t::get_value(). This tests input and
// execution of a client-side object type.
///
int (CEF_CALLBACK *set_own_ptr_client)(struct _cef_translator_test_t* self,
struct _cef_translator_test_scoped_client_t* val);
///
// Set an object. Returns the handler passed in. This tests input and output
// of a client-side object type.
///
struct _cef_translator_test_scoped_client_t* (
CEF_CALLBACK *set_own_ptr_client_and_return)(
struct _cef_translator_test_t* self,
struct _cef_translator_test_scoped_client_t* val);
///
// Set a child object. Returns the value from
// cef_translator_test_scoped_client_t::get_value(). This tests input of a
// client- side child object type and execution as the parent type.
///
int (CEF_CALLBACK *set_child_own_ptr_client)(
struct _cef_translator_test_t* self,
struct _cef_translator_test_scoped_client_child_t* val);
///
// Set a child object. Returns the object as the parent type. This tests input
// of a client-side child object type and return as the parent type.
///
struct _cef_translator_test_scoped_client_t* (
CEF_CALLBACK *set_child_own_ptr_client_and_return_parent)(
struct _cef_translator_test_t* self,
struct _cef_translator_test_scoped_client_child_t* val);
// LIBRARY-SIDE RAWPTR VALUES
///
// Set an object. Returns the value from
// cef_translator_test_scoped_library_t::get_value(). This tests input and
// execution of a library-side object type.
///
int (CEF_CALLBACK *set_raw_ptr_library)(struct _cef_translator_test_t* self,
struct _cef_translator_test_scoped_library_t* val);
///
// Set a child object. Returns the value from
// cef_translator_test_scoped_library_t::get_value(). This tests input of a
// library- side child object type and execution as the parent type.
///
int (CEF_CALLBACK *set_child_raw_ptr_library)(
struct _cef_translator_test_t* self,
struct _cef_translator_test_scoped_library_child_t* val);
///
// Set an object list vlaue.
///
int (CEF_CALLBACK *set_raw_ptr_library_list)(
struct _cef_translator_test_t* self, size_t valCount,
struct _cef_translator_test_scoped_library_t* const* val, int val1,
int val2);
// CLIENT-SIDE RAWPTR VALUES
///
// Set an object. Returns the value from
// cef_translator_test_scoped_client_t::get_value(). This tests input and
// execution of a client-side object type.
///
int (CEF_CALLBACK *set_raw_ptr_client)(struct _cef_translator_test_t* self,
struct _cef_translator_test_scoped_client_t* val);
///
// Set a child object. Returns the value from
// cef_translator_test_scoped_client_t::get_value(). This tests input of a
// client- side child object type and execution as the parent type.
///
int (CEF_CALLBACK *set_child_raw_ptr_client)(
struct _cef_translator_test_t* self,
struct _cef_translator_test_scoped_client_child_t* val);
///
// Set an object list vlaue.
///
int (CEF_CALLBACK *set_raw_ptr_client_list)(
struct _cef_translator_test_t* self, size_t valCount,
struct _cef_translator_test_scoped_client_t* const* val, int val1,
int val2);
} cef_translator_test_t;
@@ -370,9 +521,9 @@ CEF_EXPORT cef_translator_test_t* cef_translator_test_create();
///
// Library-side test object.
// Library-side test object for RefPtr.
///
typedef struct _cef_translator_test_object_t {
typedef struct _cef_translator_test_ref_ptr_library_t {
///
// Base structure.
///
@@ -381,87 +532,89 @@ typedef struct _cef_translator_test_object_t {
///
// Return a value.
///
int (CEF_CALLBACK *get_value)(struct _cef_translator_test_object_t* self);
int (CEF_CALLBACK *get_value)(
struct _cef_translator_test_ref_ptr_library_t* self);
///
// Set a value.
///
void (CEF_CALLBACK *set_value)(struct _cef_translator_test_object_t* self,
int value);
} cef_translator_test_object_t;
void (CEF_CALLBACK *set_value)(
struct _cef_translator_test_ref_ptr_library_t* self, int value);
} cef_translator_test_ref_ptr_library_t;
///
// Create the test object.
///
CEF_EXPORT cef_translator_test_object_t* cef_translator_test_object_create(
CEF_EXPORT cef_translator_test_ref_ptr_library_t* cef_translator_test_ref_ptr_library_create(
int value);
///
// Library-side child test object.
// Library-side child test object for RefPtr.
///
typedef struct _cef_translator_test_object_child_t {
typedef struct _cef_translator_test_ref_ptr_library_child_t {
///
// Base structure.
///
cef_translator_test_object_t base;
cef_translator_test_ref_ptr_library_t base;
///
// Return a value.
///
int (CEF_CALLBACK *get_other_value)(
struct _cef_translator_test_object_child_t* self);
struct _cef_translator_test_ref_ptr_library_child_t* self);
///
// Set a value.
///
void (CEF_CALLBACK *set_other_value)(
struct _cef_translator_test_object_child_t* self, int value);
} cef_translator_test_object_child_t;
struct _cef_translator_test_ref_ptr_library_child_t* self, int value);
} cef_translator_test_ref_ptr_library_child_t;
///
// Create the test object.
///
CEF_EXPORT cef_translator_test_object_child_t* cef_translator_test_object_child_create(
CEF_EXPORT cef_translator_test_ref_ptr_library_child_t* cef_translator_test_ref_ptr_library_child_create(
int value, int other_value);
///
// Another library-side child test object.
// Another library-side child test object for RefPtr.
///
typedef struct _cef_translator_test_object_child_child_t {
typedef struct _cef_translator_test_ref_ptr_library_child_child_t {
///
// Base structure.
///
cef_translator_test_object_child_t base;
cef_translator_test_ref_ptr_library_child_t base;
///
// Return a value.
///
int (CEF_CALLBACK *get_other_other_value)(
struct _cef_translator_test_object_child_child_t* self);
struct _cef_translator_test_ref_ptr_library_child_child_t* self);
///
// Set a value.
///
void (CEF_CALLBACK *set_other_other_value)(
struct _cef_translator_test_object_child_child_t* self, int value);
} cef_translator_test_object_child_child_t;
struct _cef_translator_test_ref_ptr_library_child_child_t* self,
int value);
} cef_translator_test_ref_ptr_library_child_child_t;
///
// Create the test object.
///
CEF_EXPORT cef_translator_test_object_child_child_t* cef_translator_test_object_child_child_create(
CEF_EXPORT cef_translator_test_ref_ptr_library_child_child_t* cef_translator_test_ref_ptr_library_child_child_create(
int value, int other_value, int other_other_value);
///
// Client-side test object.
// Client-side test object for RefPtr.
///
typedef struct _cef_translator_test_handler_t {
typedef struct _cef_translator_test_ref_ptr_client_t {
///
// Base structure.
///
@@ -470,25 +623,151 @@ typedef struct _cef_translator_test_handler_t {
///
// Return a value.
///
int (CEF_CALLBACK *get_value)(struct _cef_translator_test_handler_t* self);
} cef_translator_test_handler_t;
int (CEF_CALLBACK *get_value)(
struct _cef_translator_test_ref_ptr_client_t* self);
} cef_translator_test_ref_ptr_client_t;
///
// Client-side child test object.
// Client-side child test object for RefPtr.
///
typedef struct _cef_translator_test_handler_child_t {
typedef struct _cef_translator_test_ref_ptr_client_child_t {
///
// Base structure.
///
cef_translator_test_handler_t base;
cef_translator_test_ref_ptr_client_t base;
///
// Return a value.
///
int (CEF_CALLBACK *get_other_value)(
struct _cef_translator_test_handler_child_t* self);
} cef_translator_test_handler_child_t;
struct _cef_translator_test_ref_ptr_client_child_t* self);
} cef_translator_test_ref_ptr_client_child_t;
///
// Library-side test object for OwnPtr/RawPtr.
///
typedef struct _cef_translator_test_scoped_library_t {
///
// Base structure.
///
cef_base_scoped_t base;
///
// Return a value.
///
int (CEF_CALLBACK *get_value)(
struct _cef_translator_test_scoped_library_t* self);
///
// Set a value.
///
void (CEF_CALLBACK *set_value)(
struct _cef_translator_test_scoped_library_t* self, int value);
} cef_translator_test_scoped_library_t;
///
// Create the test object.
///
CEF_EXPORT cef_translator_test_scoped_library_t* cef_translator_test_scoped_library_create(
int value);
///
// Library-side child test object for OwnPtr/RawPtr.
///
typedef struct _cef_translator_test_scoped_library_child_t {
///
// Base structure.
///
cef_translator_test_scoped_library_t base;
///
// Return a value.
///
int (CEF_CALLBACK *get_other_value)(
struct _cef_translator_test_scoped_library_child_t* self);
///
// Set a value.
///
void (CEF_CALLBACK *set_other_value)(
struct _cef_translator_test_scoped_library_child_t* self, int value);
} cef_translator_test_scoped_library_child_t;
///
// Create the test object.
///
CEF_EXPORT cef_translator_test_scoped_library_child_t* cef_translator_test_scoped_library_child_create(
int value, int other_value);
///
// Another library-side child test object for OwnPtr/RawPtr.
///
typedef struct _cef_translator_test_scoped_library_child_child_t {
///
// Base structure.
///
cef_translator_test_scoped_library_child_t base;
///
// Return a value.
///
int (CEF_CALLBACK *get_other_other_value)(
struct _cef_translator_test_scoped_library_child_child_t* self);
///
// Set a value.
///
void (CEF_CALLBACK *set_other_other_value)(
struct _cef_translator_test_scoped_library_child_child_t* self,
int value);
} cef_translator_test_scoped_library_child_child_t;
///
// Create the test object.
///
CEF_EXPORT cef_translator_test_scoped_library_child_child_t* cef_translator_test_scoped_library_child_child_create(
int value, int other_value, int other_other_value);
///
// Client-side test object for OwnPtr/RawPtr.
///
typedef struct _cef_translator_test_scoped_client_t {
///
// Base structure.
///
cef_base_scoped_t base;
///
// Return a value.
///
int (CEF_CALLBACK *get_value)(
struct _cef_translator_test_scoped_client_t* self);
} cef_translator_test_scoped_client_t;
///
// Client-side child test object for OwnPtr/RawPtr.
///
typedef struct _cef_translator_test_scoped_client_child_t {
///
// Base structure.
///
cef_translator_test_scoped_client_t base;
///
// Return a value.
///
int (CEF_CALLBACK *get_other_value)(
struct _cef_translator_test_scoped_client_child_t* self);
} cef_translator_test_scoped_client_child_t;
#ifdef __cplusplus