mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add support for non-ref-counted interface classes (issue #2090)
This commit is contained in:
@ -390,16 +390,26 @@
|
|||||||
'libcef_dll/cpptoc/thread_cpptoc.h',
|
'libcef_dll/cpptoc/thread_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/test/translator_test_cpptoc.cc',
|
'libcef_dll/cpptoc/test/translator_test_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/test/translator_test_cpptoc.h',
|
'libcef_dll/cpptoc/test/translator_test_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/test/translator_test_handler_ctocpp.cc',
|
'libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/test/translator_test_handler_ctocpp.h',
|
'libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/test/translator_test_handler_child_ctocpp.cc',
|
'libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/test/translator_test_handler_child_ctocpp.h',
|
'libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/test/translator_test_object_cpptoc.cc',
|
'libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/test/translator_test_object_cpptoc.h',
|
'libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/test/translator_test_object_child_cpptoc.cc',
|
'libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/test/translator_test_object_child_cpptoc.h',
|
'libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/test/translator_test_object_child_child_cpptoc.cc',
|
'libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/test/translator_test_object_child_child_cpptoc.h',
|
'libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.h',
|
||||||
|
'libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.cc',
|
||||||
|
'libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.h',
|
||||||
|
'libcef_dll/ctocpp/test/translator_test_scoped_client_child_ctocpp.cc',
|
||||||
|
'libcef_dll/ctocpp/test/translator_test_scoped_client_child_ctocpp.h',
|
||||||
|
'libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.cc',
|
||||||
|
'libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.h',
|
||||||
|
'libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.cc',
|
||||||
|
'libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.h',
|
||||||
|
'libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.cc',
|
||||||
|
'libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/urlrequest_cpptoc.cc',
|
'libcef_dll/cpptoc/urlrequest_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/urlrequest_cpptoc.h',
|
'libcef_dll/cpptoc/urlrequest_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/urlrequest_client_ctocpp.cc',
|
'libcef_dll/ctocpp/urlrequest_client_ctocpp.cc',
|
||||||
@ -652,16 +662,26 @@
|
|||||||
'libcef_dll/ctocpp/thread_ctocpp.h',
|
'libcef_dll/ctocpp/thread_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/test/translator_test_ctocpp.cc',
|
'libcef_dll/ctocpp/test/translator_test_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/test/translator_test_ctocpp.h',
|
'libcef_dll/ctocpp/test/translator_test_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/test/translator_test_handler_cpptoc.cc',
|
'libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/test/translator_test_handler_cpptoc.h',
|
'libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/test/translator_test_handler_child_cpptoc.cc',
|
'libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/test/translator_test_handler_child_cpptoc.h',
|
'libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/test/translator_test_object_ctocpp.cc',
|
'libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/test/translator_test_object_ctocpp.h',
|
'libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/test/translator_test_object_child_ctocpp.cc',
|
'libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/test/translator_test_object_child_ctocpp.h',
|
'libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/test/translator_test_object_child_child_ctocpp.cc',
|
'libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/test/translator_test_object_child_child_ctocpp.h',
|
'libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.h',
|
||||||
|
'libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.cc',
|
||||||
|
'libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.h',
|
||||||
|
'libcef_dll/cpptoc/test/translator_test_scoped_client_child_cpptoc.cc',
|
||||||
|
'libcef_dll/cpptoc/test/translator_test_scoped_client_child_cpptoc.h',
|
||||||
|
'libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.cc',
|
||||||
|
'libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.h',
|
||||||
|
'libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.cc',
|
||||||
|
'libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.h',
|
||||||
|
'libcef_dll/ctocpp/test/translator_test_scoped_library_child_child_ctocpp.cc',
|
||||||
|
'libcef_dll/ctocpp/test/translator_test_scoped_library_child_child_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/urlrequest_ctocpp.cc',
|
'libcef_dll/ctocpp/urlrequest_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/urlrequest_ctocpp.h',
|
'libcef_dll/ctocpp/urlrequest_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/urlrequest_client_cpptoc.cc',
|
'libcef_dll/cpptoc/urlrequest_client_cpptoc.cc',
|
||||||
|
@ -89,11 +89,16 @@
|
|||||||
],
|
],
|
||||||
'libcef_sources_common': [
|
'libcef_sources_common': [
|
||||||
'libcef_dll/cpptoc/cpptoc.h',
|
'libcef_dll/cpptoc/cpptoc.h',
|
||||||
|
'libcef_dll/cpptoc/cpptoc_scoped.h',
|
||||||
'libcef_dll/ctocpp/base_ctocpp.cc',
|
'libcef_dll/ctocpp/base_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/base_ctocpp.h',
|
'libcef_dll/ctocpp/base_ctocpp.h',
|
||||||
|
'libcef_dll/ctocpp/base_scoped_ctocpp.cc',
|
||||||
|
'libcef_dll/ctocpp/base_scoped_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/ctocpp.h',
|
'libcef_dll/ctocpp/ctocpp.h',
|
||||||
|
'libcef_dll/ctocpp/ctocpp_scoped.h',
|
||||||
'libcef_dll/libcef_dll.cc',
|
'libcef_dll/libcef_dll.cc',
|
||||||
'libcef_dll/libcef_dll2.cc',
|
'libcef_dll/libcef_dll2.cc',
|
||||||
|
'libcef_dll/ptr_util.h',
|
||||||
'libcef_dll/resource.h',
|
'libcef_dll/resource.h',
|
||||||
'libcef_dll/transfer_util.cc',
|
'libcef_dll/transfer_util.cc',
|
||||||
'libcef_dll/transfer_util.h',
|
'libcef_dll/transfer_util.h',
|
||||||
@ -116,8 +121,13 @@
|
|||||||
'libcef_dll_wrapper_sources_common': [
|
'libcef_dll_wrapper_sources_common': [
|
||||||
'libcef_dll/cpptoc/base_cpptoc.cc',
|
'libcef_dll/cpptoc/base_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/base_cpptoc.h',
|
'libcef_dll/cpptoc/base_cpptoc.h',
|
||||||
|
'libcef_dll/cpptoc/base_scoped_cpptoc.cc',
|
||||||
|
'libcef_dll/cpptoc/base_scoped_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/cpptoc.h',
|
'libcef_dll/cpptoc/cpptoc.h',
|
||||||
|
'libcef_dll/cpptoc/cpptoc_scoped.h',
|
||||||
'libcef_dll/ctocpp/ctocpp.h',
|
'libcef_dll/ctocpp/ctocpp.h',
|
||||||
|
'libcef_dll/ctocpp/ctocpp_scoped.h',
|
||||||
|
'libcef_dll/ptr_util.h',
|
||||||
'libcef_dll/transfer_util.cc',
|
'libcef_dll/transfer_util.cc',
|
||||||
'libcef_dll/transfer_util.h',
|
'libcef_dll/transfer_util.h',
|
||||||
'libcef_dll/wrapper_types.h',
|
'libcef_dll/wrapper_types.h',
|
||||||
|
@ -189,4 +189,13 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif // OVERRIDE
|
#endif // OVERRIDE
|
||||||
|
|
||||||
|
// Check for C++11 template alias support which was added in VS2013 and GCC4.7.
|
||||||
|
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf
|
||||||
|
#if __cplusplus > 199711L || \
|
||||||
|
(defined(_MSC_VER) && _MSC_VER >= 1800) || \
|
||||||
|
(defined(__GNUC__) && \
|
||||||
|
(__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ >= 40700))
|
||||||
|
#define HAS_CPP11_TEMPLATE_ALIAS_SUPPORT
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // CEF_INCLUDE_BASE_CEF_BUILD_H_
|
#endif // CEF_INCLUDE_BASE_CEF_BUILD_H_
|
||||||
|
@ -45,8 +45,7 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
// Structure defining the reference count implementation functions. All
|
// All ref-counted framework structures must include this structure first.
|
||||||
// framework structures must include the cef_base_t structure first.
|
|
||||||
///
|
///
|
||||||
typedef struct _cef_base_t {
|
typedef struct _cef_base_t {
|
||||||
///
|
///
|
||||||
@ -74,6 +73,23 @@ typedef struct _cef_base_t {
|
|||||||
} cef_base_t;
|
} cef_base_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
|
// 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|.
|
// |base|, is large enough to contain the specified member |f|.
|
||||||
#define CEF_MEMBER_EXISTS(s, f) \
|
#define CEF_MEMBER_EXISTS(s, f) \
|
||||||
|
@ -58,7 +58,7 @@ typedef struct _cef_scheme_registrar_t {
|
|||||||
///
|
///
|
||||||
// Base structure.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_base_t base;
|
cef_base_scoped_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Register a custom scheme. This function should not be called for the built-
|
// Register a custom scheme. This function should not be called for the built-
|
||||||
|
@ -49,10 +49,14 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct _cef_translator_test_handler_child_t;
|
struct _cef_translator_test_ref_ptr_client_child_t;
|
||||||
struct _cef_translator_test_handler_t;
|
struct _cef_translator_test_ref_ptr_client_t;
|
||||||
struct _cef_translator_test_object_child_t;
|
struct _cef_translator_test_ref_ptr_library_child_t;
|
||||||
struct _cef_translator_test_object_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.
|
// 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);
|
struct _cef_translator_test_t* self);
|
||||||
|
|
||||||
|
|
||||||
// LIBRARY-SIDE OBJECT VALUES
|
// LIBRARY-SIDE REFPTR VALUES
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return an new library-side object.
|
// Return an new library-side object.
|
||||||
///
|
///
|
||||||
struct _cef_translator_test_object_t* (CEF_CALLBACK *get_object)(
|
struct _cef_translator_test_ref_ptr_library_t* (
|
||||||
struct _cef_translator_test_t* self, int val);
|
CEF_CALLBACK *get_ref_ptr_library)(struct _cef_translator_test_t* self,
|
||||||
|
int val);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set an object. Returns the value from
|
// Set an object. Returns the value from
|
||||||
// cef_translator_test_object_t::get_value(). This tests input and execution
|
// cef_translator_test_ref_ptr_library_t::get_value(). This tests input and
|
||||||
// of a library-side object type.
|
// execution of a library-side object type.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *set_object)(struct _cef_translator_test_t* self,
|
int (CEF_CALLBACK *set_ref_ptr_library)(struct _cef_translator_test_t* self,
|
||||||
struct _cef_translator_test_object_t* val);
|
struct _cef_translator_test_ref_ptr_library_t* val);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set an object. Returns the object passed in. This tests input and output of
|
// Set an object. Returns the object passed in. This tests input and output of
|
||||||
// a library-side object type.
|
// 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_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
|
// Set a child object. Returns the value from
|
||||||
// cef_translator_test_object_t::get_value(). This tests input of a library-
|
// cef_translator_test_ref_ptr_library_t::get_value(). This tests input of a
|
||||||
// side child object type and execution as the parent type.
|
// library- side child object type and execution as the parent type.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *set_child_object)(struct _cef_translator_test_t* self,
|
int (CEF_CALLBACK *set_child_ref_ptr_library)(
|
||||||
struct _cef_translator_test_object_child_t* val);
|
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
|
// 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.
|
// of a library-side child object type and return as the parent type.
|
||||||
///
|
///
|
||||||
struct _cef_translator_test_object_t* (
|
struct _cef_translator_test_ref_ptr_library_t* (
|
||||||
CEF_CALLBACK *set_child_object_and_return_parent)(
|
CEF_CALLBACK *set_child_ref_ptr_library_and_return_parent)(
|
||||||
struct _cef_translator_test_t* self,
|
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.
|
// Set an object list vlaue.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *set_object_list)(struct _cef_translator_test_t* self,
|
int (CEF_CALLBACK *set_ref_ptr_library_list)(
|
||||||
size_t valCount, struct _cef_translator_test_object_t* const* val,
|
struct _cef_translator_test_t* self, size_t valCount,
|
||||||
int val1, int val2);
|
struct _cef_translator_test_ref_ptr_library_t* const* val, int val1,
|
||||||
|
int val2);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return an object list value by out-param.
|
// 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_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.
|
// 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);
|
struct _cef_translator_test_t* self);
|
||||||
|
|
||||||
|
|
||||||
// CLIENT-SIDE OBJECT VALUES
|
// CLIENT-SIDE REFPTR VALUES
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set an object. Returns the value from
|
// Set an object. Returns the value from
|
||||||
// cef_translator_test_handler_t::get_value(). This tests input and execution
|
// cef_translator_test_ref_ptr_client_t::get_value(). This tests input and
|
||||||
// of a client-side object type.
|
// execution of a client-side object type.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *set_handler)(struct _cef_translator_test_t* self,
|
int (CEF_CALLBACK *set_ref_ptr_client)(struct _cef_translator_test_t* self,
|
||||||
struct _cef_translator_test_handler_t* val);
|
struct _cef_translator_test_ref_ptr_client_t* val);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set an object. Returns the handler passed in. This tests input and output
|
// Set an object. Returns the handler passed in. This tests input and output
|
||||||
// of a client-side object type.
|
// 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_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
|
// Set a child object. Returns the value from
|
||||||
// cef_translator_test_handler_t::get_value(). This tests input of a client-
|
// cef_translator_test_ref_ptr_client_t::get_value(). This tests input of a
|
||||||
// side child object type and execution as the parent type.
|
// client- side child object type and execution as the parent type.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *set_child_handler)(struct _cef_translator_test_t* self,
|
int (CEF_CALLBACK *set_child_ref_ptr_client)(
|
||||||
struct _cef_translator_test_handler_child_t* val);
|
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
|
// 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.
|
// of a client-side child object type and return as the parent type.
|
||||||
///
|
///
|
||||||
struct _cef_translator_test_handler_t* (
|
struct _cef_translator_test_ref_ptr_client_t* (
|
||||||
CEF_CALLBACK *set_child_handler_and_return_parent)(
|
CEF_CALLBACK *set_child_ref_ptr_client_and_return_parent)(
|
||||||
struct _cef_translator_test_t* self,
|
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.
|
// Set an object list vlaue.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *set_handler_list)(struct _cef_translator_test_t* self,
|
int (CEF_CALLBACK *set_ref_ptr_client_list)(
|
||||||
size_t valCount, struct _cef_translator_test_handler_t* const* val,
|
struct _cef_translator_test_t* self, size_t valCount,
|
||||||
int val1, int val2);
|
struct _cef_translator_test_ref_ptr_client_t* const* val, int val1,
|
||||||
|
int val2);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return an object list value by out-param.
|
// 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_t* self, size_t* valCount,
|
||||||
struct _cef_translator_test_handler_t** val,
|
struct _cef_translator_test_ref_ptr_client_t** val,
|
||||||
struct _cef_translator_test_handler_t* val1,
|
struct _cef_translator_test_ref_ptr_client_t* val1,
|
||||||
struct _cef_translator_test_handler_t* val2);
|
struct _cef_translator_test_ref_ptr_client_t* val2);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return the number of object that will be output above.
|
// 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);
|
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;
|
} 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.
|
// Base structure.
|
||||||
///
|
///
|
||||||
@ -381,87 +532,89 @@ typedef struct _cef_translator_test_object_t {
|
|||||||
///
|
///
|
||||||
// Return a value.
|
// 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.
|
// Set a value.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_value)(struct _cef_translator_test_object_t* self,
|
void (CEF_CALLBACK *set_value)(
|
||||||
int value);
|
struct _cef_translator_test_ref_ptr_library_t* self, int value);
|
||||||
} cef_translator_test_object_t;
|
} cef_translator_test_ref_ptr_library_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Create the test object.
|
// 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);
|
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.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_translator_test_object_t base;
|
cef_translator_test_ref_ptr_library_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return a value.
|
// Return a value.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_other_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.
|
// Set a value.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_other_value)(
|
void (CEF_CALLBACK *set_other_value)(
|
||||||
struct _cef_translator_test_object_child_t* self, int value);
|
struct _cef_translator_test_ref_ptr_library_child_t* self, int value);
|
||||||
} cef_translator_test_object_child_t;
|
} cef_translator_test_ref_ptr_library_child_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Create the test object.
|
// 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);
|
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.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_translator_test_object_child_t base;
|
cef_translator_test_ref_ptr_library_child_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return a value.
|
// Return a value.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_other_other_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.
|
// Set a value.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *set_other_other_value)(
|
void (CEF_CALLBACK *set_other_other_value)(
|
||||||
struct _cef_translator_test_object_child_child_t* self, int value);
|
struct _cef_translator_test_ref_ptr_library_child_child_t* self,
|
||||||
} cef_translator_test_object_child_child_t;
|
int value);
|
||||||
|
} cef_translator_test_ref_ptr_library_child_child_t;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Create the test object.
|
// 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);
|
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.
|
// Base structure.
|
||||||
///
|
///
|
||||||
@ -470,25 +623,151 @@ typedef struct _cef_translator_test_handler_t {
|
|||||||
///
|
///
|
||||||
// Return a value.
|
// Return a value.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_value)(struct _cef_translator_test_handler_t* self);
|
int (CEF_CALLBACK *get_value)(
|
||||||
} cef_translator_test_handler_t;
|
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.
|
// Base structure.
|
||||||
///
|
///
|
||||||
cef_translator_test_handler_t base;
|
cef_translator_test_ref_ptr_client_t base;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return a value.
|
// Return a value.
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *get_other_value)(
|
int (CEF_CALLBACK *get_other_value)(
|
||||||
struct _cef_translator_test_handler_child_t* self);
|
struct _cef_translator_test_ref_ptr_client_child_t* self);
|
||||||
} cef_translator_test_handler_child_t;
|
} 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
|
#ifdef __cplusplus
|
||||||
|
@ -170,7 +170,7 @@ class CefApp : public virtual CefBase {
|
|||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
virtual void OnRegisterCustomSchemes(
|
virtual void OnRegisterCustomSchemes(
|
||||||
CefRefPtr<CefSchemeRegistrar> registrar) {
|
CefRawPtr<CefSchemeRegistrar> registrar) {
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
|
@ -48,8 +48,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
// Interface defining the reference count implementation methods. All framework
|
// All ref-counted framework classes must extend this class.
|
||||||
// classes must extend the CefBase class.
|
|
||||||
///
|
///
|
||||||
class CefBase {
|
class CefBase {
|
||||||
public:
|
public:
|
||||||
@ -74,6 +73,14 @@ class CefBase {
|
|||||||
virtual ~CefBase() {}
|
virtual ~CefBase() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
///
|
||||||
|
// All scoped framework classes must extend this class.
|
||||||
|
///
|
||||||
|
class CefBaseScoped {
|
||||||
|
public:
|
||||||
|
virtual ~CefBaseScoped() {}
|
||||||
|
};
|
||||||
|
|
||||||
///
|
///
|
||||||
// Class that implements atomic reference counting.
|
// Class that implements atomic reference counting.
|
||||||
///
|
///
|
||||||
|
@ -82,7 +82,7 @@ bool CefClearSchemeHandlerFactories();
|
|||||||
// Class that manages custom scheme registrations.
|
// Class that manages custom scheme registrations.
|
||||||
///
|
///
|
||||||
/*--cef(source=library)--*/
|
/*--cef(source=library)--*/
|
||||||
class CefSchemeRegistrar : public virtual CefBase {
|
class CefSchemeRegistrar : public CefBaseScoped {
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
// Register a custom scheme. This method should not be called for the built-in
|
// Register a custom scheme. This method should not be called for the built-in
|
||||||
|
@ -32,8 +32,15 @@
|
|||||||
#define CEF_INCLUDE_INTERNAL_CEF_PTR_H_
|
#define CEF_INCLUDE_INTERNAL_CEF_PTR_H_
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "include/base/cef_build.h"
|
||||||
#include "include/base/cef_ref_counted.h"
|
#include "include/base/cef_ref_counted.h"
|
||||||
|
|
||||||
|
#if defined(USING_CHROMIUM_INCLUDES)
|
||||||
|
#include <memory> // For std::unique_ptr.
|
||||||
|
#else
|
||||||
|
#include "include/base/cef_scoped_ptr.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
// Smart pointer implementation that is an alias of scoped_refptr from
|
// Smart pointer implementation that is an alias of scoped_refptr from
|
||||||
// include/base/cef_ref_counted.h.
|
// include/base/cef_ref_counted.h.
|
||||||
@ -143,19 +150,83 @@
|
|||||||
// </pre>
|
// </pre>
|
||||||
// </p>
|
// </p>
|
||||||
///
|
///
|
||||||
|
#if defined(HAS_CPP11_TEMPLATE_ALIAS_SUPPORT)
|
||||||
template <class T>
|
template <class T>
|
||||||
class CefRefPtr : public scoped_refptr<T> {
|
using CefRefPtr = scoped_refptr<T>;
|
||||||
|
#else
|
||||||
|
// When template aliases are not supported use a define instead of subclassing
|
||||||
|
// because it's otherwise hard to get the constructors to behave correctly.
|
||||||
|
#define CefRefPtr scoped_refptr
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
// A CefOwnPtr<T> is like a T*, except that the destructor of CefOwnPtr<T>
|
||||||
|
// automatically deletes the pointer it holds (if any). That is, CefOwnPtr<T>
|
||||||
|
// owns the T object that it points to. Like a T*, a CefOwnPtr<T> may hold
|
||||||
|
// either NULL or a pointer to a T object. Also like T*, CefOwnPtr<T> is
|
||||||
|
// thread-compatible, and once you dereference it, you get the thread safety
|
||||||
|
// guarantees of T.
|
||||||
|
///
|
||||||
|
#if defined(USING_CHROMIUM_INCLUDES)
|
||||||
|
// Implementation-side code uses std::unique_ptr instead of scoped_ptr.
|
||||||
|
template <class T, class D = std::default_delete<T>>
|
||||||
|
using CefOwnPtr = std::unique_ptr<T, D>;
|
||||||
|
#elif defined(HAS_CPP11_TEMPLATE_ALIAS_SUPPORT)
|
||||||
|
template <class T, class D = base::DefaultDeleter<T>>
|
||||||
|
using CefOwnPtr = scoped_ptr<T, D>;
|
||||||
|
#else
|
||||||
|
// When template aliases are not supported use a define instead of subclassing
|
||||||
|
// because it's otherwise hard to get the constructors to behave correctly.
|
||||||
|
#define CefOwnPtr scoped_ptr
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
// A CefRawPtr<T> is the same as T*
|
||||||
|
///
|
||||||
|
#if defined(HAS_CPP11_TEMPLATE_ALIAS_SUPPORT)
|
||||||
|
template <class T>
|
||||||
|
using CefRawPtr = T*;
|
||||||
|
#else
|
||||||
|
// Simple wrapper implementation that behaves as much like T* as possible.
|
||||||
|
template <class T>
|
||||||
|
class CefRawPtr {
|
||||||
public:
|
public:
|
||||||
typedef scoped_refptr<T> parent;
|
CefRawPtr() : ptr_(nullptr) {}
|
||||||
|
CefRawPtr(T* p) : ptr_(p) {}
|
||||||
CefRefPtr() : parent() {}
|
CefRawPtr(const CefRawPtr& r) : ptr_(r.ptr_) {}
|
||||||
|
|
||||||
CefRefPtr(T* p) : parent(p) {}
|
|
||||||
|
|
||||||
CefRefPtr(const scoped_refptr<T>& r) : parent(r) {}
|
|
||||||
|
|
||||||
template <typename U>
|
template <typename U>
|
||||||
CefRefPtr(const scoped_refptr<U>& r) : parent(r) {}
|
CefRawPtr(const CefRawPtr<U>& r) : ptr_(r.get()) {}
|
||||||
|
|
||||||
|
T* get() const { return ptr_; }
|
||||||
|
|
||||||
|
// Allow CefRawPtr to be used in boolean expression and comparison operations.
|
||||||
|
operator T*() const { return ptr_; }
|
||||||
|
|
||||||
|
T* operator->() const {
|
||||||
|
assert(ptr_ != NULL);
|
||||||
|
return ptr_;
|
||||||
|
}
|
||||||
|
|
||||||
|
CefRawPtr<T>& operator=(T* p) {
|
||||||
|
ptr_ = p;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
CefRawPtr<T>& operator=(const CefRawPtr<T>& r) {
|
||||||
|
return *this = r.ptr_;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename U>
|
||||||
|
CefRawPtr<T>& operator=(const CefRawPtr<U>& r) {
|
||||||
|
return *this = r.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
T* ptr_;
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // CEF_INCLUDE_INTERNAL_CEF_PTR_H_
|
#endif // CEF_INCLUDE_INTERNAL_CEF_PTR_H_
|
||||||
|
@ -53,10 +53,14 @@
|
|||||||
|
|
||||||
#include "include/cef_base.h"
|
#include "include/cef_base.h"
|
||||||
|
|
||||||
class CefTranslatorTestHandler;
|
class CefTranslatorTestRefPtrClient;
|
||||||
class CefTranslatorTestHandlerChild;
|
class CefTranslatorTestRefPtrClientChild;
|
||||||
class CefTranslatorTestObject;
|
class CefTranslatorTestRefPtrLibrary;
|
||||||
class CefTranslatorTestObjectChild;
|
class CefTranslatorTestRefPtrLibraryChild;
|
||||||
|
class CefTranslatorTestScopedClient;
|
||||||
|
class CefTranslatorTestScopedClientChild;
|
||||||
|
class CefTranslatorTestScopedLibrary;
|
||||||
|
class CefTranslatorTestScopedLibraryChild;
|
||||||
|
|
||||||
// Test values.
|
// Test values.
|
||||||
#define TEST_INT_VAL 5
|
#define TEST_INT_VAL 5
|
||||||
@ -309,146 +313,311 @@ class CefTranslatorTest : public CefBase {
|
|||||||
virtual size_t GetPointListSize() = 0;
|
virtual size_t GetPointListSize() = 0;
|
||||||
|
|
||||||
|
|
||||||
// LIBRARY-SIDE OBJECT VALUES
|
// LIBRARY-SIDE REFPTR VALUES
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return an new library-side object.
|
// Return an new library-side object.
|
||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
virtual CefRefPtr<CefTranslatorTestObject> GetObject(int val) =0;
|
virtual CefRefPtr<CefTranslatorTestRefPtrLibrary> GetRefPtrLibrary(
|
||||||
|
int val) =0;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set an object. Returns the value from CefTranslatorTestObject::GetValue().
|
// Set an object. Returns the value from
|
||||||
|
// CefTranslatorTestRefPtrLibrary::GetValue().
|
||||||
// This tests input and execution of a library-side object type.
|
// This tests input and execution of a library-side object type.
|
||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
virtual int SetObject(CefRefPtr<CefTranslatorTestObject> val) =0;
|
virtual int SetRefPtrLibrary(
|
||||||
|
CefRefPtr<CefTranslatorTestRefPtrLibrary> val) =0;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set an object. Returns the object passed in. This tests input and output
|
// Set an object. Returns the object passed in. This tests input and output
|
||||||
// of a library-side object type.
|
// of a library-side object type.
|
||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
virtual CefRefPtr<CefTranslatorTestObject> SetObjectAndReturn(
|
virtual CefRefPtr<CefTranslatorTestRefPtrLibrary> SetRefPtrLibraryAndReturn(
|
||||||
CefRefPtr<CefTranslatorTestObject> val) =0;
|
CefRefPtr<CefTranslatorTestRefPtrLibrary> val) =0;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set a child object. Returns the value from
|
// Set a child object. Returns the value from
|
||||||
// CefTranslatorTestObject::GetValue(). This tests input of a library-side
|
// CefTranslatorTestRefPtrLibrary::GetValue(). This tests input of a library-
|
||||||
// child object type and execution as the parent type.
|
// side child object type and execution as the parent type.
|
||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
virtual int SetChildObject(CefRefPtr<CefTranslatorTestObjectChild> val) =0;
|
virtual int SetChildRefPtrLibrary(
|
||||||
|
CefRefPtr<CefTranslatorTestRefPtrLibraryChild> val) =0;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set a child object. Returns the object as the parent type. This tests input
|
// 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.
|
// of a library-side child object type and return as the parent type.
|
||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
virtual CefRefPtr<CefTranslatorTestObject> SetChildObjectAndReturnParent(
|
virtual CefRefPtr<CefTranslatorTestRefPtrLibrary>
|
||||||
CefRefPtr<CefTranslatorTestObjectChild> val) =0;
|
SetChildRefPtrLibraryAndReturnParent(
|
||||||
|
CefRefPtr<CefTranslatorTestRefPtrLibraryChild> val) =0;
|
||||||
|
|
||||||
|
|
||||||
// LIBRARY-SIDE OBJECT LIST VALUES
|
// LIBRARY-SIDE REFPTR LIST VALUES
|
||||||
|
|
||||||
// Test both with and without a typedef.
|
// Test both with and without a typedef.
|
||||||
typedef std::vector<CefRefPtr<CefTranslatorTestObject> > ObjectList;
|
typedef std::vector<CefRefPtr<CefTranslatorTestRefPtrLibrary> >
|
||||||
|
RefPtrLibraryList;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set an object list vlaue.
|
// Set an object list vlaue.
|
||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
virtual bool SetObjectList(
|
virtual bool SetRefPtrLibraryList(
|
||||||
const std::vector<CefRefPtr<CefTranslatorTestObject> >& val,
|
const std::vector<CefRefPtr<CefTranslatorTestRefPtrLibrary> >& val,
|
||||||
int val1, int val2) =0;
|
int val1, int val2) =0;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return an object list value by out-param.
|
// Return an object list value by out-param.
|
||||||
///
|
///
|
||||||
/*--cef(count_func=val:GetObjectListSize)--*/
|
/*--cef(count_func=val:GetRefPtrLibraryListSize)--*/
|
||||||
virtual bool GetObjectListByRef(ObjectList& val, int val1, int val2) =0;
|
virtual bool GetRefPtrLibraryListByRef(RefPtrLibraryList& val, int val1,
|
||||||
|
int val2) =0;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return the number of object that will be output above.
|
// Return the number of object that will be output above.
|
||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
virtual size_t GetObjectListSize() = 0;
|
virtual size_t GetRefPtrLibraryListSize() = 0;
|
||||||
|
|
||||||
|
|
||||||
// CLIENT-SIDE OBJECT VALUES
|
// CLIENT-SIDE REFPTR VALUES
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set an object. Returns the value from CefTranslatorTestHandler::GetValue().
|
// Set an object. Returns the value from
|
||||||
|
// CefTranslatorTestRefPtrClient::GetValue().
|
||||||
// This tests input and execution of a client-side object type.
|
// This tests input and execution of a client-side object type.
|
||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
virtual int SetHandler(CefRefPtr<CefTranslatorTestHandler> val) =0;
|
virtual int SetRefPtrClient(CefRefPtr<CefTranslatorTestRefPtrClient> val) =0;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set an object. Returns the handler passed in. This tests input and output
|
// Set an object. Returns the handler passed in. This tests input and output
|
||||||
// of a client-side object type.
|
// of a client-side object type.
|
||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
virtual CefRefPtr<CefTranslatorTestHandler> SetHandlerAndReturn(
|
virtual CefRefPtr<CefTranslatorTestRefPtrClient> SetRefPtrClientAndReturn(
|
||||||
CefRefPtr<CefTranslatorTestHandler> val) =0;
|
CefRefPtr<CefTranslatorTestRefPtrClient> val) =0;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set a child object. Returns the value from
|
// Set a child object. Returns the value from
|
||||||
// CefTranslatorTestHandler::GetValue(). This tests input of a client-side
|
// CefTranslatorTestRefPtrClient::GetValue(). This tests input of a client-
|
||||||
// child object type and execution as the parent type.
|
// side child object type and execution as the parent type.
|
||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
virtual int SetChildHandler(CefRefPtr<CefTranslatorTestHandlerChild> val) =0;
|
virtual int SetChildRefPtrClient(
|
||||||
|
CefRefPtr<CefTranslatorTestRefPtrClientChild> val) =0;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set a child object. Returns the object as the parent type. This tests
|
// 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.
|
// input of a client-side child object type and return as the parent type.
|
||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
virtual CefRefPtr<CefTranslatorTestHandler> SetChildHandlerAndReturnParent(
|
virtual CefRefPtr<CefTranslatorTestRefPtrClient>
|
||||||
CefRefPtr<CefTranslatorTestHandlerChild> val) =0;
|
SetChildRefPtrClientAndReturnParent(
|
||||||
|
CefRefPtr<CefTranslatorTestRefPtrClientChild> val) =0;
|
||||||
|
|
||||||
|
|
||||||
// CLIENT-SIDE OBJECT LIST VALUES
|
// CLIENT-SIDE REFPTR LIST VALUES
|
||||||
|
|
||||||
// Test both with and without a typedef.
|
// Test both with and without a typedef.
|
||||||
typedef std::vector<CefRefPtr<CefTranslatorTestHandler> > HandlerList;
|
typedef std::vector<CefRefPtr<CefTranslatorTestRefPtrClient> >
|
||||||
|
RefPtrClientList;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Set an object list vlaue.
|
// Set an object list vlaue.
|
||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
virtual bool SetHandlerList(
|
virtual bool SetRefPtrClientList(
|
||||||
const std::vector<CefRefPtr<CefTranslatorTestHandler> >& val,
|
const std::vector<CefRefPtr<CefTranslatorTestRefPtrClient> >& val,
|
||||||
int val1, int val2) =0;
|
int val1, int val2) =0;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return an object list value by out-param.
|
// Return an object list value by out-param.
|
||||||
///
|
///
|
||||||
/*--cef(count_func=val:GetObjectListSize)--*/
|
/*--cef(count_func=val:GetRefPtrLibraryListSize)--*/
|
||||||
virtual bool GetHandlerListByRef(
|
virtual bool GetRefPtrClientListByRef(
|
||||||
HandlerList& val,
|
RefPtrClientList& val,
|
||||||
CefRefPtr<CefTranslatorTestHandler> val1,
|
CefRefPtr<CefTranslatorTestRefPtrClient> val1,
|
||||||
CefRefPtr<CefTranslatorTestHandler> val2) =0;
|
CefRefPtr<CefTranslatorTestRefPtrClient> val2) =0;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return the number of object that will be output above.
|
// Return the number of object that will be output above.
|
||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
virtual size_t GetHandlerListSize() = 0;
|
virtual size_t GetRefPtrClientListSize() = 0;
|
||||||
|
|
||||||
|
|
||||||
|
// LIBRARY-SIDE OWNPTR VALUES
|
||||||
|
|
||||||
|
///
|
||||||
|
// Return an new library-side object.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual CefOwnPtr<CefTranslatorTestScopedLibrary> GetOwnPtrLibrary(
|
||||||
|
int val) =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Set an object. Returns the value from
|
||||||
|
// CefTranslatorTestScopedLibrary::GetValue().
|
||||||
|
// This tests input and execution of a library-side object type.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual int SetOwnPtrLibrary(
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibrary> val) =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Set an object. Returns the object passed in. This tests input and output
|
||||||
|
// of a library-side object type.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual CefOwnPtr<CefTranslatorTestScopedLibrary> SetOwnPtrLibraryAndReturn(
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibrary> val) =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Set a child object. Returns the value from
|
||||||
|
// CefTranslatorTestScopedLibrary::GetValue(). This tests input of a library-
|
||||||
|
// side child object type and execution as the parent type.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual int SetChildOwnPtrLibrary(
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibraryChild> val) =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// 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.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual CefOwnPtr<CefTranslatorTestScopedLibrary>
|
||||||
|
SetChildOwnPtrLibraryAndReturnParent(
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibraryChild> val) =0;
|
||||||
|
|
||||||
|
|
||||||
|
// CLIENT-SIDE OWNPTR VALUES
|
||||||
|
|
||||||
|
///
|
||||||
|
// Set an object. Returns the value from
|
||||||
|
// CefTranslatorTestScopedClient::GetValue().
|
||||||
|
// This tests input and execution of a client-side object type.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual int SetOwnPtrClient(CefOwnPtr<CefTranslatorTestScopedClient> val) =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Set an object. Returns the handler passed in. This tests input and output
|
||||||
|
// of a client-side object type.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual CefOwnPtr<CefTranslatorTestScopedClient> SetOwnPtrClientAndReturn(
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClient> val) =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Set a child object. Returns the value from
|
||||||
|
// CefTranslatorTestScopedClient::GetValue(). This tests input of a client-
|
||||||
|
// side child object type and execution as the parent type.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual int SetChildOwnPtrClient(
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClientChild> val) =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// 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.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual CefOwnPtr<CefTranslatorTestScopedClient>
|
||||||
|
SetChildOwnPtrClientAndReturnParent(
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClientChild> val) =0;
|
||||||
|
|
||||||
|
|
||||||
|
// LIBRARY-SIDE RAWPTR VALUES
|
||||||
|
|
||||||
|
///
|
||||||
|
// Set an object. Returns the value from
|
||||||
|
// CefTranslatorTestScopedLibrary::GetValue().
|
||||||
|
// This tests input and execution of a library-side object type.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual int SetRawPtrLibrary(
|
||||||
|
CefRawPtr<CefTranslatorTestScopedLibrary> val) =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Set a child object. Returns the value from
|
||||||
|
// CefTranslatorTestScopedLibrary::GetValue(). This tests input of a library-
|
||||||
|
// side child object type and execution as the parent type.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual int SetChildRawPtrLibrary(
|
||||||
|
CefRawPtr<CefTranslatorTestScopedLibraryChild> val) =0;
|
||||||
|
|
||||||
|
|
||||||
|
// LIBRARY-SIDE RAWPTR LIST VALUES
|
||||||
|
|
||||||
|
// Test both with and without a typedef.
|
||||||
|
typedef std::vector<CefRawPtr<CefTranslatorTestScopedLibrary> >
|
||||||
|
RawPtrLibraryList;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Set an object list vlaue.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual bool SetRawPtrLibraryList(
|
||||||
|
const std::vector<CefRawPtr<CefTranslatorTestScopedLibrary> >& val,
|
||||||
|
int val1, int val2) =0;
|
||||||
|
|
||||||
|
|
||||||
|
// CLIENT-SIDE RAWPTR VALUES
|
||||||
|
|
||||||
|
///
|
||||||
|
// Set an object. Returns the value from
|
||||||
|
// CefTranslatorTestScopedClient::GetValue().
|
||||||
|
// This tests input and execution of a client-side object type.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual int SetRawPtrClient(CefRawPtr<CefTranslatorTestScopedClient> val) =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Set a child object. Returns the value from
|
||||||
|
// CefTranslatorTestScopedClient::GetValue(). This tests input of a client-
|
||||||
|
// side child object type and execution as the parent type.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual int SetChildRawPtrClient(
|
||||||
|
CefRawPtr<CefTranslatorTestScopedClientChild> val) =0;
|
||||||
|
|
||||||
|
|
||||||
|
// CLIENT-SIDE RAWPTR LIST VALUES
|
||||||
|
|
||||||
|
// Test both with and without a typedef.
|
||||||
|
typedef std::vector<CefRawPtr<CefTranslatorTestScopedClient> >
|
||||||
|
RawPtrClientList;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Set an object list vlaue.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual bool SetRawPtrClientList(
|
||||||
|
const std::vector<CefRawPtr<CefTranslatorTestScopedClient> >& val,
|
||||||
|
int val1, int val2) =0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Library-side test object.
|
// Library-side test object for RefPtr.
|
||||||
///
|
///
|
||||||
/*--cef(source=library,no_debugct_check)--*/
|
/*--cef(source=library,no_debugct_check)--*/
|
||||||
class CefTranslatorTestObject : public CefBase {
|
class CefTranslatorTestRefPtrLibrary : public CefBase {
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
// Create the test object.
|
// Create the test object.
|
||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
static CefRefPtr<CefTranslatorTestObject> Create(int value);
|
static CefRefPtr<CefTranslatorTestRefPtrLibrary> Create(int value);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return a value.
|
// Return a value.
|
||||||
@ -464,17 +633,19 @@ class CefTranslatorTestObject : public CefBase {
|
|||||||
};
|
};
|
||||||
|
|
||||||
///
|
///
|
||||||
// Library-side child test object.
|
// Library-side child test object for RefPtr.
|
||||||
///
|
///
|
||||||
/*--cef(source=library,no_debugct_check)--*/
|
/*--cef(source=library,no_debugct_check)--*/
|
||||||
class CefTranslatorTestObjectChild : public CefTranslatorTestObject {
|
class CefTranslatorTestRefPtrLibraryChild :
|
||||||
|
public CefTranslatorTestRefPtrLibrary {
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
// Create the test object.
|
// Create the test object.
|
||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
static CefRefPtr<CefTranslatorTestObjectChild> Create(int value,
|
static CefRefPtr<CefTranslatorTestRefPtrLibraryChild> Create(
|
||||||
int other_value);
|
int value,
|
||||||
|
int other_value);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return a value.
|
// Return a value.
|
||||||
@ -490,16 +661,17 @@ class CefTranslatorTestObjectChild : public CefTranslatorTestObject {
|
|||||||
};
|
};
|
||||||
|
|
||||||
///
|
///
|
||||||
// Another library-side child test object.
|
// Another library-side child test object for RefPtr.
|
||||||
///
|
///
|
||||||
/*--cef(source=library,no_debugct_check)--*/
|
/*--cef(source=library,no_debugct_check)--*/
|
||||||
class CefTranslatorTestObjectChildChild : public CefTranslatorTestObjectChild {
|
class CefTranslatorTestRefPtrLibraryChildChild :
|
||||||
|
public CefTranslatorTestRefPtrLibraryChild {
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
// Create the test object.
|
// Create the test object.
|
||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
static CefRefPtr<CefTranslatorTestObjectChildChild> Create(
|
static CefRefPtr<CefTranslatorTestRefPtrLibraryChildChild> Create(
|
||||||
int value,
|
int value,
|
||||||
int other_value,
|
int other_value,
|
||||||
int other_other_value);
|
int other_other_value);
|
||||||
@ -518,10 +690,10 @@ class CefTranslatorTestObjectChildChild : public CefTranslatorTestObjectChild {
|
|||||||
};
|
};
|
||||||
|
|
||||||
///
|
///
|
||||||
// Client-side test object.
|
// Client-side test object for RefPtr.
|
||||||
///
|
///
|
||||||
/*--cef(source=client,no_debugct_check)--*/
|
/*--cef(source=client,no_debugct_check)--*/
|
||||||
class CefTranslatorTestHandler : public virtual CefBase {
|
class CefTranslatorTestRefPtrClient : public virtual CefBase {
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
// Return a value.
|
// Return a value.
|
||||||
@ -531,10 +703,121 @@ class CefTranslatorTestHandler : public virtual CefBase {
|
|||||||
};
|
};
|
||||||
|
|
||||||
///
|
///
|
||||||
// Client-side child test object.
|
// Client-side child test object for RefPtr.
|
||||||
///
|
///
|
||||||
/*--cef(source=client,no_debugct_check)--*/
|
/*--cef(source=client,no_debugct_check)--*/
|
||||||
class CefTranslatorTestHandlerChild : public CefTranslatorTestHandler {
|
class CefTranslatorTestRefPtrClientChild :
|
||||||
|
public CefTranslatorTestRefPtrClient {
|
||||||
|
public:
|
||||||
|
///
|
||||||
|
// Return a value.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual int GetOtherValue() =0;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
// Library-side test object for OwnPtr/RawPtr.
|
||||||
|
///
|
||||||
|
/*--cef(source=library,no_debugct_check)--*/
|
||||||
|
class CefTranslatorTestScopedLibrary : public CefBaseScoped {
|
||||||
|
public:
|
||||||
|
///
|
||||||
|
// Create the test object.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
static CefOwnPtr<CefTranslatorTestScopedLibrary> Create(int value);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Return a value.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual int GetValue() =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Set a value.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual void SetValue(int value) =0;
|
||||||
|
};
|
||||||
|
|
||||||
|
///
|
||||||
|
// Library-side child test object for OwnPtr/RawPtr.
|
||||||
|
///
|
||||||
|
/*--cef(source=library,no_debugct_check)--*/
|
||||||
|
class CefTranslatorTestScopedLibraryChild :
|
||||||
|
public CefTranslatorTestScopedLibrary {
|
||||||
|
public:
|
||||||
|
///
|
||||||
|
// Create the test object.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
static CefOwnPtr<CefTranslatorTestScopedLibraryChild> Create(
|
||||||
|
int value,
|
||||||
|
int other_value);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Return a value.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual int GetOtherValue() =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Set a value.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual void SetOtherValue(int value) =0;
|
||||||
|
};
|
||||||
|
|
||||||
|
///
|
||||||
|
// Another library-side child test object for OwnPtr/RawPtr.
|
||||||
|
///
|
||||||
|
/*--cef(source=library,no_debugct_check)--*/
|
||||||
|
class CefTranslatorTestScopedLibraryChildChild :
|
||||||
|
public CefTranslatorTestScopedLibraryChild {
|
||||||
|
public:
|
||||||
|
///
|
||||||
|
// Create the test object.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
static CefOwnPtr<CefTranslatorTestScopedLibraryChildChild> Create(
|
||||||
|
int value,
|
||||||
|
int other_value,
|
||||||
|
int other_other_value);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Return a value.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual int GetOtherOtherValue() =0;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Set a value.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual void SetOtherOtherValue(int value) =0;
|
||||||
|
};
|
||||||
|
|
||||||
|
///
|
||||||
|
// Client-side test object for OwnPtr/RawPtr.
|
||||||
|
///
|
||||||
|
/*--cef(source=client,no_debugct_check)--*/
|
||||||
|
class CefTranslatorTestScopedClient : public virtual CefBaseScoped {
|
||||||
|
public:
|
||||||
|
///
|
||||||
|
// Return a value.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual int GetValue() =0;
|
||||||
|
};
|
||||||
|
|
||||||
|
///
|
||||||
|
// Client-side child test object for OwnPtr/RawPtr.
|
||||||
|
///
|
||||||
|
/*--cef(source=client,no_debugct_check)--*/
|
||||||
|
class CefTranslatorTestScopedClientChild :
|
||||||
|
public CefTranslatorTestScopedClient {
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
// Return a value.
|
// Return a value.
|
||||||
|
@ -220,14 +220,9 @@ void CefContentClient::AddAdditionalSchemes(Schemes* schemes) {
|
|||||||
DCHECK(!scheme_info_list_locked_);
|
DCHECK(!scheme_info_list_locked_);
|
||||||
|
|
||||||
if (application_.get()) {
|
if (application_.get()) {
|
||||||
CefRefPtr<CefSchemeRegistrarImpl> schemeRegistrar(
|
CefSchemeRegistrarImpl schemeRegistrar;
|
||||||
new CefSchemeRegistrarImpl());
|
application_->OnRegisterCustomSchemes(&schemeRegistrar);
|
||||||
application_->OnRegisterCustomSchemes(schemeRegistrar.get());
|
schemeRegistrar.GetSchemes(schemes);
|
||||||
schemeRegistrar->GetSchemes(schemes);
|
|
||||||
|
|
||||||
// No references to the registar should be kept.
|
|
||||||
schemeRegistrar->Detach();
|
|
||||||
DCHECK(schemeRegistrar->VerifyRefCount());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
scheme::AddInternalSchemes(schemes);
|
scheme::AddInternalSchemes(schemes);
|
||||||
|
@ -24,8 +24,7 @@ void AppendArray(const std::vector<std::string>& source,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CefSchemeRegistrarImpl::CefSchemeRegistrarImpl()
|
CefSchemeRegistrarImpl::CefSchemeRegistrarImpl() {
|
||||||
: supported_thread_id_(base::PlatformThread::CurrentId()) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CefSchemeRegistrarImpl::AddCustomScheme(
|
bool CefSchemeRegistrarImpl::AddCustomScheme(
|
||||||
@ -35,9 +34,6 @@ bool CefSchemeRegistrarImpl::AddCustomScheme(
|
|||||||
bool is_display_isolated,
|
bool is_display_isolated,
|
||||||
bool is_secure,
|
bool is_secure,
|
||||||
bool is_cors_enabled) {
|
bool is_cors_enabled) {
|
||||||
if (!VerifyContext())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
const std::string& scheme = base::ToLowerASCII(scheme_name.ToString());
|
const std::string& scheme = base::ToLowerASCII(scheme_name.ToString());
|
||||||
if (scheme::IsInternalHandledScheme(scheme) ||
|
if (scheme::IsInternalHandledScheme(scheme) ||
|
||||||
registered_schemes_.find(scheme) != registered_schemes_.end()) {
|
registered_schemes_.find(scheme) != registered_schemes_.end()) {
|
||||||
@ -68,30 +64,8 @@ bool CefSchemeRegistrarImpl::AddCustomScheme(
|
|||||||
|
|
||||||
void CefSchemeRegistrarImpl::GetSchemes(
|
void CefSchemeRegistrarImpl::GetSchemes(
|
||||||
content::ContentClient::Schemes* schemes) {
|
content::ContentClient::Schemes* schemes) {
|
||||||
if (!VerifyContext())
|
|
||||||
return;
|
|
||||||
|
|
||||||
AppendArray(schemes_.standard_schemes, &schemes->standard_schemes);
|
AppendArray(schemes_.standard_schemes, &schemes->standard_schemes);
|
||||||
AppendArray(schemes_.local_schemes, &schemes->local_schemes);
|
AppendArray(schemes_.local_schemes, &schemes->local_schemes);
|
||||||
AppendArray(schemes_.secure_schemes, &schemes->secure_schemes);
|
AppendArray(schemes_.secure_schemes, &schemes->secure_schemes);
|
||||||
AppendArray(schemes_.cors_enabled_schemes, &schemes->cors_enabled_schemes);
|
AppendArray(schemes_.cors_enabled_schemes, &schemes->cors_enabled_schemes);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CefSchemeRegistrarImpl::VerifyRefCount() {
|
|
||||||
return HasOneRef();
|
|
||||||
}
|
|
||||||
|
|
||||||
void CefSchemeRegistrarImpl::Detach() {
|
|
||||||
if (VerifyContext())
|
|
||||||
supported_thread_id_ = base::kInvalidThreadId;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CefSchemeRegistrarImpl::VerifyContext() {
|
|
||||||
if (base::PlatformThread::CurrentId() != supported_thread_id_) {
|
|
||||||
// This object should only be accessed from the thread that created it.
|
|
||||||
NOTREACHED();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
#include "include/cef_scheme.h"
|
#include "include/cef_scheme.h"
|
||||||
|
|
||||||
#include "base/threading/platform_thread.h"
|
|
||||||
#include "content/public/common/content_client.h"
|
#include "content/public/common/content_client.h"
|
||||||
|
|
||||||
class CefSchemeRegistrarImpl : public CefSchemeRegistrar {
|
class CefSchemeRegistrarImpl : public CefSchemeRegistrar {
|
||||||
@ -28,22 +27,13 @@ class CefSchemeRegistrarImpl : public CefSchemeRegistrar {
|
|||||||
|
|
||||||
void GetSchemes(content::ContentClient::Schemes* schemes);
|
void GetSchemes(content::ContentClient::Schemes* schemes);
|
||||||
|
|
||||||
// Verify that only a single reference exists to all CefSchemeRegistrarImpl
|
|
||||||
// objects.
|
|
||||||
bool VerifyRefCount();
|
|
||||||
|
|
||||||
void Detach();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Verify that the object is being accessed from the correct thread.
|
// Verify that the object is being accessed from the correct thread.
|
||||||
bool VerifyContext();
|
bool VerifyContext();
|
||||||
|
|
||||||
base::PlatformThreadId supported_thread_id_;
|
|
||||||
|
|
||||||
content::ContentClient::Schemes schemes_;
|
content::ContentClient::Schemes schemes_;
|
||||||
std::set<std::string> registered_schemes_;
|
std::set<std::string> registered_schemes_;
|
||||||
|
|
||||||
IMPLEMENT_REFCOUNTING(CefSchemeRegistrarImpl);
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(CefSchemeRegistrarImpl);
|
DISALLOW_COPY_AND_ASSIGN(CefSchemeRegistrarImpl);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -4,9 +4,10 @@
|
|||||||
|
|
||||||
#include "include/test/cef_translator_test.h"
|
#include "include/test/cef_translator_test.h"
|
||||||
|
|
||||||
class CefTranslatorTestObjectImpl : public CefTranslatorTestObject {
|
class CefTranslatorTestRefPtrLibraryImpl :
|
||||||
|
public CefTranslatorTestRefPtrLibrary {
|
||||||
public:
|
public:
|
||||||
explicit CefTranslatorTestObjectImpl(int value)
|
explicit CefTranslatorTestRefPtrLibraryImpl(int value)
|
||||||
: value_(value) {
|
: value_(value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -22,18 +23,20 @@ class CefTranslatorTestObjectImpl : public CefTranslatorTestObject {
|
|||||||
int value_;
|
int value_;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DISALLOW_COPY_AND_ASSIGN(CefTranslatorTestObjectImpl);
|
DISALLOW_COPY_AND_ASSIGN(CefTranslatorTestRefPtrLibraryImpl);
|
||||||
IMPLEMENT_REFCOUNTING(CefTranslatorTestObjectImpl);
|
IMPLEMENT_REFCOUNTING(CefTranslatorTestRefPtrLibraryImpl);
|
||||||
};
|
};
|
||||||
|
|
||||||
// static
|
// static
|
||||||
CefRefPtr<CefTranslatorTestObject> CefTranslatorTestObject::Create(int value) {
|
CefRefPtr<CefTranslatorTestRefPtrLibrary>
|
||||||
return new CefTranslatorTestObjectImpl(value);
|
CefTranslatorTestRefPtrLibrary::Create(int value) {
|
||||||
|
return new CefTranslatorTestRefPtrLibraryImpl(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
class CefTranslatorTestObjectChildImpl : public CefTranslatorTestObjectChild {
|
class CefTranslatorTestRefPtrLibraryChildImpl :
|
||||||
|
public CefTranslatorTestRefPtrLibraryChild {
|
||||||
public:
|
public:
|
||||||
CefTranslatorTestObjectChildImpl(int value, int other_value)
|
CefTranslatorTestRefPtrLibraryChildImpl(int value, int other_value)
|
||||||
: value_(value),
|
: value_(value),
|
||||||
other_value_(other_value) {
|
other_value_(other_value) {
|
||||||
}
|
}
|
||||||
@ -59,21 +62,22 @@ class CefTranslatorTestObjectChildImpl : public CefTranslatorTestObjectChild {
|
|||||||
int other_value_;
|
int other_value_;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DISALLOW_COPY_AND_ASSIGN(CefTranslatorTestObjectChildImpl);
|
DISALLOW_COPY_AND_ASSIGN(CefTranslatorTestRefPtrLibraryChildImpl);
|
||||||
IMPLEMENT_REFCOUNTING(CefTranslatorTestObjectChildImpl);
|
IMPLEMENT_REFCOUNTING(CefTranslatorTestRefPtrLibraryChildImpl);
|
||||||
};
|
};
|
||||||
|
|
||||||
// static
|
// static
|
||||||
CefRefPtr<CefTranslatorTestObjectChild> CefTranslatorTestObjectChild::Create(
|
CefRefPtr<CefTranslatorTestRefPtrLibraryChild>
|
||||||
|
CefTranslatorTestRefPtrLibraryChild::Create(
|
||||||
int value,
|
int value,
|
||||||
int other_value) {
|
int other_value) {
|
||||||
return new CefTranslatorTestObjectChildImpl(value, other_value);
|
return new CefTranslatorTestRefPtrLibraryChildImpl(value, other_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
class CefTranslatorTestObjectChildChildImpl :
|
class CefTranslatorTestRefPtrLibraryChildChildImpl :
|
||||||
public CefTranslatorTestObjectChildChild {
|
public CefTranslatorTestRefPtrLibraryChildChild {
|
||||||
public:
|
public:
|
||||||
CefTranslatorTestObjectChildChildImpl(int value,
|
CefTranslatorTestRefPtrLibraryChildChildImpl(int value,
|
||||||
int other_value,
|
int other_value,
|
||||||
int other_other_value)
|
int other_other_value)
|
||||||
: value_(value),
|
: value_(value),
|
||||||
@ -111,20 +115,147 @@ class CefTranslatorTestObjectChildChildImpl :
|
|||||||
int other_other_value_;
|
int other_other_value_;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DISALLOW_COPY_AND_ASSIGN(CefTranslatorTestObjectChildChildImpl);
|
DISALLOW_COPY_AND_ASSIGN(CefTranslatorTestRefPtrLibraryChildChildImpl);
|
||||||
IMPLEMENT_REFCOUNTING(CefTranslatorTestObjectChildChildImpl);
|
IMPLEMENT_REFCOUNTING(CefTranslatorTestRefPtrLibraryChildChildImpl);
|
||||||
};
|
};
|
||||||
|
|
||||||
// static
|
// static
|
||||||
CefRefPtr<CefTranslatorTestObjectChildChild>
|
CefRefPtr<CefTranslatorTestRefPtrLibraryChildChild>
|
||||||
CefTranslatorTestObjectChildChild::Create(
|
CefTranslatorTestRefPtrLibraryChildChild::Create(
|
||||||
int value,
|
int value,
|
||||||
int other_value,
|
int other_value,
|
||||||
int other_other_value) {
|
int other_other_value) {
|
||||||
return new CefTranslatorTestObjectChildChildImpl(value, other_value,
|
return new CefTranslatorTestRefPtrLibraryChildChildImpl(value, other_value,
|
||||||
other_other_value);
|
other_other_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class CefTranslatorTestScopedLibraryImpl :
|
||||||
|
public CefTranslatorTestScopedLibrary {
|
||||||
|
public:
|
||||||
|
explicit CefTranslatorTestScopedLibraryImpl(int value)
|
||||||
|
: value_(value) {
|
||||||
|
}
|
||||||
|
|
||||||
|
int GetValue() override {
|
||||||
|
return value_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetValue(int value) override {
|
||||||
|
value_ = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
int value_;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DISALLOW_COPY_AND_ASSIGN(CefTranslatorTestScopedLibraryImpl);
|
||||||
|
};
|
||||||
|
|
||||||
|
// static
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibrary>
|
||||||
|
CefTranslatorTestScopedLibrary::Create(int value) {
|
||||||
|
return CefOwnPtr<CefTranslatorTestScopedLibrary>(
|
||||||
|
new CefTranslatorTestScopedLibraryImpl(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
class CefTranslatorTestScopedLibraryChildImpl :
|
||||||
|
public CefTranslatorTestScopedLibraryChild {
|
||||||
|
public:
|
||||||
|
CefTranslatorTestScopedLibraryChildImpl(int value, int other_value)
|
||||||
|
: value_(value),
|
||||||
|
other_value_(other_value) {
|
||||||
|
}
|
||||||
|
|
||||||
|
int GetValue() override {
|
||||||
|
return value_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetValue(int value) override {
|
||||||
|
value_ = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
int GetOtherValue() override {
|
||||||
|
return other_value_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetOtherValue(int value) override {
|
||||||
|
other_value_ = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
int value_;
|
||||||
|
int other_value_;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DISALLOW_COPY_AND_ASSIGN(CefTranslatorTestScopedLibraryChildImpl);
|
||||||
|
};
|
||||||
|
|
||||||
|
// static
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibraryChild>
|
||||||
|
CefTranslatorTestScopedLibraryChild::Create(
|
||||||
|
int value,
|
||||||
|
int other_value) {
|
||||||
|
return CefOwnPtr<CefTranslatorTestScopedLibraryChild>(
|
||||||
|
new CefTranslatorTestScopedLibraryChildImpl(value, other_value));
|
||||||
|
}
|
||||||
|
|
||||||
|
class CefTranslatorTestScopedLibraryChildChildImpl :
|
||||||
|
public CefTranslatorTestScopedLibraryChildChild {
|
||||||
|
public:
|
||||||
|
CefTranslatorTestScopedLibraryChildChildImpl(int value,
|
||||||
|
int other_value,
|
||||||
|
int other_other_value)
|
||||||
|
: value_(value),
|
||||||
|
other_value_(other_value),
|
||||||
|
other_other_value_(other_other_value) {
|
||||||
|
}
|
||||||
|
|
||||||
|
int GetValue() override {
|
||||||
|
return value_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetValue(int value) override {
|
||||||
|
value_ = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
int GetOtherValue() override {
|
||||||
|
return other_value_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetOtherValue(int value) override {
|
||||||
|
other_value_ = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
int GetOtherOtherValue() override {
|
||||||
|
return other_other_value_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetOtherOtherValue(int value) override {
|
||||||
|
other_other_value_ = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
int value_;
|
||||||
|
int other_value_;
|
||||||
|
int other_other_value_;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DISALLOW_COPY_AND_ASSIGN(CefTranslatorTestScopedLibraryChildChildImpl);
|
||||||
|
};
|
||||||
|
|
||||||
|
// static
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibraryChildChild>
|
||||||
|
CefTranslatorTestScopedLibraryChildChild::Create(
|
||||||
|
int value,
|
||||||
|
int other_value,
|
||||||
|
int other_other_value) {
|
||||||
|
return CefOwnPtr<CefTranslatorTestScopedLibraryChildChild>(
|
||||||
|
new CefTranslatorTestScopedLibraryChildChildImpl(value, other_value,
|
||||||
|
other_other_value));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class CefTranslatorTestImpl : public CefTranslatorTest {
|
class CefTranslatorTestImpl : public CefTranslatorTest {
|
||||||
public:
|
public:
|
||||||
CefTranslatorTestImpl() {
|
CefTranslatorTestImpl() {
|
||||||
@ -338,91 +469,95 @@ class CefTranslatorTestImpl : public CefTranslatorTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// LIBRARY-SIDE OBJECT VALUES
|
// LIBRARY-SIDE REFPTR VALUES
|
||||||
|
|
||||||
CefRefPtr<CefTranslatorTestObject> GetObject(int val) override {
|
CefRefPtr<CefTranslatorTestRefPtrLibrary> GetRefPtrLibrary(int val) override {
|
||||||
return new CefTranslatorTestObjectChildImpl(val, 0);
|
return new CefTranslatorTestRefPtrLibraryChildImpl(val, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int SetObject(CefRefPtr<CefTranslatorTestObject> val) override {
|
int SetRefPtrLibrary(CefRefPtr<CefTranslatorTestRefPtrLibrary> val) override {
|
||||||
return val->GetValue();
|
return val->GetValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
CefRefPtr<CefTranslatorTestObject> SetObjectAndReturn(
|
CefRefPtr<CefTranslatorTestRefPtrLibrary> SetRefPtrLibraryAndReturn(
|
||||||
CefRefPtr<CefTranslatorTestObject> val) override {
|
CefRefPtr<CefTranslatorTestRefPtrLibrary> val) override {
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
int SetChildObject(CefRefPtr<CefTranslatorTestObjectChild> val) override {
|
int SetChildRefPtrLibrary(
|
||||||
|
CefRefPtr<CefTranslatorTestRefPtrLibraryChild> val) override {
|
||||||
return val->GetValue();
|
return val->GetValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
CefRefPtr<CefTranslatorTestObject> SetChildObjectAndReturnParent(
|
CefRefPtr<CefTranslatorTestRefPtrLibrary>
|
||||||
CefRefPtr<CefTranslatorTestObjectChild> val) override {
|
SetChildRefPtrLibraryAndReturnParent(
|
||||||
|
CefRefPtr<CefTranslatorTestRefPtrLibraryChild> val) override {
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// LIBRARY-SIDE OBJECT LIST VALUES
|
// LIBRARY-SIDE REFPTR LIST VALUES
|
||||||
|
|
||||||
bool SetObjectList(
|
bool SetRefPtrLibraryList(
|
||||||
const std::vector<CefRefPtr<CefTranslatorTestObject> >& val,
|
const std::vector<CefRefPtr<CefTranslatorTestRefPtrLibrary> >& val,
|
||||||
int val1, int val2) override {
|
int val1, int val2) override {
|
||||||
if (val.size() != 2U)
|
if (val.size() != 2U)
|
||||||
return false;
|
return false;
|
||||||
return val[0]->GetValue() == val1 && val[1]->GetValue() == val2;
|
return val[0]->GetValue() == val1 && val[1]->GetValue() == val2;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GetObjectListByRef(ObjectList& val, int val1, int val2) override {
|
bool GetRefPtrLibraryListByRef(RefPtrLibraryList& val, int val1,
|
||||||
if (val.size() != GetObjectListSize())
|
int val2) override {
|
||||||
|
if (val.size() != GetRefPtrLibraryListSize())
|
||||||
return false;
|
return false;
|
||||||
val.clear();
|
val.clear();
|
||||||
val.push_back(new CefTranslatorTestObjectChildImpl(val1, 0));
|
val.push_back(new CefTranslatorTestRefPtrLibraryChildImpl(val1, 0));
|
||||||
val.push_back(new CefTranslatorTestObjectImpl(val2));
|
val.push_back(new CefTranslatorTestRefPtrLibraryImpl(val2));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t GetObjectListSize() override {
|
size_t GetRefPtrLibraryListSize() override {
|
||||||
return 2U;
|
return 2U;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// CLIENT-SIDE OBJECT VALUES
|
// CLIENT-SIDE REFPTR VALUES
|
||||||
|
|
||||||
int SetHandler(CefRefPtr<CefTranslatorTestHandler> val) override {
|
int SetRefPtrClient(CefRefPtr<CefTranslatorTestRefPtrClient> val) override {
|
||||||
return val->GetValue();
|
return val->GetValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
CefRefPtr<CefTranslatorTestHandler> SetHandlerAndReturn(
|
CefRefPtr<CefTranslatorTestRefPtrClient> SetRefPtrClientAndReturn(
|
||||||
CefRefPtr<CefTranslatorTestHandler> val) override {
|
CefRefPtr<CefTranslatorTestRefPtrClient> val) override {
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
int SetChildHandler(CefRefPtr<CefTranslatorTestHandlerChild> val) override {
|
int SetChildRefPtrClient(
|
||||||
|
CefRefPtr<CefTranslatorTestRefPtrClientChild> val) override {
|
||||||
return val->GetValue();
|
return val->GetValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
CefRefPtr<CefTranslatorTestHandler> SetChildHandlerAndReturnParent(
|
CefRefPtr<CefTranslatorTestRefPtrClient> SetChildRefPtrClientAndReturnParent(
|
||||||
CefRefPtr<CefTranslatorTestHandlerChild> val) override {
|
CefRefPtr<CefTranslatorTestRefPtrClientChild> val) override {
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// CLIENT-SIDE OBJECT LIST VALUES
|
// CLIENT-SIDE REFPTR LIST VALUES
|
||||||
|
|
||||||
bool SetHandlerList(
|
bool SetRefPtrClientList(
|
||||||
const std::vector<CefRefPtr<CefTranslatorTestHandler> >& val,
|
const std::vector<CefRefPtr<CefTranslatorTestRefPtrClient> >& val,
|
||||||
int val1, int val2) override {
|
int val1, int val2) override {
|
||||||
if (val.size() != 2U)
|
if (val.size() != 2U)
|
||||||
return false;
|
return false;
|
||||||
return val[0]->GetValue() == val1 && val[1]->GetValue() == val2;
|
return val[0]->GetValue() == val1 && val[1]->GetValue() == val2;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GetHandlerListByRef(
|
bool GetRefPtrClientListByRef(
|
||||||
HandlerList& val,
|
RefPtrClientList& val,
|
||||||
CefRefPtr<CefTranslatorTestHandler> val1,
|
CefRefPtr<CefTranslatorTestRefPtrClient> val1,
|
||||||
CefRefPtr<CefTranslatorTestHandler> val2) override {
|
CefRefPtr<CefTranslatorTestRefPtrClient> val2) override {
|
||||||
if (val.size() != GetHandlerListSize())
|
if (val.size() != GetRefPtrClientListSize())
|
||||||
return false;
|
return false;
|
||||||
val.clear();
|
val.clear();
|
||||||
val.push_back(val1);
|
val.push_back(val1);
|
||||||
@ -430,10 +565,106 @@ class CefTranslatorTestImpl : public CefTranslatorTest {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t GetHandlerListSize() override {
|
size_t GetRefPtrClientListSize() override {
|
||||||
return 2U;
|
return 2U;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// LIBRARY-SIDE OWNPTR VALUES
|
||||||
|
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibrary> GetOwnPtrLibrary(int val) override {
|
||||||
|
return CefOwnPtr<CefTranslatorTestScopedLibrary>(
|
||||||
|
new CefTranslatorTestScopedLibraryChildImpl(val, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
int SetOwnPtrLibrary(CefOwnPtr<CefTranslatorTestScopedLibrary> val) override {
|
||||||
|
return val->GetValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibrary> SetOwnPtrLibraryAndReturn(
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibrary> val) override {
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
int SetChildOwnPtrLibrary(
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibraryChild> val) override {
|
||||||
|
return val->GetValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibrary>
|
||||||
|
SetChildOwnPtrLibraryAndReturnParent(
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibraryChild> val) override {
|
||||||
|
return CefOwnPtr<CefTranslatorTestScopedLibrary>(val.release());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// CLIENT-SIDE OWNPTR VALUES
|
||||||
|
|
||||||
|
int SetOwnPtrClient(CefOwnPtr<CefTranslatorTestScopedClient> val) override {
|
||||||
|
return val->GetValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClient> SetOwnPtrClientAndReturn(
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClient> val) override {
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
int SetChildOwnPtrClient(
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClientChild> val) override {
|
||||||
|
return val->GetValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClient> SetChildOwnPtrClientAndReturnParent(
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClientChild> val) override {
|
||||||
|
return CefOwnPtr<CefTranslatorTestScopedClient>(val.release());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// LIBRARY-SIDE RAWPTR VALUES
|
||||||
|
|
||||||
|
int SetRawPtrLibrary(CefRawPtr<CefTranslatorTestScopedLibrary> val) override {
|
||||||
|
return val->GetValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
int SetChildRawPtrLibrary(
|
||||||
|
CefRawPtr<CefTranslatorTestScopedLibraryChild> val) override {
|
||||||
|
return val->GetValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// LIBRARY-SIDE RAWPTR LIST VALUES
|
||||||
|
|
||||||
|
bool SetRawPtrLibraryList(
|
||||||
|
const std::vector<CefRawPtr<CefTranslatorTestScopedLibrary> >& val,
|
||||||
|
int val1, int val2) override {
|
||||||
|
if (val.size() != 2U)
|
||||||
|
return false;
|
||||||
|
return val[0]->GetValue() == val1 && val[1]->GetValue() == val2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// CLIENT-SIDE RAWPTR VALUES
|
||||||
|
|
||||||
|
int SetRawPtrClient(CefRawPtr<CefTranslatorTestScopedClient> val) override {
|
||||||
|
return val->GetValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
int SetChildRawPtrClient(
|
||||||
|
CefRawPtr<CefTranslatorTestScopedClientChild> val) override {
|
||||||
|
return val->GetValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// CLIENT-SIDE RAWPTR LIST VALUES
|
||||||
|
|
||||||
|
bool SetRawPtrClientList(
|
||||||
|
const std::vector<CefRawPtr<CefTranslatorTestScopedClient> >& val,
|
||||||
|
int val1, int val2) override {
|
||||||
|
if (val.size() != 2U)
|
||||||
|
return false;
|
||||||
|
return val[0]->GetValue() == val1 && val[1]->GetValue() == val2;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
IMPLEMENT_REFCOUNTING(CefTranslatorTestImpl);
|
IMPLEMENT_REFCOUNTING(CefTranslatorTestImpl);
|
||||||
DISALLOW_COPY_AND_ASSIGN(CefTranslatorTestImpl);
|
DISALLOW_COPY_AND_ASSIGN(CefTranslatorTestImpl);
|
||||||
|
@ -49,14 +49,18 @@ void CEF_CALLBACK app_on_register_custom_schemes(struct _cef_app_t* self,
|
|||||||
DCHECK(self);
|
DCHECK(self);
|
||||||
if (!self)
|
if (!self)
|
||||||
return;
|
return;
|
||||||
// Verify param: registrar; type: refptr_diff
|
// Verify param: registrar; type: rawptr_diff
|
||||||
DCHECK(registrar);
|
DCHECK(registrar);
|
||||||
if (!registrar)
|
if (!registrar)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Translate param: registrar; type: rawptr_diff
|
||||||
|
CefOwnPtr<CefSchemeRegistrar> registrarPtr(CefSchemeRegistrarCToCpp::Wrap(
|
||||||
|
registrar));
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
CefAppCppToC::Get(self)->OnRegisterCustomSchemes(
|
CefAppCppToC::Get(self)->OnRegisterCustomSchemes(
|
||||||
CefSchemeRegistrarCToCpp::Wrap(registrar));
|
registrarPtr.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
struct _cef_resource_bundle_handler_t* CEF_CALLBACK app_get_resource_bundle_handler(
|
struct _cef_resource_bundle_handler_t* CEF_CALLBACK app_get_resource_bundle_handler(
|
||||||
|
30
libcef_dll/cpptoc/base_scoped_cpptoc.cc
Normal file
30
libcef_dll/cpptoc/base_scoped_cpptoc.cc
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
|
||||||
|
#include "libcef_dll/cpptoc/base_scoped_cpptoc.h"
|
||||||
|
|
||||||
|
CefBaseScopedCppToC::CefBaseScopedCppToC() {
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> CefOwnPtr<CefBaseScoped>
|
||||||
|
CefCppToCScoped<CefBaseScopedCppToC, CefBaseScoped, cef_base_scoped_t>::
|
||||||
|
UnwrapDerivedOwn(CefWrapperType type, cef_base_scoped_t* s) {
|
||||||
|
NOTREACHED();
|
||||||
|
return CefOwnPtr<CefBaseScoped>();
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> CefRawPtr<CefBaseScoped>
|
||||||
|
CefCppToCScoped<CefBaseScopedCppToC, CefBaseScoped, cef_base_scoped_t>::
|
||||||
|
UnwrapDerivedRaw(CefWrapperType type, cef_base_scoped_t* s) {
|
||||||
|
NOTREACHED();
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if DCHECK_IS_ON()
|
||||||
|
template<> base::AtomicRefCount CefCppToCScoped<CefBaseScopedCppToC,
|
||||||
|
CefBaseScoped, cef_base_scoped_t>::DebugObjCt = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<> CefWrapperType CefCppToCScoped<CefBaseScopedCppToC, CefBaseScoped,
|
||||||
|
cef_base_scoped_t>::kWrapperType = WT_BASE;
|
25
libcef_dll/cpptoc/base_scoped_cpptoc.h
Normal file
25
libcef_dll/cpptoc/base_scoped_cpptoc.h
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
// Copyright (c) 2009 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
|
||||||
|
#ifndef CEF_LIBCEF_DLL_CPPTOC_BASE_CPPTOC_H_
|
||||||
|
#define CEF_LIBCEF_DLL_CPPTOC_BASE_CPPTOC_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "include/cef_base.h"
|
||||||
|
#include "include/capi/cef_base_capi.h"
|
||||||
|
#include "libcef_dll/cpptoc/cpptoc_scoped.h"
|
||||||
|
|
||||||
|
#if !defined(WRAPPING_CEF_SHARED)
|
||||||
|
#error This file can be included wrapper-side only
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Wrap a C++ class with a C structure.
|
||||||
|
class CefBaseScopedCppToC
|
||||||
|
: public CefCppToCScoped<CefBaseScopedCppToC, CefBaseScoped,
|
||||||
|
cef_base_scoped_t> {
|
||||||
|
public:
|
||||||
|
CefBaseScopedCppToC();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CEF_LIBCEF_DLL_CPPTOC_BASE_CPPTOC_H_
|
241
libcef_dll/cpptoc/cpptoc_scoped.h
Normal file
241
libcef_dll/cpptoc/cpptoc_scoped.h
Normal file
@ -0,0 +1,241 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
|
||||||
|
#ifndef CEF_LIBCEF_DLL_CPPTOC_CPPTOC_SCOPED_H_
|
||||||
|
#define CEF_LIBCEF_DLL_CPPTOC_CPPTOC_SCOPED_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "include/base/cef_logging.h"
|
||||||
|
#include "include/base/cef_macros.h"
|
||||||
|
#include "include/cef_base.h"
|
||||||
|
#include "include/capi/cef_base_capi.h"
|
||||||
|
#include "libcef_dll/ptr_util.h"
|
||||||
|
#include "libcef_dll/wrapper_types.h"
|
||||||
|
|
||||||
|
// Wrap a C++ class with a C structure. This is used when the class
|
||||||
|
// implementation exists on this side of the DLL boundary but will have methods
|
||||||
|
// called from the other side of the DLL boundary.
|
||||||
|
template <class ClassName, class BaseName, class StructName>
|
||||||
|
class CefCppToCScoped : public CefBaseScoped {
|
||||||
|
public:
|
||||||
|
// Create a new wrapper instance and associated structure reference for
|
||||||
|
// passing an object instance the other side. The wrapper object will be
|
||||||
|
// deleted when |del| is called on the associated structure. The wrapped
|
||||||
|
// object will be deleted when the wrapper object is deleted. For example:
|
||||||
|
//
|
||||||
|
// void MyMethod(CefOwnPtr<MyType> obj) {
|
||||||
|
// my_method(MyTypeCppToC::WrapOwn(obj));
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// void my_method(my_type_t* struct) {
|
||||||
|
// // Delete the MyTypeCppToC wrapper and the owned MyType object.
|
||||||
|
// struct->del(struct);
|
||||||
|
// }
|
||||||
|
static StructName* WrapOwn(CefOwnPtr<BaseName> c) {
|
||||||
|
if (!c)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
// Wrap our object with the CefCppToC class.
|
||||||
|
ClassName* wrapper = new ClassName();
|
||||||
|
wrapper->Initialize(c.release(), true);
|
||||||
|
|
||||||
|
// Return the structure pointer that can now be passed to the other side.
|
||||||
|
return wrapper->GetStruct();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create a new wrapper instance and associated structure reference for
|
||||||
|
// passing an object instance to the other side. The wrapper object is owned
|
||||||
|
// by the caller. The wrapped object is unowned and must outlive the wrapper.
|
||||||
|
// For example:
|
||||||
|
//
|
||||||
|
// void MyMethod(MyType* obj) {
|
||||||
|
// CefOwnPtr<MyTypeCppToC> MyTypeWrapper = MyTypeCppToC::WrapRaw(obj);
|
||||||
|
// my_method(MyTypeWrapper->GetStruct());
|
||||||
|
// // MyTypeWrapper is deleted when MyMethod() goes out of scope.
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// void my_method(my_type_t* struct) {
|
||||||
|
// // Access |struct| here but you can't delete it.
|
||||||
|
// }
|
||||||
|
static CefOwnPtr<ClassName> WrapRaw(CefRawPtr<BaseName> c) {
|
||||||
|
if (!c)
|
||||||
|
return CefOwnPtr<ClassName>();
|
||||||
|
|
||||||
|
// Wrap our object with the CefCppToC class.
|
||||||
|
ClassName* wrapper = new ClassName();
|
||||||
|
wrapper->Initialize(c, false);
|
||||||
|
|
||||||
|
// Return the owned wrapper object.
|
||||||
|
return CefOwnPtr<ClassName>(wrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Retrieve the underlying object instance for a structure reference passed
|
||||||
|
// back from the other side. The caller takes ownership of the object. For
|
||||||
|
// example:
|
||||||
|
//
|
||||||
|
// void my_method(my_type_t* struct) {
|
||||||
|
// CefOwnPtr<MyType> MyTypePtr = MyTypeCppToC::UnwrapOwn(struct);
|
||||||
|
// // |struct| has been deleted and should no longer be accessed.
|
||||||
|
// }
|
||||||
|
static CefOwnPtr<BaseName> UnwrapOwn(StructName* s) {
|
||||||
|
if (!s)
|
||||||
|
return CefOwnPtr<BaseName>();
|
||||||
|
|
||||||
|
// Cast our structure to the wrapper structure type.
|
||||||
|
WrapperStruct* wrapperStruct = GetWrapperStruct(s);
|
||||||
|
|
||||||
|
// If the type does not match this object then we need to unwrap as the
|
||||||
|
// derived type.
|
||||||
|
if (wrapperStruct->type_ != kWrapperType)
|
||||||
|
return UnwrapDerivedOwn(wrapperStruct->type_, s);
|
||||||
|
|
||||||
|
// We should own the underlying object currently.
|
||||||
|
DCHECK(wrapperStruct->wrapper_->owned_);
|
||||||
|
DCHECK(wrapperStruct->object_);
|
||||||
|
|
||||||
|
// We're giving up ownership of the underlying object. Clear the pointer so
|
||||||
|
// it doesn't get deleted.
|
||||||
|
BaseName* object = wrapperStruct->object_;
|
||||||
|
wrapperStruct->object_ = NULL;
|
||||||
|
|
||||||
|
delete wrapperStruct->wrapper_;
|
||||||
|
|
||||||
|
// Return the underlying object instance.
|
||||||
|
return CefOwnPtr<BaseName>(object);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Retrieve the underlying object instance for a structure reference passed
|
||||||
|
// back from the other side. Ownership does not change. For example:
|
||||||
|
//
|
||||||
|
// void my_method(my_type_t* struct) {
|
||||||
|
// CefRawPtr<MyType> MyTypePtr = MyTypeCppToC::UnwrapRaw(struct);
|
||||||
|
// // |struct| is still valid.
|
||||||
|
// }
|
||||||
|
static CefRawPtr<BaseName> UnwrapRaw(StructName* s) {
|
||||||
|
if (!s)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
// Cast our structure to the wrapper structure type.
|
||||||
|
WrapperStruct* wrapperStruct = GetWrapperStruct(s);
|
||||||
|
|
||||||
|
// If the type does not match this object then we need to unwrap as the
|
||||||
|
// derived type.
|
||||||
|
if (wrapperStruct->type_ != kWrapperType)
|
||||||
|
return UnwrapDerivedRaw(wrapperStruct->type_, s);
|
||||||
|
|
||||||
|
// Return the underlying object instance.
|
||||||
|
return wrapperStruct->object_;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Retrieve the same side wrapper associated with the structure. Ownership
|
||||||
|
// does not change.
|
||||||
|
static ClassName* GetWrapper(StructName* s) {
|
||||||
|
DCHECK(s);
|
||||||
|
WrapperStruct* wrapperStruct = GetWrapperStruct(s);
|
||||||
|
// Verify that the wrapper offset was calculated correctly.
|
||||||
|
DCHECK_EQ(kWrapperType, wrapperStruct->type_);
|
||||||
|
return static_cast<ClassName*>(wrapperStruct->wrapper_);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Retrieve the underlying object instance from our own structure reference
|
||||||
|
// when the reference is passed as the required first parameter of a C API
|
||||||
|
// function call. Ownership of the object does not change.
|
||||||
|
static BaseName* Get(StructName* s) {
|
||||||
|
DCHECK(s);
|
||||||
|
WrapperStruct* wrapperStruct = GetWrapperStruct(s);
|
||||||
|
// Verify that the wrapper offset was calculated correctly.
|
||||||
|
DCHECK_EQ(kWrapperType, wrapperStruct->type_);
|
||||||
|
return wrapperStruct->object_;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If returning the structure across the DLL boundary you should call
|
||||||
|
// AddRef() on this CefCppToC object. On the other side of the DLL boundary,
|
||||||
|
// call UnderlyingRelease() on the wrapping CefCToCpp object.
|
||||||
|
StructName* GetStruct() { return &wrapper_struct_.struct_; }
|
||||||
|
|
||||||
|
#if DCHECK_IS_ON()
|
||||||
|
// Simple tracking of allocated objects.
|
||||||
|
static base::AtomicRefCount DebugObjCt; // NOLINT(runtime/int)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
protected:
|
||||||
|
CefCppToCScoped() {
|
||||||
|
wrapper_struct_.type_ = kWrapperType;
|
||||||
|
wrapper_struct_.wrapper_ = this;
|
||||||
|
memset(GetStruct(), 0, sizeof(StructName));
|
||||||
|
|
||||||
|
#if DCHECK_IS_ON()
|
||||||
|
base::AtomicRefCountInc(&DebugObjCt);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual ~CefCppToCScoped() {
|
||||||
|
// Only delete the underlying object if we own it.
|
||||||
|
if (owned_ && wrapper_struct_.object_)
|
||||||
|
delete wrapper_struct_.object_;
|
||||||
|
|
||||||
|
#if DCHECK_IS_ON()
|
||||||
|
base::AtomicRefCountDec(&DebugObjCt);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
// Used to associate this wrapper object, the underlying object instance and
|
||||||
|
// the structure that will be passed to the other side.
|
||||||
|
struct WrapperStruct {
|
||||||
|
CefWrapperType type_;
|
||||||
|
BaseName* object_;
|
||||||
|
CefCppToCScoped<ClassName, BaseName, StructName>* wrapper_;
|
||||||
|
StructName struct_;
|
||||||
|
};
|
||||||
|
|
||||||
|
void Initialize(BaseName* obj, bool owned) {
|
||||||
|
wrapper_struct_.object_ = obj;
|
||||||
|
owned_ = owned;
|
||||||
|
|
||||||
|
cef_base_scoped_t* base = reinterpret_cast<cef_base_scoped_t*>(GetStruct());
|
||||||
|
base->size = sizeof(StructName);
|
||||||
|
if (owned)
|
||||||
|
base->del = struct_del;
|
||||||
|
}
|
||||||
|
|
||||||
|
static WrapperStruct* GetWrapperStruct(StructName* s) {
|
||||||
|
// Offset using the WrapperStruct size instead of individual member sizes
|
||||||
|
// to avoid problems due to platform/compiler differences in structure
|
||||||
|
// padding.
|
||||||
|
return reinterpret_cast<WrapperStruct*>(
|
||||||
|
reinterpret_cast<char*>(s) -
|
||||||
|
(sizeof(WrapperStruct) - sizeof(StructName)));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Unwrap as the derived type.
|
||||||
|
static CefOwnPtr<BaseName> UnwrapDerivedOwn(CefWrapperType type,
|
||||||
|
StructName* s);
|
||||||
|
static CefRawPtr<BaseName> UnwrapDerivedRaw(CefWrapperType type,
|
||||||
|
StructName* s);
|
||||||
|
|
||||||
|
static void CEF_CALLBACK struct_del(cef_base_scoped_t* base) {
|
||||||
|
DCHECK(base);
|
||||||
|
if (!base)
|
||||||
|
return;
|
||||||
|
|
||||||
|
WrapperStruct* wrapperStruct =
|
||||||
|
GetWrapperStruct(reinterpret_cast<StructName*>(base));
|
||||||
|
// Verify that the wrapper offset was calculated correctly.
|
||||||
|
DCHECK_EQ(kWrapperType, wrapperStruct->type_);
|
||||||
|
|
||||||
|
// Should only be deleting wrappers that own the underlying object.
|
||||||
|
DCHECK(wrapperStruct->wrapper_->owned_);
|
||||||
|
delete wrapperStruct->wrapper_;
|
||||||
|
}
|
||||||
|
|
||||||
|
WrapperStruct wrapper_struct_;
|
||||||
|
bool owned_;
|
||||||
|
|
||||||
|
static CefWrapperType kWrapperType;
|
||||||
|
|
||||||
|
DISALLOW_COPY_AND_ASSIGN(CefCppToCScoped);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CEF_LIBCEF_DLL_CPPTOC_CPPTOC_SCOPED_H_
|
@ -53,18 +53,25 @@ CefSchemeRegistrarCppToC::CefSchemeRegistrarCppToC() {
|
|||||||
GetStruct()->add_custom_scheme = scheme_registrar_add_custom_scheme;
|
GetStruct()->add_custom_scheme = scheme_registrar_add_custom_scheme;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<> CefRefPtr<CefSchemeRegistrar> CefCppToC<CefSchemeRegistrarCppToC,
|
template<> CefOwnPtr<CefSchemeRegistrar> CefCppToCScoped<CefSchemeRegistrarCppToC,
|
||||||
CefSchemeRegistrar, cef_scheme_registrar_t>::UnwrapDerived(
|
CefSchemeRegistrar, cef_scheme_registrar_t>::UnwrapDerivedOwn(
|
||||||
|
CefWrapperType type, cef_scheme_registrar_t* s) {
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return CefOwnPtr<CefSchemeRegistrar>();
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> CefRawPtr<CefSchemeRegistrar> CefCppToCScoped<CefSchemeRegistrarCppToC,
|
||||||
|
CefSchemeRegistrar, cef_scheme_registrar_t>::UnwrapDerivedRaw(
|
||||||
CefWrapperType type, cef_scheme_registrar_t* s) {
|
CefWrapperType type, cef_scheme_registrar_t* s) {
|
||||||
NOTREACHED() << "Unexpected class type: " << type;
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if DCHECK_IS_ON()
|
#if DCHECK_IS_ON()
|
||||||
template<> base::AtomicRefCount CefCppToC<CefSchemeRegistrarCppToC,
|
template<> base::AtomicRefCount CefCppToCScoped<CefSchemeRegistrarCppToC,
|
||||||
CefSchemeRegistrar, cef_scheme_registrar_t>::DebugObjCt = 0;
|
CefSchemeRegistrar, cef_scheme_registrar_t>::DebugObjCt = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
template<> CefWrapperType CefCppToC<CefSchemeRegistrarCppToC,
|
template<> CefWrapperType CefCppToCScoped<CefSchemeRegistrarCppToC,
|
||||||
CefSchemeRegistrar, cef_scheme_registrar_t>::kWrapperType =
|
CefSchemeRegistrar, cef_scheme_registrar_t>::kWrapperType =
|
||||||
WT_SCHEME_REGISTRAR;
|
WT_SCHEME_REGISTRAR;
|
||||||
|
@ -20,12 +20,12 @@
|
|||||||
|
|
||||||
#include "include/cef_scheme.h"
|
#include "include/cef_scheme.h"
|
||||||
#include "include/capi/cef_scheme_capi.h"
|
#include "include/capi/cef_scheme_capi.h"
|
||||||
#include "libcef_dll/cpptoc/cpptoc.h"
|
#include "libcef_dll/cpptoc/cpptoc_scoped.h"
|
||||||
|
|
||||||
// Wrap a C++ class with a C structure.
|
// Wrap a C++ class with a C structure.
|
||||||
// This class may be instantiated and accessed DLL-side only.
|
// This class may be instantiated and accessed DLL-side only.
|
||||||
class CefSchemeRegistrarCppToC
|
class CefSchemeRegistrarCppToC
|
||||||
: public CefCppToC<CefSchemeRegistrarCppToC, CefSchemeRegistrar,
|
: public CefCppToCScoped<CefSchemeRegistrarCppToC, CefSchemeRegistrar,
|
||||||
cef_scheme_registrar_t> {
|
cef_scheme_registrar_t> {
|
||||||
public:
|
public:
|
||||||
CefSchemeRegistrarCppToC();
|
CefSchemeRegistrarCppToC();
|
||||||
|
@ -12,10 +12,14 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include "libcef_dll/cpptoc/test/translator_test_cpptoc.h"
|
#include "libcef_dll/cpptoc/test/translator_test_cpptoc.h"
|
||||||
#include "libcef_dll/cpptoc/test/translator_test_object_cpptoc.h"
|
#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.h"
|
||||||
#include "libcef_dll/cpptoc/test/translator_test_object_child_cpptoc.h"
|
#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.h"
|
||||||
#include "libcef_dll/ctocpp/test/translator_test_handler_ctocpp.h"
|
#include "libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.h"
|
||||||
#include "libcef_dll/ctocpp/test/translator_test_handler_child_ctocpp.h"
|
#include "libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.h"
|
||||||
|
#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.h"
|
||||||
|
#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.h"
|
||||||
|
#include "libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.h"
|
||||||
|
#include "libcef_dll/ctocpp/test/translator_test_scoped_client_child_ctocpp.h"
|
||||||
#include "libcef_dll/transfer_util.h"
|
#include "libcef_dll/transfer_util.h"
|
||||||
|
|
||||||
|
|
||||||
@ -653,7 +657,7 @@ size_t CEF_CALLBACK translator_test_get_point_list_size(
|
|||||||
return _retval;
|
return _retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct _cef_translator_test_object_t* CEF_CALLBACK translator_test_get_object(
|
struct _cef_translator_test_ref_ptr_library_t* CEF_CALLBACK translator_test_get_ref_ptr_library(
|
||||||
struct _cef_translator_test_t* self, int val) {
|
struct _cef_translator_test_t* self, int val) {
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
@ -662,16 +666,17 @@ struct _cef_translator_test_object_t* CEF_CALLBACK translator_test_get_object(
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
CefRefPtr<CefTranslatorTestObject> _retval = CefTranslatorTestCppToC::Get(
|
CefRefPtr<CefTranslatorTestRefPtrLibrary> _retval =
|
||||||
self)->GetObject(
|
CefTranslatorTestCppToC::Get(self)->GetRefPtrLibrary(
|
||||||
val);
|
val);
|
||||||
|
|
||||||
// Return type: refptr_same
|
// Return type: refptr_same
|
||||||
return CefTranslatorTestObjectCppToC::Wrap(_retval);
|
return CefTranslatorTestRefPtrLibraryCppToC::Wrap(_retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
int CEF_CALLBACK translator_test_set_object(struct _cef_translator_test_t* self,
|
int CEF_CALLBACK translator_test_set_ref_ptr_library(
|
||||||
struct _cef_translator_test_object_t* val) {
|
struct _cef_translator_test_t* self,
|
||||||
|
struct _cef_translator_test_ref_ptr_library_t* val) {
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
DCHECK(self);
|
DCHECK(self);
|
||||||
@ -683,16 +688,16 @@ int CEF_CALLBACK translator_test_set_object(struct _cef_translator_test_t* self,
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
int _retval = CefTranslatorTestCppToC::Get(self)->SetObject(
|
int _retval = CefTranslatorTestCppToC::Get(self)->SetRefPtrLibrary(
|
||||||
CefTranslatorTestObjectCppToC::Unwrap(val));
|
CefTranslatorTestRefPtrLibraryCppToC::Unwrap(val));
|
||||||
|
|
||||||
// Return type: simple
|
// Return type: simple
|
||||||
return _retval;
|
return _retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct _cef_translator_test_object_t* CEF_CALLBACK translator_test_set_object_and_return(
|
struct _cef_translator_test_ref_ptr_library_t* CEF_CALLBACK translator_test_set_ref_ptr_library_and_return(
|
||||||
struct _cef_translator_test_t* self,
|
struct _cef_translator_test_t* self,
|
||||||
struct _cef_translator_test_object_t* val) {
|
struct _cef_translator_test_ref_ptr_library_t* val) {
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
DCHECK(self);
|
DCHECK(self);
|
||||||
@ -704,17 +709,17 @@ struct _cef_translator_test_object_t* CEF_CALLBACK translator_test_set_object_an
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
CefRefPtr<CefTranslatorTestObject> _retval = CefTranslatorTestCppToC::Get(
|
CefRefPtr<CefTranslatorTestRefPtrLibrary> _retval =
|
||||||
self)->SetObjectAndReturn(
|
CefTranslatorTestCppToC::Get(self)->SetRefPtrLibraryAndReturn(
|
||||||
CefTranslatorTestObjectCppToC::Unwrap(val));
|
CefTranslatorTestRefPtrLibraryCppToC::Unwrap(val));
|
||||||
|
|
||||||
// Return type: refptr_same
|
// Return type: refptr_same
|
||||||
return CefTranslatorTestObjectCppToC::Wrap(_retval);
|
return CefTranslatorTestRefPtrLibraryCppToC::Wrap(_retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
int CEF_CALLBACK translator_test_set_child_object(
|
int CEF_CALLBACK translator_test_set_child_ref_ptr_library(
|
||||||
struct _cef_translator_test_t* self,
|
struct _cef_translator_test_t* self,
|
||||||
struct _cef_translator_test_object_child_t* val) {
|
struct _cef_translator_test_ref_ptr_library_child_t* val) {
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
DCHECK(self);
|
DCHECK(self);
|
||||||
@ -726,16 +731,16 @@ int CEF_CALLBACK translator_test_set_child_object(
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
int _retval = CefTranslatorTestCppToC::Get(self)->SetChildObject(
|
int _retval = CefTranslatorTestCppToC::Get(self)->SetChildRefPtrLibrary(
|
||||||
CefTranslatorTestObjectChildCppToC::Unwrap(val));
|
CefTranslatorTestRefPtrLibraryChildCppToC::Unwrap(val));
|
||||||
|
|
||||||
// Return type: simple
|
// Return type: simple
|
||||||
return _retval;
|
return _retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct _cef_translator_test_object_t* CEF_CALLBACK translator_test_set_child_object_and_return_parent(
|
struct _cef_translator_test_ref_ptr_library_t* CEF_CALLBACK translator_test_set_child_ref_ptr_library_and_return_parent(
|
||||||
struct _cef_translator_test_t* self,
|
struct _cef_translator_test_t* self,
|
||||||
struct _cef_translator_test_object_child_t* val) {
|
struct _cef_translator_test_ref_ptr_library_child_t* val) {
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
DCHECK(self);
|
DCHECK(self);
|
||||||
@ -747,17 +752,18 @@ struct _cef_translator_test_object_t* CEF_CALLBACK translator_test_set_child_obj
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
CefRefPtr<CefTranslatorTestObject> _retval = CefTranslatorTestCppToC::Get(
|
CefRefPtr<CefTranslatorTestRefPtrLibrary> _retval =
|
||||||
self)->SetChildObjectAndReturnParent(
|
CefTranslatorTestCppToC::Get(self)->SetChildRefPtrLibraryAndReturnParent(
|
||||||
CefTranslatorTestObjectChildCppToC::Unwrap(val));
|
CefTranslatorTestRefPtrLibraryChildCppToC::Unwrap(val));
|
||||||
|
|
||||||
// Return type: refptr_same
|
// Return type: refptr_same
|
||||||
return CefTranslatorTestObjectCppToC::Wrap(_retval);
|
return CefTranslatorTestRefPtrLibraryCppToC::Wrap(_retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
int CEF_CALLBACK translator_test_set_object_list(
|
int CEF_CALLBACK translator_test_set_ref_ptr_library_list(
|
||||||
struct _cef_translator_test_t* self, size_t valCount,
|
struct _cef_translator_test_t* self, size_t valCount,
|
||||||
struct _cef_translator_test_object_t* const* val, int val1, int val2) {
|
struct _cef_translator_test_ref_ptr_library_t* const* val, int val1,
|
||||||
|
int val2) {
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
DCHECK(self);
|
DCHECK(self);
|
||||||
@ -769,17 +775,17 @@ int CEF_CALLBACK translator_test_set_object_list(
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// Translate param: val; type: refptr_vec_same_byref_const
|
// Translate param: val; type: refptr_vec_same_byref_const
|
||||||
std::vector<CefRefPtr<CefTranslatorTestObject> > valList;
|
std::vector<CefRefPtr<CefTranslatorTestRefPtrLibrary> > valList;
|
||||||
if (valCount > 0) {
|
if (valCount > 0) {
|
||||||
for (size_t i = 0; i < valCount; ++i) {
|
for (size_t i = 0; i < valCount; ++i) {
|
||||||
CefRefPtr<CefTranslatorTestObject> valVal =
|
CefRefPtr<CefTranslatorTestRefPtrLibrary> valVal =
|
||||||
CefTranslatorTestObjectCppToC::Unwrap(val[i]);
|
CefTranslatorTestRefPtrLibraryCppToC::Unwrap(val[i]);
|
||||||
valList.push_back(valVal);
|
valList.push_back(valVal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
bool _retval = CefTranslatorTestCppToC::Get(self)->SetObjectList(
|
bool _retval = CefTranslatorTestCppToC::Get(self)->SetRefPtrLibraryList(
|
||||||
valList,
|
valList,
|
||||||
val1,
|
val1,
|
||||||
val2);
|
val2);
|
||||||
@ -788,9 +794,9 @@ int CEF_CALLBACK translator_test_set_object_list(
|
|||||||
return _retval;
|
return _retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CEF_CALLBACK translator_test_get_object_list_by_ref(
|
int CEF_CALLBACK translator_test_get_ref_ptr_library_list_by_ref(
|
||||||
struct _cef_translator_test_t* self, size_t* valCount,
|
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) {
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
DCHECK(self);
|
DCHECK(self);
|
||||||
@ -802,15 +808,15 @@ int CEF_CALLBACK translator_test_get_object_list_by_ref(
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// Translate param: val; type: refptr_vec_same_byref
|
// Translate param: val; type: refptr_vec_same_byref
|
||||||
std::vector<CefRefPtr<CefTranslatorTestObject> > valList;
|
std::vector<CefRefPtr<CefTranslatorTestRefPtrLibrary> > valList;
|
||||||
if (valCount && *valCount > 0 && val) {
|
if (valCount && *valCount > 0 && val) {
|
||||||
for (size_t i = 0; i < *valCount; ++i) {
|
for (size_t i = 0; i < *valCount; ++i) {
|
||||||
valList.push_back(CefTranslatorTestObjectCppToC::Unwrap(val[i]));
|
valList.push_back(CefTranslatorTestRefPtrLibraryCppToC::Unwrap(val[i]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
bool _retval = CefTranslatorTestCppToC::Get(self)->GetObjectListByRef(
|
bool _retval = CefTranslatorTestCppToC::Get(self)->GetRefPtrLibraryListByRef(
|
||||||
valList,
|
valList,
|
||||||
val1,
|
val1,
|
||||||
val2);
|
val2);
|
||||||
@ -820,7 +826,7 @@ int CEF_CALLBACK translator_test_get_object_list_by_ref(
|
|||||||
*valCount = std::min(valList.size(), *valCount);
|
*valCount = std::min(valList.size(), *valCount);
|
||||||
if (*valCount > 0) {
|
if (*valCount > 0) {
|
||||||
for (size_t i = 0; i < *valCount; ++i) {
|
for (size_t i = 0; i < *valCount; ++i) {
|
||||||
val[i] = CefTranslatorTestObjectCppToC::Wrap(valList[i]);
|
val[i] = CefTranslatorTestRefPtrLibraryCppToC::Wrap(valList[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -829,7 +835,7 @@ int CEF_CALLBACK translator_test_get_object_list_by_ref(
|
|||||||
return _retval;
|
return _retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t CEF_CALLBACK translator_test_get_object_list_size(
|
size_t CEF_CALLBACK translator_test_get_ref_ptr_library_list_size(
|
||||||
struct _cef_translator_test_t* self) {
|
struct _cef_translator_test_t* self) {
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
@ -838,15 +844,16 @@ size_t CEF_CALLBACK translator_test_get_object_list_size(
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
size_t _retval = CefTranslatorTestCppToC::Get(self)->GetObjectListSize();
|
size_t _retval = CefTranslatorTestCppToC::Get(self)->GetRefPtrLibraryListSize(
|
||||||
|
);
|
||||||
|
|
||||||
// Return type: simple
|
// Return type: simple
|
||||||
return _retval;
|
return _retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CEF_CALLBACK translator_test_set_handler(
|
int CEF_CALLBACK translator_test_set_ref_ptr_client(
|
||||||
struct _cef_translator_test_t* self,
|
struct _cef_translator_test_t* self,
|
||||||
struct _cef_translator_test_handler_t* val) {
|
struct _cef_translator_test_ref_ptr_client_t* val) {
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
DCHECK(self);
|
DCHECK(self);
|
||||||
@ -858,16 +865,16 @@ int CEF_CALLBACK translator_test_set_handler(
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
int _retval = CefTranslatorTestCppToC::Get(self)->SetHandler(
|
int _retval = CefTranslatorTestCppToC::Get(self)->SetRefPtrClient(
|
||||||
CefTranslatorTestHandlerCToCpp::Wrap(val));
|
CefTranslatorTestRefPtrClientCToCpp::Wrap(val));
|
||||||
|
|
||||||
// Return type: simple
|
// Return type: simple
|
||||||
return _retval;
|
return _retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct _cef_translator_test_handler_t* CEF_CALLBACK translator_test_set_handler_and_return(
|
struct _cef_translator_test_ref_ptr_client_t* CEF_CALLBACK translator_test_set_ref_ptr_client_and_return(
|
||||||
struct _cef_translator_test_t* self,
|
struct _cef_translator_test_t* self,
|
||||||
struct _cef_translator_test_handler_t* val) {
|
struct _cef_translator_test_ref_ptr_client_t* val) {
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
DCHECK(self);
|
DCHECK(self);
|
||||||
@ -879,17 +886,17 @@ struct _cef_translator_test_handler_t* CEF_CALLBACK translator_test_set_handler_
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
CefRefPtr<CefTranslatorTestHandler> _retval = CefTranslatorTestCppToC::Get(
|
CefRefPtr<CefTranslatorTestRefPtrClient> _retval =
|
||||||
self)->SetHandlerAndReturn(
|
CefTranslatorTestCppToC::Get(self)->SetRefPtrClientAndReturn(
|
||||||
CefTranslatorTestHandlerCToCpp::Wrap(val));
|
CefTranslatorTestRefPtrClientCToCpp::Wrap(val));
|
||||||
|
|
||||||
// Return type: refptr_diff
|
// Return type: refptr_diff
|
||||||
return CefTranslatorTestHandlerCToCpp::Unwrap(_retval);
|
return CefTranslatorTestRefPtrClientCToCpp::Unwrap(_retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
int CEF_CALLBACK translator_test_set_child_handler(
|
int CEF_CALLBACK translator_test_set_child_ref_ptr_client(
|
||||||
struct _cef_translator_test_t* self,
|
struct _cef_translator_test_t* self,
|
||||||
struct _cef_translator_test_handler_child_t* val) {
|
struct _cef_translator_test_ref_ptr_client_child_t* val) {
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
DCHECK(self);
|
DCHECK(self);
|
||||||
@ -901,16 +908,16 @@ int CEF_CALLBACK translator_test_set_child_handler(
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
int _retval = CefTranslatorTestCppToC::Get(self)->SetChildHandler(
|
int _retval = CefTranslatorTestCppToC::Get(self)->SetChildRefPtrClient(
|
||||||
CefTranslatorTestHandlerChildCToCpp::Wrap(val));
|
CefTranslatorTestRefPtrClientChildCToCpp::Wrap(val));
|
||||||
|
|
||||||
// Return type: simple
|
// Return type: simple
|
||||||
return _retval;
|
return _retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct _cef_translator_test_handler_t* CEF_CALLBACK translator_test_set_child_handler_and_return_parent(
|
struct _cef_translator_test_ref_ptr_client_t* CEF_CALLBACK translator_test_set_child_ref_ptr_client_and_return_parent(
|
||||||
struct _cef_translator_test_t* self,
|
struct _cef_translator_test_t* self,
|
||||||
struct _cef_translator_test_handler_child_t* val) {
|
struct _cef_translator_test_ref_ptr_client_child_t* val) {
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
DCHECK(self);
|
DCHECK(self);
|
||||||
@ -922,17 +929,18 @@ struct _cef_translator_test_handler_t* CEF_CALLBACK translator_test_set_child_ha
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
CefRefPtr<CefTranslatorTestHandler> _retval = CefTranslatorTestCppToC::Get(
|
CefRefPtr<CefTranslatorTestRefPtrClient> _retval =
|
||||||
self)->SetChildHandlerAndReturnParent(
|
CefTranslatorTestCppToC::Get(self)->SetChildRefPtrClientAndReturnParent(
|
||||||
CefTranslatorTestHandlerChildCToCpp::Wrap(val));
|
CefTranslatorTestRefPtrClientChildCToCpp::Wrap(val));
|
||||||
|
|
||||||
// Return type: refptr_diff
|
// Return type: refptr_diff
|
||||||
return CefTranslatorTestHandlerCToCpp::Unwrap(_retval);
|
return CefTranslatorTestRefPtrClientCToCpp::Unwrap(_retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
int CEF_CALLBACK translator_test_set_handler_list(
|
int CEF_CALLBACK translator_test_set_ref_ptr_client_list(
|
||||||
struct _cef_translator_test_t* self, size_t valCount,
|
struct _cef_translator_test_t* self, size_t valCount,
|
||||||
struct _cef_translator_test_handler_t* const* val, int val1, int val2) {
|
struct _cef_translator_test_ref_ptr_client_t* const* val, int val1,
|
||||||
|
int val2) {
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
DCHECK(self);
|
DCHECK(self);
|
||||||
@ -944,17 +952,17 @@ int CEF_CALLBACK translator_test_set_handler_list(
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// Translate param: val; type: refptr_vec_diff_byref_const
|
// Translate param: val; type: refptr_vec_diff_byref_const
|
||||||
std::vector<CefRefPtr<CefTranslatorTestHandler> > valList;
|
std::vector<CefRefPtr<CefTranslatorTestRefPtrClient> > valList;
|
||||||
if (valCount > 0) {
|
if (valCount > 0) {
|
||||||
for (size_t i = 0; i < valCount; ++i) {
|
for (size_t i = 0; i < valCount; ++i) {
|
||||||
CefRefPtr<CefTranslatorTestHandler> valVal =
|
CefRefPtr<CefTranslatorTestRefPtrClient> valVal =
|
||||||
CefTranslatorTestHandlerCToCpp::Wrap(val[i]);
|
CefTranslatorTestRefPtrClientCToCpp::Wrap(val[i]);
|
||||||
valList.push_back(valVal);
|
valList.push_back(valVal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
bool _retval = CefTranslatorTestCppToC::Get(self)->SetHandlerList(
|
bool _retval = CefTranslatorTestCppToC::Get(self)->SetRefPtrClientList(
|
||||||
valList,
|
valList,
|
||||||
val1,
|
val1,
|
||||||
val2);
|
val2);
|
||||||
@ -963,11 +971,11 @@ int CEF_CALLBACK translator_test_set_handler_list(
|
|||||||
return _retval;
|
return _retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CEF_CALLBACK translator_test_get_handler_list_by_ref(
|
int CEF_CALLBACK translator_test_get_ref_ptr_client_list_by_ref(
|
||||||
struct _cef_translator_test_t* self, size_t* valCount,
|
struct _cef_translator_test_t* self, size_t* valCount,
|
||||||
struct _cef_translator_test_handler_t** val,
|
struct _cef_translator_test_ref_ptr_client_t** val,
|
||||||
struct _cef_translator_test_handler_t* val1,
|
struct _cef_translator_test_ref_ptr_client_t* val1,
|
||||||
struct _cef_translator_test_handler_t* val2) {
|
struct _cef_translator_test_ref_ptr_client_t* val2) {
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
DCHECK(self);
|
DCHECK(self);
|
||||||
@ -987,25 +995,25 @@ int CEF_CALLBACK translator_test_get_handler_list_by_ref(
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// Translate param: val; type: refptr_vec_diff_byref
|
// Translate param: val; type: refptr_vec_diff_byref
|
||||||
std::vector<CefRefPtr<CefTranslatorTestHandler> > valList;
|
std::vector<CefRefPtr<CefTranslatorTestRefPtrClient> > valList;
|
||||||
if (valCount && *valCount > 0 && val) {
|
if (valCount && *valCount > 0 && val) {
|
||||||
for (size_t i = 0; i < *valCount; ++i) {
|
for (size_t i = 0; i < *valCount; ++i) {
|
||||||
valList.push_back(CefTranslatorTestHandlerCToCpp::Wrap(val[i]));
|
valList.push_back(CefTranslatorTestRefPtrClientCToCpp::Wrap(val[i]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
bool _retval = CefTranslatorTestCppToC::Get(self)->GetHandlerListByRef(
|
bool _retval = CefTranslatorTestCppToC::Get(self)->GetRefPtrClientListByRef(
|
||||||
valList,
|
valList,
|
||||||
CefTranslatorTestHandlerCToCpp::Wrap(val1),
|
CefTranslatorTestRefPtrClientCToCpp::Wrap(val1),
|
||||||
CefTranslatorTestHandlerCToCpp::Wrap(val2));
|
CefTranslatorTestRefPtrClientCToCpp::Wrap(val2));
|
||||||
|
|
||||||
// Restore param: val; type: refptr_vec_diff_byref
|
// Restore param: val; type: refptr_vec_diff_byref
|
||||||
if (valCount && val) {
|
if (valCount && val) {
|
||||||
*valCount = std::min(valList.size(), *valCount);
|
*valCount = std::min(valList.size(), *valCount);
|
||||||
if (*valCount > 0) {
|
if (*valCount > 0) {
|
||||||
for (size_t i = 0; i < *valCount; ++i) {
|
for (size_t i = 0; i < *valCount; ++i) {
|
||||||
val[i] = CefTranslatorTestHandlerCToCpp::Unwrap(valList[i]);
|
val[i] = CefTranslatorTestRefPtrClientCToCpp::Unwrap(valList[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1014,7 +1022,7 @@ int CEF_CALLBACK translator_test_get_handler_list_by_ref(
|
|||||||
return _retval;
|
return _retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t CEF_CALLBACK translator_test_get_handler_list_size(
|
size_t CEF_CALLBACK translator_test_get_ref_ptr_client_list_size(
|
||||||
struct _cef_translator_test_t* self) {
|
struct _cef_translator_test_t* self) {
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
@ -1023,12 +1031,385 @@ size_t CEF_CALLBACK translator_test_get_handler_list_size(
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
size_t _retval = CefTranslatorTestCppToC::Get(self)->GetHandlerListSize();
|
size_t _retval = CefTranslatorTestCppToC::Get(self)->GetRefPtrClientListSize(
|
||||||
|
);
|
||||||
|
|
||||||
// Return type: simple
|
// Return type: simple
|
||||||
return _retval;
|
return _retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct _cef_translator_test_scoped_library_t* CEF_CALLBACK translator_test_get_own_ptr_library(
|
||||||
|
struct _cef_translator_test_t* self, int val) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibrary> _retval =
|
||||||
|
CefTranslatorTestCppToC::Get(self)->GetOwnPtrLibrary(
|
||||||
|
val);
|
||||||
|
|
||||||
|
// Return type: ownptr_same
|
||||||
|
return CefTranslatorTestScopedLibraryCppToC::WrapOwn(OWN_PASS(_retval));
|
||||||
|
}
|
||||||
|
|
||||||
|
int CEF_CALLBACK translator_test_set_own_ptr_library(
|
||||||
|
struct _cef_translator_test_t* self,
|
||||||
|
struct _cef_translator_test_scoped_library_t* val) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
// Verify param: val; type: ownptr_same
|
||||||
|
DCHECK(val);
|
||||||
|
if (!val)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = CefTranslatorTestCppToC::Get(self)->SetOwnPtrLibrary(
|
||||||
|
CefTranslatorTestScopedLibraryCppToC::UnwrapOwn(val));
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct _cef_translator_test_scoped_library_t* CEF_CALLBACK translator_test_set_own_ptr_library_and_return(
|
||||||
|
struct _cef_translator_test_t* self,
|
||||||
|
struct _cef_translator_test_scoped_library_t* val) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return NULL;
|
||||||
|
// Verify param: val; type: ownptr_same
|
||||||
|
DCHECK(val);
|
||||||
|
if (!val)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibrary> _retval =
|
||||||
|
CefTranslatorTestCppToC::Get(self)->SetOwnPtrLibraryAndReturn(
|
||||||
|
CefTranslatorTestScopedLibraryCppToC::UnwrapOwn(val));
|
||||||
|
|
||||||
|
// Return type: ownptr_same
|
||||||
|
return CefTranslatorTestScopedLibraryCppToC::WrapOwn(OWN_PASS(_retval));
|
||||||
|
}
|
||||||
|
|
||||||
|
int CEF_CALLBACK translator_test_set_child_own_ptr_library(
|
||||||
|
struct _cef_translator_test_t* self,
|
||||||
|
struct _cef_translator_test_scoped_library_child_t* val) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
// Verify param: val; type: ownptr_same
|
||||||
|
DCHECK(val);
|
||||||
|
if (!val)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = CefTranslatorTestCppToC::Get(self)->SetChildOwnPtrLibrary(
|
||||||
|
CefTranslatorTestScopedLibraryChildCppToC::UnwrapOwn(val));
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct _cef_translator_test_scoped_library_t* CEF_CALLBACK translator_test_set_child_own_ptr_library_and_return_parent(
|
||||||
|
struct _cef_translator_test_t* self,
|
||||||
|
struct _cef_translator_test_scoped_library_child_t* val) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return NULL;
|
||||||
|
// Verify param: val; type: ownptr_same
|
||||||
|
DCHECK(val);
|
||||||
|
if (!val)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibrary> _retval =
|
||||||
|
CefTranslatorTestCppToC::Get(self)->SetChildOwnPtrLibraryAndReturnParent(
|
||||||
|
CefTranslatorTestScopedLibraryChildCppToC::UnwrapOwn(val));
|
||||||
|
|
||||||
|
// Return type: ownptr_same
|
||||||
|
return CefTranslatorTestScopedLibraryCppToC::WrapOwn(OWN_PASS(_retval));
|
||||||
|
}
|
||||||
|
|
||||||
|
int CEF_CALLBACK translator_test_set_own_ptr_client(
|
||||||
|
struct _cef_translator_test_t* self,
|
||||||
|
struct _cef_translator_test_scoped_client_t* val) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
// Verify param: val; type: ownptr_diff
|
||||||
|
DCHECK(val);
|
||||||
|
if (!val)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Translate param: val; type: ownptr_diff
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClient> valPtr(
|
||||||
|
CefTranslatorTestScopedClientCToCpp::Wrap(val));
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = CefTranslatorTestCppToC::Get(self)->SetOwnPtrClient(
|
||||||
|
OWN_PASS(valPtr));
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct _cef_translator_test_scoped_client_t* CEF_CALLBACK translator_test_set_own_ptr_client_and_return(
|
||||||
|
struct _cef_translator_test_t* self,
|
||||||
|
struct _cef_translator_test_scoped_client_t* val) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return NULL;
|
||||||
|
// Verify param: val; type: ownptr_diff
|
||||||
|
DCHECK(val);
|
||||||
|
if (!val)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
// Translate param: val; type: ownptr_diff
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClient> valPtr(
|
||||||
|
CefTranslatorTestScopedClientCToCpp::Wrap(val));
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClient> _retval =
|
||||||
|
CefTranslatorTestCppToC::Get(self)->SetOwnPtrClientAndReturn(
|
||||||
|
OWN_PASS(valPtr));
|
||||||
|
|
||||||
|
// Return type: ownptr_diff
|
||||||
|
return CefTranslatorTestScopedClientCToCpp::UnwrapOwn(OWN_PASS(_retval));
|
||||||
|
}
|
||||||
|
|
||||||
|
int CEF_CALLBACK translator_test_set_child_own_ptr_client(
|
||||||
|
struct _cef_translator_test_t* self,
|
||||||
|
struct _cef_translator_test_scoped_client_child_t* val) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
// Verify param: val; type: ownptr_diff
|
||||||
|
DCHECK(val);
|
||||||
|
if (!val)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Translate param: val; type: ownptr_diff
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClientChild> valPtr(
|
||||||
|
CefTranslatorTestScopedClientChildCToCpp::Wrap(val));
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = CefTranslatorTestCppToC::Get(self)->SetChildOwnPtrClient(
|
||||||
|
OWN_PASS(valPtr));
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct _cef_translator_test_scoped_client_t* CEF_CALLBACK translator_test_set_child_own_ptr_client_and_return_parent(
|
||||||
|
struct _cef_translator_test_t* self,
|
||||||
|
struct _cef_translator_test_scoped_client_child_t* val) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return NULL;
|
||||||
|
// Verify param: val; type: ownptr_diff
|
||||||
|
DCHECK(val);
|
||||||
|
if (!val)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
// Translate param: val; type: ownptr_diff
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClientChild> valPtr(
|
||||||
|
CefTranslatorTestScopedClientChildCToCpp::Wrap(val));
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClient> _retval =
|
||||||
|
CefTranslatorTestCppToC::Get(self)->SetChildOwnPtrClientAndReturnParent(
|
||||||
|
OWN_PASS(valPtr));
|
||||||
|
|
||||||
|
// Return type: ownptr_diff
|
||||||
|
return CefTranslatorTestScopedClientCToCpp::UnwrapOwn(OWN_PASS(_retval));
|
||||||
|
}
|
||||||
|
|
||||||
|
int CEF_CALLBACK translator_test_set_raw_ptr_library(
|
||||||
|
struct _cef_translator_test_t* self,
|
||||||
|
struct _cef_translator_test_scoped_library_t* val) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
// Verify param: val; type: rawptr_same
|
||||||
|
DCHECK(val);
|
||||||
|
if (!val)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = CefTranslatorTestCppToC::Get(self)->SetRawPtrLibrary(
|
||||||
|
CefTranslatorTestScopedLibraryCppToC::UnwrapRaw(val));
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CEF_CALLBACK translator_test_set_child_raw_ptr_library(
|
||||||
|
struct _cef_translator_test_t* self,
|
||||||
|
struct _cef_translator_test_scoped_library_child_t* val) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
// Verify param: val; type: rawptr_same
|
||||||
|
DCHECK(val);
|
||||||
|
if (!val)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = CefTranslatorTestCppToC::Get(self)->SetChildRawPtrLibrary(
|
||||||
|
CefTranslatorTestScopedLibraryChildCppToC::UnwrapRaw(val));
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CEF_CALLBACK translator_test_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) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
// Verify param: val; type: rawptr_vec_same_byref_const
|
||||||
|
DCHECK(valCount == 0 || val);
|
||||||
|
if (valCount > 0 && !val)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Translate param: val; type: rawptr_vec_same_byref_const
|
||||||
|
std::vector<CefRawPtr<CefTranslatorTestScopedLibrary> > valList;
|
||||||
|
if (valCount > 0) {
|
||||||
|
for (size_t i = 0; i < valCount; ++i) {
|
||||||
|
CefRawPtr<CefTranslatorTestScopedLibrary> valVal =
|
||||||
|
CefTranslatorTestScopedLibraryCppToC::UnwrapRaw(val[i]);
|
||||||
|
valList.push_back(valVal);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
bool _retval = CefTranslatorTestCppToC::Get(self)->SetRawPtrLibraryList(
|
||||||
|
valList,
|
||||||
|
val1,
|
||||||
|
val2);
|
||||||
|
|
||||||
|
// Return type: bool
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CEF_CALLBACK translator_test_set_raw_ptr_client(
|
||||||
|
struct _cef_translator_test_t* self,
|
||||||
|
struct _cef_translator_test_scoped_client_t* val) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
// Verify param: val; type: rawptr_diff
|
||||||
|
DCHECK(val);
|
||||||
|
if (!val)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Translate param: val; type: rawptr_diff
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClient> valPtr(
|
||||||
|
CefTranslatorTestScopedClientCToCpp::Wrap(val));
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = CefTranslatorTestCppToC::Get(self)->SetRawPtrClient(
|
||||||
|
valPtr.get());
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CEF_CALLBACK translator_test_set_child_raw_ptr_client(
|
||||||
|
struct _cef_translator_test_t* self,
|
||||||
|
struct _cef_translator_test_scoped_client_child_t* val) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
// Verify param: val; type: rawptr_diff
|
||||||
|
DCHECK(val);
|
||||||
|
if (!val)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Translate param: val; type: rawptr_diff
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClientChild> valPtr(
|
||||||
|
CefTranslatorTestScopedClientChildCToCpp::Wrap(val));
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = CefTranslatorTestCppToC::Get(self)->SetChildRawPtrClient(
|
||||||
|
valPtr.get());
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CEF_CALLBACK translator_test_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) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
// Verify param: val; type: rawptr_vec_diff_byref_const
|
||||||
|
DCHECK(valCount == 0 || val);
|
||||||
|
if (valCount > 0 && !val)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Translate param: val; type: rawptr_vec_diff_byref_const
|
||||||
|
std::vector<CefRawPtr<CefTranslatorTestScopedClient> > valList;
|
||||||
|
if (valCount > 0) {
|
||||||
|
for (size_t i = 0; i < valCount; ++i) {
|
||||||
|
CefRawPtr<CefTranslatorTestScopedClient> valVal =
|
||||||
|
CefTranslatorTestScopedClientCToCpp::Wrap(val[i]).release();
|
||||||
|
valList.push_back(valVal);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
bool _retval = CefTranslatorTestCppToC::Get(self)->SetRawPtrClientList(
|
||||||
|
valList,
|
||||||
|
val1,
|
||||||
|
val2);
|
||||||
|
|
||||||
|
// Restore param: val; type: rawptr_vec_diff_byref_const
|
||||||
|
if (valCount > 0) {
|
||||||
|
for (size_t i = 0; i < valCount; ++i) {
|
||||||
|
delete valList[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return type: bool
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
@ -1066,24 +1447,58 @@ CefTranslatorTestCppToC::CefTranslatorTestCppToC() {
|
|||||||
GetStruct()->set_point_list = translator_test_set_point_list;
|
GetStruct()->set_point_list = translator_test_set_point_list;
|
||||||
GetStruct()->get_point_list_by_ref = translator_test_get_point_list_by_ref;
|
GetStruct()->get_point_list_by_ref = translator_test_get_point_list_by_ref;
|
||||||
GetStruct()->get_point_list_size = translator_test_get_point_list_size;
|
GetStruct()->get_point_list_size = translator_test_get_point_list_size;
|
||||||
GetStruct()->get_object = translator_test_get_object;
|
GetStruct()->get_ref_ptr_library = translator_test_get_ref_ptr_library;
|
||||||
GetStruct()->set_object = translator_test_set_object;
|
GetStruct()->set_ref_ptr_library = translator_test_set_ref_ptr_library;
|
||||||
GetStruct()->set_object_and_return = translator_test_set_object_and_return;
|
GetStruct()->set_ref_ptr_library_and_return =
|
||||||
GetStruct()->set_child_object = translator_test_set_child_object;
|
translator_test_set_ref_ptr_library_and_return;
|
||||||
GetStruct()->set_child_object_and_return_parent =
|
GetStruct()->set_child_ref_ptr_library =
|
||||||
translator_test_set_child_object_and_return_parent;
|
translator_test_set_child_ref_ptr_library;
|
||||||
GetStruct()->set_object_list = translator_test_set_object_list;
|
GetStruct()->set_child_ref_ptr_library_and_return_parent =
|
||||||
GetStruct()->get_object_list_by_ref = translator_test_get_object_list_by_ref;
|
translator_test_set_child_ref_ptr_library_and_return_parent;
|
||||||
GetStruct()->get_object_list_size = translator_test_get_object_list_size;
|
GetStruct()->set_ref_ptr_library_list =
|
||||||
GetStruct()->set_handler = translator_test_set_handler;
|
translator_test_set_ref_ptr_library_list;
|
||||||
GetStruct()->set_handler_and_return = translator_test_set_handler_and_return;
|
GetStruct()->get_ref_ptr_library_list_by_ref =
|
||||||
GetStruct()->set_child_handler = translator_test_set_child_handler;
|
translator_test_get_ref_ptr_library_list_by_ref;
|
||||||
GetStruct()->set_child_handler_and_return_parent =
|
GetStruct()->get_ref_ptr_library_list_size =
|
||||||
translator_test_set_child_handler_and_return_parent;
|
translator_test_get_ref_ptr_library_list_size;
|
||||||
GetStruct()->set_handler_list = translator_test_set_handler_list;
|
GetStruct()->set_ref_ptr_client = translator_test_set_ref_ptr_client;
|
||||||
GetStruct()->get_handler_list_by_ref =
|
GetStruct()->set_ref_ptr_client_and_return =
|
||||||
translator_test_get_handler_list_by_ref;
|
translator_test_set_ref_ptr_client_and_return;
|
||||||
GetStruct()->get_handler_list_size = translator_test_get_handler_list_size;
|
GetStruct()->set_child_ref_ptr_client =
|
||||||
|
translator_test_set_child_ref_ptr_client;
|
||||||
|
GetStruct()->set_child_ref_ptr_client_and_return_parent =
|
||||||
|
translator_test_set_child_ref_ptr_client_and_return_parent;
|
||||||
|
GetStruct()->set_ref_ptr_client_list =
|
||||||
|
translator_test_set_ref_ptr_client_list;
|
||||||
|
GetStruct()->get_ref_ptr_client_list_by_ref =
|
||||||
|
translator_test_get_ref_ptr_client_list_by_ref;
|
||||||
|
GetStruct()->get_ref_ptr_client_list_size =
|
||||||
|
translator_test_get_ref_ptr_client_list_size;
|
||||||
|
GetStruct()->get_own_ptr_library = translator_test_get_own_ptr_library;
|
||||||
|
GetStruct()->set_own_ptr_library = translator_test_set_own_ptr_library;
|
||||||
|
GetStruct()->set_own_ptr_library_and_return =
|
||||||
|
translator_test_set_own_ptr_library_and_return;
|
||||||
|
GetStruct()->set_child_own_ptr_library =
|
||||||
|
translator_test_set_child_own_ptr_library;
|
||||||
|
GetStruct()->set_child_own_ptr_library_and_return_parent =
|
||||||
|
translator_test_set_child_own_ptr_library_and_return_parent;
|
||||||
|
GetStruct()->set_own_ptr_client = translator_test_set_own_ptr_client;
|
||||||
|
GetStruct()->set_own_ptr_client_and_return =
|
||||||
|
translator_test_set_own_ptr_client_and_return;
|
||||||
|
GetStruct()->set_child_own_ptr_client =
|
||||||
|
translator_test_set_child_own_ptr_client;
|
||||||
|
GetStruct()->set_child_own_ptr_client_and_return_parent =
|
||||||
|
translator_test_set_child_own_ptr_client_and_return_parent;
|
||||||
|
GetStruct()->set_raw_ptr_library = translator_test_set_raw_ptr_library;
|
||||||
|
GetStruct()->set_child_raw_ptr_library =
|
||||||
|
translator_test_set_child_raw_ptr_library;
|
||||||
|
GetStruct()->set_raw_ptr_library_list =
|
||||||
|
translator_test_set_raw_ptr_library_list;
|
||||||
|
GetStruct()->set_raw_ptr_client = translator_test_set_raw_ptr_client;
|
||||||
|
GetStruct()->set_child_raw_ptr_client =
|
||||||
|
translator_test_set_child_raw_ptr_client;
|
||||||
|
GetStruct()->set_raw_ptr_client_list =
|
||||||
|
translator_test_set_raw_ptr_client_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<> CefRefPtr<CefTranslatorTest> CefCppToC<CefTranslatorTestCppToC,
|
template<> CefRefPtr<CefTranslatorTest> CefCppToC<CefTranslatorTestCppToC,
|
||||||
|
@ -1,79 +0,0 @@
|
|||||||
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
|
||||||
// reserved. Use of this source code is governed by a BSD-style license that
|
|
||||||
// can be found in the LICENSE file.
|
|
||||||
//
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
//
|
|
||||||
// This file was generated by the CEF translator tool. If making changes by
|
|
||||||
// hand only do so within the body of existing method and function
|
|
||||||
// implementations. See the translator.README.txt file in the tools directory
|
|
||||||
// for more information.
|
|
||||||
//
|
|
||||||
|
|
||||||
#include "libcef_dll/cpptoc/test/translator_test_handler_child_cpptoc.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
|
||||||
|
|
||||||
int CEF_CALLBACK translator_test_handler_child_get_other_value(
|
|
||||||
struct _cef_translator_test_handler_child_t* self) {
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
DCHECK(self);
|
|
||||||
if (!self)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
int _retval = CefTranslatorTestHandlerChildCppToC::Get(self)->GetOtherValue();
|
|
||||||
|
|
||||||
// Return type: simple
|
|
||||||
return _retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
int CEF_CALLBACK translator_test_handler_child_get_value(
|
|
||||||
struct _cef_translator_test_handler_t* self) {
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
DCHECK(self);
|
|
||||||
if (!self)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
int _retval = CefTranslatorTestHandlerChildCppToC::Get(
|
|
||||||
reinterpret_cast<cef_translator_test_handler_child_t*>(self))->GetValue(
|
|
||||||
);
|
|
||||||
|
|
||||||
// Return type: simple
|
|
||||||
return _retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
|
|
||||||
// CONSTRUCTOR - Do not edit by hand.
|
|
||||||
|
|
||||||
CefTranslatorTestHandlerChildCppToC::CefTranslatorTestHandlerChildCppToC() {
|
|
||||||
GetStruct()->get_other_value = translator_test_handler_child_get_other_value;
|
|
||||||
GetStruct()->base.get_value = translator_test_handler_child_get_value;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<> CefRefPtr<CefTranslatorTestHandlerChild> CefCppToC<CefTranslatorTestHandlerChildCppToC,
|
|
||||||
CefTranslatorTestHandlerChild,
|
|
||||||
cef_translator_test_handler_child_t>::UnwrapDerived(CefWrapperType type,
|
|
||||||
cef_translator_test_handler_child_t* s) {
|
|
||||||
NOTREACHED() << "Unexpected class type: " << type;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if DCHECK_IS_ON()
|
|
||||||
template<> base::AtomicRefCount CefCppToC<CefTranslatorTestHandlerChildCppToC,
|
|
||||||
CefTranslatorTestHandlerChild,
|
|
||||||
cef_translator_test_handler_child_t>::DebugObjCt = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template<> CefWrapperType CefCppToC<CefTranslatorTestHandlerChildCppToC,
|
|
||||||
CefTranslatorTestHandlerChild,
|
|
||||||
cef_translator_test_handler_child_t>::kWrapperType =
|
|
||||||
WT_TRANSLATOR_TEST_HANDLER_CHILD;
|
|
@ -1,63 +0,0 @@
|
|||||||
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
|
||||||
// reserved. Use of this source code is governed by a BSD-style license that
|
|
||||||
// can be found in the LICENSE file.
|
|
||||||
//
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
//
|
|
||||||
// This file was generated by the CEF translator tool. If making changes by
|
|
||||||
// hand only do so within the body of existing method and function
|
|
||||||
// implementations. See the translator.README.txt file in the tools directory
|
|
||||||
// for more information.
|
|
||||||
//
|
|
||||||
|
|
||||||
#include "libcef_dll/cpptoc/test/translator_test_handler_cpptoc.h"
|
|
||||||
#include "libcef_dll/cpptoc/test/translator_test_handler_child_cpptoc.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
|
||||||
|
|
||||||
int CEF_CALLBACK translator_test_handler_get_value(
|
|
||||||
struct _cef_translator_test_handler_t* self) {
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
DCHECK(self);
|
|
||||||
if (!self)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
int _retval = CefTranslatorTestHandlerCppToC::Get(self)->GetValue();
|
|
||||||
|
|
||||||
// Return type: simple
|
|
||||||
return _retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
|
|
||||||
// CONSTRUCTOR - Do not edit by hand.
|
|
||||||
|
|
||||||
CefTranslatorTestHandlerCppToC::CefTranslatorTestHandlerCppToC() {
|
|
||||||
GetStruct()->get_value = translator_test_handler_get_value;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<> CefRefPtr<CefTranslatorTestHandler> CefCppToC<CefTranslatorTestHandlerCppToC,
|
|
||||||
CefTranslatorTestHandler, cef_translator_test_handler_t>::UnwrapDerived(
|
|
||||||
CefWrapperType type, cef_translator_test_handler_t* s) {
|
|
||||||
if (type == WT_TRANSLATOR_TEST_HANDLER_CHILD) {
|
|
||||||
return CefTranslatorTestHandlerChildCppToC::Unwrap(
|
|
||||||
reinterpret_cast<cef_translator_test_handler_child_t*>(s));
|
|
||||||
}
|
|
||||||
NOTREACHED() << "Unexpected class type: " << type;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if DCHECK_IS_ON()
|
|
||||||
template<> base::AtomicRefCount CefCppToC<CefTranslatorTestHandlerCppToC,
|
|
||||||
CefTranslatorTestHandler, cef_translator_test_handler_t>::DebugObjCt = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template<> CefWrapperType CefCppToC<CefTranslatorTestHandlerCppToC,
|
|
||||||
CefTranslatorTestHandler, cef_translator_test_handler_t>::kWrapperType =
|
|
||||||
WT_TRANSLATOR_TEST_HANDLER;
|
|
@ -1,169 +0,0 @@
|
|||||||
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
|
||||||
// reserved. Use of this source code is governed by a BSD-style license that
|
|
||||||
// can be found in the LICENSE file.
|
|
||||||
//
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
//
|
|
||||||
// This file was generated by the CEF translator tool. If making changes by
|
|
||||||
// hand only do so within the body of existing method and function
|
|
||||||
// implementations. See the translator.README.txt file in the tools directory
|
|
||||||
// for more information.
|
|
||||||
//
|
|
||||||
|
|
||||||
#include "libcef_dll/cpptoc/test/translator_test_object_child_child_cpptoc.h"
|
|
||||||
|
|
||||||
|
|
||||||
// GLOBAL FUNCTIONS - Body may be edited by hand.
|
|
||||||
|
|
||||||
CEF_EXPORT cef_translator_test_object_child_child_t* cef_translator_test_object_child_child_create(
|
|
||||||
int value, int other_value, int other_other_value) {
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
CefRefPtr<CefTranslatorTestObjectChildChild> _retval =
|
|
||||||
CefTranslatorTestObjectChildChild::Create(
|
|
||||||
value,
|
|
||||||
other_value,
|
|
||||||
other_other_value);
|
|
||||||
|
|
||||||
// Return type: refptr_same
|
|
||||||
return CefTranslatorTestObjectChildChildCppToC::Wrap(_retval);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
|
||||||
|
|
||||||
int CEF_CALLBACK translator_test_object_child_child_get_other_other_value(
|
|
||||||
struct _cef_translator_test_object_child_child_t* self) {
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
DCHECK(self);
|
|
||||||
if (!self)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
int _retval = CefTranslatorTestObjectChildChildCppToC::Get(
|
|
||||||
self)->GetOtherOtherValue();
|
|
||||||
|
|
||||||
// Return type: simple
|
|
||||||
return _retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CEF_CALLBACK translator_test_object_child_child_set_other_other_value(
|
|
||||||
struct _cef_translator_test_object_child_child_t* self, int value) {
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
DCHECK(self);
|
|
||||||
if (!self)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
CefTranslatorTestObjectChildChildCppToC::Get(self)->SetOtherOtherValue(
|
|
||||||
value);
|
|
||||||
}
|
|
||||||
|
|
||||||
int CEF_CALLBACK translator_test_object_child_child_get_other_value(
|
|
||||||
struct _cef_translator_test_object_child_t* self) {
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
DCHECK(self);
|
|
||||||
if (!self)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
int _retval = CefTranslatorTestObjectChildChildCppToC::Get(
|
|
||||||
reinterpret_cast<cef_translator_test_object_child_child_t*>(
|
|
||||||
self))->GetOtherValue();
|
|
||||||
|
|
||||||
// Return type: simple
|
|
||||||
return _retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CEF_CALLBACK translator_test_object_child_child_set_other_value(
|
|
||||||
struct _cef_translator_test_object_child_t* self, int value) {
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
DCHECK(self);
|
|
||||||
if (!self)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
CefTranslatorTestObjectChildChildCppToC::Get(
|
|
||||||
reinterpret_cast<cef_translator_test_object_child_child_t*>(
|
|
||||||
self))->SetOtherValue(
|
|
||||||
value);
|
|
||||||
}
|
|
||||||
|
|
||||||
int CEF_CALLBACK translator_test_object_child_child_get_value(
|
|
||||||
struct _cef_translator_test_object_t* self) {
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
DCHECK(self);
|
|
||||||
if (!self)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
int _retval = CefTranslatorTestObjectChildChildCppToC::Get(
|
|
||||||
reinterpret_cast<cef_translator_test_object_child_child_t*>(
|
|
||||||
self))->GetValue();
|
|
||||||
|
|
||||||
// Return type: simple
|
|
||||||
return _retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CEF_CALLBACK translator_test_object_child_child_set_value(
|
|
||||||
struct _cef_translator_test_object_t* self, int value) {
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
DCHECK(self);
|
|
||||||
if (!self)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
CefTranslatorTestObjectChildChildCppToC::Get(
|
|
||||||
reinterpret_cast<cef_translator_test_object_child_child_t*>(
|
|
||||||
self))->SetValue(
|
|
||||||
value);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
|
|
||||||
// CONSTRUCTOR - Do not edit by hand.
|
|
||||||
|
|
||||||
CefTranslatorTestObjectChildChildCppToC::CefTranslatorTestObjectChildChildCppToC(
|
|
||||||
) {
|
|
||||||
GetStruct()->get_other_other_value =
|
|
||||||
translator_test_object_child_child_get_other_other_value;
|
|
||||||
GetStruct()->set_other_other_value =
|
|
||||||
translator_test_object_child_child_set_other_other_value;
|
|
||||||
GetStruct()->base.get_other_value =
|
|
||||||
translator_test_object_child_child_get_other_value;
|
|
||||||
GetStruct()->base.set_other_value =
|
|
||||||
translator_test_object_child_child_set_other_value;
|
|
||||||
GetStruct()->base.base.get_value =
|
|
||||||
translator_test_object_child_child_get_value;
|
|
||||||
GetStruct()->base.base.set_value =
|
|
||||||
translator_test_object_child_child_set_value;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<> CefRefPtr<CefTranslatorTestObjectChildChild> CefCppToC<CefTranslatorTestObjectChildChildCppToC,
|
|
||||||
CefTranslatorTestObjectChildChild,
|
|
||||||
cef_translator_test_object_child_child_t>::UnwrapDerived(
|
|
||||||
CefWrapperType type, cef_translator_test_object_child_child_t* s) {
|
|
||||||
NOTREACHED() << "Unexpected class type: " << type;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if DCHECK_IS_ON()
|
|
||||||
template<> base::AtomicRefCount CefCppToC<CefTranslatorTestObjectChildChildCppToC,
|
|
||||||
CefTranslatorTestObjectChildChild,
|
|
||||||
cef_translator_test_object_child_child_t>::DebugObjCt = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template<> CefWrapperType CefCppToC<CefTranslatorTestObjectChildChildCppToC,
|
|
||||||
CefTranslatorTestObjectChildChild,
|
|
||||||
cef_translator_test_object_child_child_t>::kWrapperType =
|
|
||||||
WT_TRANSLATOR_TEST_OBJECT_CHILD_CHILD;
|
|
@ -1,129 +0,0 @@
|
|||||||
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
|
||||||
// reserved. Use of this source code is governed by a BSD-style license that
|
|
||||||
// can be found in the LICENSE file.
|
|
||||||
//
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
//
|
|
||||||
// This file was generated by the CEF translator tool. If making changes by
|
|
||||||
// hand only do so within the body of existing method and function
|
|
||||||
// implementations. See the translator.README.txt file in the tools directory
|
|
||||||
// for more information.
|
|
||||||
//
|
|
||||||
|
|
||||||
#include "libcef_dll/cpptoc/test/translator_test_object_child_cpptoc.h"
|
|
||||||
#include "libcef_dll/cpptoc/test/translator_test_object_child_child_cpptoc.h"
|
|
||||||
|
|
||||||
|
|
||||||
// GLOBAL FUNCTIONS - Body may be edited by hand.
|
|
||||||
|
|
||||||
CEF_EXPORT cef_translator_test_object_child_t* cef_translator_test_object_child_create(
|
|
||||||
int value, int other_value) {
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
CefRefPtr<CefTranslatorTestObjectChild> _retval =
|
|
||||||
CefTranslatorTestObjectChild::Create(
|
|
||||||
value,
|
|
||||||
other_value);
|
|
||||||
|
|
||||||
// Return type: refptr_same
|
|
||||||
return CefTranslatorTestObjectChildCppToC::Wrap(_retval);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
|
||||||
|
|
||||||
int CEF_CALLBACK translator_test_object_child_get_other_value(
|
|
||||||
struct _cef_translator_test_object_child_t* self) {
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
DCHECK(self);
|
|
||||||
if (!self)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
int _retval = CefTranslatorTestObjectChildCppToC::Get(self)->GetOtherValue();
|
|
||||||
|
|
||||||
// Return type: simple
|
|
||||||
return _retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CEF_CALLBACK translator_test_object_child_set_other_value(
|
|
||||||
struct _cef_translator_test_object_child_t* self, int value) {
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
DCHECK(self);
|
|
||||||
if (!self)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
CefTranslatorTestObjectChildCppToC::Get(self)->SetOtherValue(
|
|
||||||
value);
|
|
||||||
}
|
|
||||||
|
|
||||||
int CEF_CALLBACK translator_test_object_child_get_value(
|
|
||||||
struct _cef_translator_test_object_t* self) {
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
DCHECK(self);
|
|
||||||
if (!self)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
int _retval = CefTranslatorTestObjectChildCppToC::Get(
|
|
||||||
reinterpret_cast<cef_translator_test_object_child_t*>(self))->GetValue();
|
|
||||||
|
|
||||||
// Return type: simple
|
|
||||||
return _retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CEF_CALLBACK translator_test_object_child_set_value(
|
|
||||||
struct _cef_translator_test_object_t* self, int value) {
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
DCHECK(self);
|
|
||||||
if (!self)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
CefTranslatorTestObjectChildCppToC::Get(
|
|
||||||
reinterpret_cast<cef_translator_test_object_child_t*>(self))->SetValue(
|
|
||||||
value);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
|
|
||||||
// CONSTRUCTOR - Do not edit by hand.
|
|
||||||
|
|
||||||
CefTranslatorTestObjectChildCppToC::CefTranslatorTestObjectChildCppToC() {
|
|
||||||
GetStruct()->get_other_value = translator_test_object_child_get_other_value;
|
|
||||||
GetStruct()->set_other_value = translator_test_object_child_set_other_value;
|
|
||||||
GetStruct()->base.get_value = translator_test_object_child_get_value;
|
|
||||||
GetStruct()->base.set_value = translator_test_object_child_set_value;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<> CefRefPtr<CefTranslatorTestObjectChild> CefCppToC<CefTranslatorTestObjectChildCppToC,
|
|
||||||
CefTranslatorTestObjectChild,
|
|
||||||
cef_translator_test_object_child_t>::UnwrapDerived(CefWrapperType type,
|
|
||||||
cef_translator_test_object_child_t* s) {
|
|
||||||
if (type == WT_TRANSLATOR_TEST_OBJECT_CHILD_CHILD) {
|
|
||||||
return CefTranslatorTestObjectChildChildCppToC::Unwrap(
|
|
||||||
reinterpret_cast<cef_translator_test_object_child_child_t*>(s));
|
|
||||||
}
|
|
||||||
NOTREACHED() << "Unexpected class type: " << type;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if DCHECK_IS_ON()
|
|
||||||
template<> base::AtomicRefCount CefCppToC<CefTranslatorTestObjectChildCppToC,
|
|
||||||
CefTranslatorTestObjectChild,
|
|
||||||
cef_translator_test_object_child_t>::DebugObjCt = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template<> CefWrapperType CefCppToC<CefTranslatorTestObjectChildCppToC,
|
|
||||||
CefTranslatorTestObjectChild,
|
|
||||||
cef_translator_test_object_child_t>::kWrapperType =
|
|
||||||
WT_TRANSLATOR_TEST_OBJECT_CHILD;
|
|
@ -1,97 +0,0 @@
|
|||||||
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
|
||||||
// reserved. Use of this source code is governed by a BSD-style license that
|
|
||||||
// can be found in the LICENSE file.
|
|
||||||
//
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
//
|
|
||||||
// This file was generated by the CEF translator tool. If making changes by
|
|
||||||
// hand only do so within the body of existing method and function
|
|
||||||
// implementations. See the translator.README.txt file in the tools directory
|
|
||||||
// for more information.
|
|
||||||
//
|
|
||||||
|
|
||||||
#include "libcef_dll/cpptoc/test/translator_test_object_cpptoc.h"
|
|
||||||
#include "libcef_dll/cpptoc/test/translator_test_object_child_cpptoc.h"
|
|
||||||
#include "libcef_dll/cpptoc/test/translator_test_object_child_child_cpptoc.h"
|
|
||||||
|
|
||||||
|
|
||||||
// GLOBAL FUNCTIONS - Body may be edited by hand.
|
|
||||||
|
|
||||||
CEF_EXPORT cef_translator_test_object_t* cef_translator_test_object_create(
|
|
||||||
int value) {
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
CefRefPtr<CefTranslatorTestObject> _retval = CefTranslatorTestObject::Create(
|
|
||||||
value);
|
|
||||||
|
|
||||||
// Return type: refptr_same
|
|
||||||
return CefTranslatorTestObjectCppToC::Wrap(_retval);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
|
||||||
|
|
||||||
int CEF_CALLBACK translator_test_object_get_value(
|
|
||||||
struct _cef_translator_test_object_t* self) {
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
DCHECK(self);
|
|
||||||
if (!self)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
int _retval = CefTranslatorTestObjectCppToC::Get(self)->GetValue();
|
|
||||||
|
|
||||||
// Return type: simple
|
|
||||||
return _retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CEF_CALLBACK translator_test_object_set_value(
|
|
||||||
struct _cef_translator_test_object_t* self, int value) {
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
DCHECK(self);
|
|
||||||
if (!self)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
CefTranslatorTestObjectCppToC::Get(self)->SetValue(
|
|
||||||
value);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
|
|
||||||
// CONSTRUCTOR - Do not edit by hand.
|
|
||||||
|
|
||||||
CefTranslatorTestObjectCppToC::CefTranslatorTestObjectCppToC() {
|
|
||||||
GetStruct()->get_value = translator_test_object_get_value;
|
|
||||||
GetStruct()->set_value = translator_test_object_set_value;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<> CefRefPtr<CefTranslatorTestObject> CefCppToC<CefTranslatorTestObjectCppToC,
|
|
||||||
CefTranslatorTestObject, cef_translator_test_object_t>::UnwrapDerived(
|
|
||||||
CefWrapperType type, cef_translator_test_object_t* s) {
|
|
||||||
if (type == WT_TRANSLATOR_TEST_OBJECT_CHILD) {
|
|
||||||
return CefTranslatorTestObjectChildCppToC::Unwrap(
|
|
||||||
reinterpret_cast<cef_translator_test_object_child_t*>(s));
|
|
||||||
}
|
|
||||||
if (type == WT_TRANSLATOR_TEST_OBJECT_CHILD_CHILD) {
|
|
||||||
return CefTranslatorTestObjectChildChildCppToC::Unwrap(
|
|
||||||
reinterpret_cast<cef_translator_test_object_child_child_t*>(s));
|
|
||||||
}
|
|
||||||
NOTREACHED() << "Unexpected class type: " << type;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if DCHECK_IS_ON()
|
|
||||||
template<> base::AtomicRefCount CefCppToC<CefTranslatorTestObjectCppToC,
|
|
||||||
CefTranslatorTestObject, cef_translator_test_object_t>::DebugObjCt = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template<> CefWrapperType CefCppToC<CefTranslatorTestObjectCppToC,
|
|
||||||
CefTranslatorTestObject, cef_translator_test_object_t>::kWrapperType =
|
|
||||||
WT_TRANSLATOR_TEST_OBJECT;
|
|
@ -0,0 +1,82 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This file was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||||
|
|
||||||
|
int CEF_CALLBACK translator_test_ref_ptr_client_child_get_other_value(
|
||||||
|
struct _cef_translator_test_ref_ptr_client_child_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = CefTranslatorTestRefPtrClientChildCppToC::Get(
|
||||||
|
self)->GetOtherValue();
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CEF_CALLBACK translator_test_ref_ptr_client_child_get_value(
|
||||||
|
struct _cef_translator_test_ref_ptr_client_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = CefTranslatorTestRefPtrClientChildCppToC::Get(
|
||||||
|
reinterpret_cast<cef_translator_test_ref_ptr_client_child_t*>(
|
||||||
|
self))->GetValue();
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
|
// CONSTRUCTOR - Do not edit by hand.
|
||||||
|
|
||||||
|
CefTranslatorTestRefPtrClientChildCppToC::CefTranslatorTestRefPtrClientChildCppToC(
|
||||||
|
) {
|
||||||
|
GetStruct()->get_other_value =
|
||||||
|
translator_test_ref_ptr_client_child_get_other_value;
|
||||||
|
GetStruct()->base.get_value = translator_test_ref_ptr_client_child_get_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> CefRefPtr<CefTranslatorTestRefPtrClientChild> CefCppToC<CefTranslatorTestRefPtrClientChildCppToC,
|
||||||
|
CefTranslatorTestRefPtrClientChild,
|
||||||
|
cef_translator_test_ref_ptr_client_child_t>::UnwrapDerived(
|
||||||
|
CefWrapperType type, cef_translator_test_ref_ptr_client_child_t* s) {
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if DCHECK_IS_ON()
|
||||||
|
template<> base::AtomicRefCount CefCppToC<CefTranslatorTestRefPtrClientChildCppToC,
|
||||||
|
CefTranslatorTestRefPtrClientChild,
|
||||||
|
cef_translator_test_ref_ptr_client_child_t>::DebugObjCt = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<> CefWrapperType CefCppToC<CefTranslatorTestRefPtrClientChildCppToC,
|
||||||
|
CefTranslatorTestRefPtrClientChild,
|
||||||
|
cef_translator_test_ref_ptr_client_child_t>::kWrapperType =
|
||||||
|
WT_TRANSLATOR_TEST_REF_PTR_CLIENT_CHILD;
|
@ -10,8 +10,8 @@
|
|||||||
// for more information.
|
// for more information.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_HANDLER_CPPTOC_H_
|
#ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_CLIENT_CHILD_CPPTOC_H_
|
||||||
#define CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_HANDLER_CPPTOC_H_
|
#define CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_CLIENT_CHILD_CPPTOC_H_
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if !defined(WRAPPING_CEF_SHARED)
|
#if !defined(WRAPPING_CEF_SHARED)
|
||||||
@ -24,11 +24,12 @@
|
|||||||
|
|
||||||
// Wrap a C++ class with a C structure.
|
// Wrap a C++ class with a C structure.
|
||||||
// This class may be instantiated and accessed wrapper-side only.
|
// This class may be instantiated and accessed wrapper-side only.
|
||||||
class CefTranslatorTestHandlerCppToC
|
class CefTranslatorTestRefPtrClientChildCppToC
|
||||||
: public CefCppToC<CefTranslatorTestHandlerCppToC, CefTranslatorTestHandler,
|
: public CefCppToC<CefTranslatorTestRefPtrClientChildCppToC,
|
||||||
cef_translator_test_handler_t> {
|
CefTranslatorTestRefPtrClientChild,
|
||||||
|
cef_translator_test_ref_ptr_client_child_t> {
|
||||||
public:
|
public:
|
||||||
CefTranslatorTestHandlerCppToC();
|
CefTranslatorTestRefPtrClientChildCppToC();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_HANDLER_CPPTOC_H_
|
#endif // CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_CLIENT_CHILD_CPPTOC_H_
|
@ -0,0 +1,66 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This file was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.h"
|
||||||
|
#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||||
|
|
||||||
|
int CEF_CALLBACK translator_test_ref_ptr_client_get_value(
|
||||||
|
struct _cef_translator_test_ref_ptr_client_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = CefTranslatorTestRefPtrClientCppToC::Get(self)->GetValue();
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
|
// CONSTRUCTOR - Do not edit by hand.
|
||||||
|
|
||||||
|
CefTranslatorTestRefPtrClientCppToC::CefTranslatorTestRefPtrClientCppToC() {
|
||||||
|
GetStruct()->get_value = translator_test_ref_ptr_client_get_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> CefRefPtr<CefTranslatorTestRefPtrClient> CefCppToC<CefTranslatorTestRefPtrClientCppToC,
|
||||||
|
CefTranslatorTestRefPtrClient,
|
||||||
|
cef_translator_test_ref_ptr_client_t>::UnwrapDerived(CefWrapperType type,
|
||||||
|
cef_translator_test_ref_ptr_client_t* s) {
|
||||||
|
if (type == WT_TRANSLATOR_TEST_REF_PTR_CLIENT_CHILD) {
|
||||||
|
return CefTranslatorTestRefPtrClientChildCppToC::Unwrap(
|
||||||
|
reinterpret_cast<cef_translator_test_ref_ptr_client_child_t*>(s));
|
||||||
|
}
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if DCHECK_IS_ON()
|
||||||
|
template<> base::AtomicRefCount CefCppToC<CefTranslatorTestRefPtrClientCppToC,
|
||||||
|
CefTranslatorTestRefPtrClient,
|
||||||
|
cef_translator_test_ref_ptr_client_t>::DebugObjCt = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<> CefWrapperType CefCppToC<CefTranslatorTestRefPtrClientCppToC,
|
||||||
|
CefTranslatorTestRefPtrClient,
|
||||||
|
cef_translator_test_ref_ptr_client_t>::kWrapperType =
|
||||||
|
WT_TRANSLATOR_TEST_REF_PTR_CLIENT;
|
@ -10,8 +10,8 @@
|
|||||||
// for more information.
|
// for more information.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_HANDLER_CHILD_CPPTOC_H_
|
#ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_CLIENT_CPPTOC_H_
|
||||||
#define CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_HANDLER_CHILD_CPPTOC_H_
|
#define CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_CLIENT_CPPTOC_H_
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if !defined(WRAPPING_CEF_SHARED)
|
#if !defined(WRAPPING_CEF_SHARED)
|
||||||
@ -24,11 +24,11 @@
|
|||||||
|
|
||||||
// Wrap a C++ class with a C structure.
|
// Wrap a C++ class with a C structure.
|
||||||
// This class may be instantiated and accessed wrapper-side only.
|
// This class may be instantiated and accessed wrapper-side only.
|
||||||
class CefTranslatorTestHandlerChildCppToC
|
class CefTranslatorTestRefPtrClientCppToC
|
||||||
: public CefCppToC<CefTranslatorTestHandlerChildCppToC,
|
: public CefCppToC<CefTranslatorTestRefPtrClientCppToC,
|
||||||
CefTranslatorTestHandlerChild, cef_translator_test_handler_child_t> {
|
CefTranslatorTestRefPtrClient, cef_translator_test_ref_ptr_client_t> {
|
||||||
public:
|
public:
|
||||||
CefTranslatorTestHandlerChildCppToC();
|
CefTranslatorTestRefPtrClientCppToC();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_HANDLER_CHILD_CPPTOC_H_
|
#endif // CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_CLIENT_CPPTOC_H_
|
@ -0,0 +1,171 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This file was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.h"
|
||||||
|
|
||||||
|
|
||||||
|
// GLOBAL FUNCTIONS - Body may be edited by hand.
|
||||||
|
|
||||||
|
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) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefRefPtr<CefTranslatorTestRefPtrLibraryChildChild> _retval =
|
||||||
|
CefTranslatorTestRefPtrLibraryChildChild::Create(
|
||||||
|
value,
|
||||||
|
other_value,
|
||||||
|
other_other_value);
|
||||||
|
|
||||||
|
// Return type: refptr_same
|
||||||
|
return CefTranslatorTestRefPtrLibraryChildChildCppToC::Wrap(_retval);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||||
|
|
||||||
|
int CEF_CALLBACK translator_test_ref_ptr_library_child_child_get_other_other_value(
|
||||||
|
struct _cef_translator_test_ref_ptr_library_child_child_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = CefTranslatorTestRefPtrLibraryChildChildCppToC::Get(
|
||||||
|
self)->GetOtherOtherValue();
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CEF_CALLBACK translator_test_ref_ptr_library_child_child_set_other_other_value(
|
||||||
|
struct _cef_translator_test_ref_ptr_library_child_child_t* self,
|
||||||
|
int value) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefTranslatorTestRefPtrLibraryChildChildCppToC::Get(self)->SetOtherOtherValue(
|
||||||
|
value);
|
||||||
|
}
|
||||||
|
|
||||||
|
int CEF_CALLBACK translator_test_ref_ptr_library_child_child_get_other_value(
|
||||||
|
struct _cef_translator_test_ref_ptr_library_child_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = CefTranslatorTestRefPtrLibraryChildChildCppToC::Get(
|
||||||
|
reinterpret_cast<cef_translator_test_ref_ptr_library_child_child_t*>(
|
||||||
|
self))->GetOtherValue();
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CEF_CALLBACK translator_test_ref_ptr_library_child_child_set_other_value(
|
||||||
|
struct _cef_translator_test_ref_ptr_library_child_t* self, int value) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefTranslatorTestRefPtrLibraryChildChildCppToC::Get(
|
||||||
|
reinterpret_cast<cef_translator_test_ref_ptr_library_child_child_t*>(
|
||||||
|
self))->SetOtherValue(
|
||||||
|
value);
|
||||||
|
}
|
||||||
|
|
||||||
|
int CEF_CALLBACK translator_test_ref_ptr_library_child_child_get_value(
|
||||||
|
struct _cef_translator_test_ref_ptr_library_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = CefTranslatorTestRefPtrLibraryChildChildCppToC::Get(
|
||||||
|
reinterpret_cast<cef_translator_test_ref_ptr_library_child_child_t*>(
|
||||||
|
self))->GetValue();
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CEF_CALLBACK translator_test_ref_ptr_library_child_child_set_value(
|
||||||
|
struct _cef_translator_test_ref_ptr_library_t* self, int value) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefTranslatorTestRefPtrLibraryChildChildCppToC::Get(
|
||||||
|
reinterpret_cast<cef_translator_test_ref_ptr_library_child_child_t*>(
|
||||||
|
self))->SetValue(
|
||||||
|
value);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
|
// CONSTRUCTOR - Do not edit by hand.
|
||||||
|
|
||||||
|
CefTranslatorTestRefPtrLibraryChildChildCppToC::CefTranslatorTestRefPtrLibraryChildChildCppToC(
|
||||||
|
) {
|
||||||
|
GetStruct()->get_other_other_value =
|
||||||
|
translator_test_ref_ptr_library_child_child_get_other_other_value;
|
||||||
|
GetStruct()->set_other_other_value =
|
||||||
|
translator_test_ref_ptr_library_child_child_set_other_other_value;
|
||||||
|
GetStruct()->base.get_other_value =
|
||||||
|
translator_test_ref_ptr_library_child_child_get_other_value;
|
||||||
|
GetStruct()->base.set_other_value =
|
||||||
|
translator_test_ref_ptr_library_child_child_set_other_value;
|
||||||
|
GetStruct()->base.base.get_value =
|
||||||
|
translator_test_ref_ptr_library_child_child_get_value;
|
||||||
|
GetStruct()->base.base.set_value =
|
||||||
|
translator_test_ref_ptr_library_child_child_set_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> CefRefPtr<CefTranslatorTestRefPtrLibraryChildChild> CefCppToC<CefTranslatorTestRefPtrLibraryChildChildCppToC,
|
||||||
|
CefTranslatorTestRefPtrLibraryChildChild,
|
||||||
|
cef_translator_test_ref_ptr_library_child_child_t>::UnwrapDerived(
|
||||||
|
CefWrapperType type,
|
||||||
|
cef_translator_test_ref_ptr_library_child_child_t* s) {
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if DCHECK_IS_ON()
|
||||||
|
template<> base::AtomicRefCount CefCppToC<CefTranslatorTestRefPtrLibraryChildChildCppToC,
|
||||||
|
CefTranslatorTestRefPtrLibraryChildChild,
|
||||||
|
cef_translator_test_ref_ptr_library_child_child_t>::DebugObjCt = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<> CefWrapperType CefCppToC<CefTranslatorTestRefPtrLibraryChildChildCppToC,
|
||||||
|
CefTranslatorTestRefPtrLibraryChildChild,
|
||||||
|
cef_translator_test_ref_ptr_library_child_child_t>::kWrapperType =
|
||||||
|
WT_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CHILD;
|
@ -0,0 +1,35 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This file was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CHILD_CPPTOC_H_
|
||||||
|
#define CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CHILD_CPPTOC_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#if !defined(BUILDING_CEF_SHARED)
|
||||||
|
#error This file can be included DLL-side only
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "include/test/cef_translator_test.h"
|
||||||
|
#include "include/capi/test/cef_translator_test_capi.h"
|
||||||
|
#include "libcef_dll/cpptoc/cpptoc.h"
|
||||||
|
|
||||||
|
// Wrap a C++ class with a C structure.
|
||||||
|
// This class may be instantiated and accessed DLL-side only.
|
||||||
|
class CefTranslatorTestRefPtrLibraryChildChildCppToC
|
||||||
|
: public CefCppToC<CefTranslatorTestRefPtrLibraryChildChildCppToC,
|
||||||
|
CefTranslatorTestRefPtrLibraryChildChild,
|
||||||
|
cef_translator_test_ref_ptr_library_child_child_t> {
|
||||||
|
public:
|
||||||
|
CefTranslatorTestRefPtrLibraryChildChildCppToC();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CHILD_CPPTOC_H_
|
@ -0,0 +1,136 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This file was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.h"
|
||||||
|
#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.h"
|
||||||
|
|
||||||
|
|
||||||
|
// GLOBAL FUNCTIONS - Body may be edited by hand.
|
||||||
|
|
||||||
|
CEF_EXPORT cef_translator_test_ref_ptr_library_child_t* cef_translator_test_ref_ptr_library_child_create(
|
||||||
|
int value, int other_value) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefRefPtr<CefTranslatorTestRefPtrLibraryChild> _retval =
|
||||||
|
CefTranslatorTestRefPtrLibraryChild::Create(
|
||||||
|
value,
|
||||||
|
other_value);
|
||||||
|
|
||||||
|
// Return type: refptr_same
|
||||||
|
return CefTranslatorTestRefPtrLibraryChildCppToC::Wrap(_retval);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||||
|
|
||||||
|
int CEF_CALLBACK translator_test_ref_ptr_library_child_get_other_value(
|
||||||
|
struct _cef_translator_test_ref_ptr_library_child_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = CefTranslatorTestRefPtrLibraryChildCppToC::Get(
|
||||||
|
self)->GetOtherValue();
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CEF_CALLBACK translator_test_ref_ptr_library_child_set_other_value(
|
||||||
|
struct _cef_translator_test_ref_ptr_library_child_t* self, int value) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefTranslatorTestRefPtrLibraryChildCppToC::Get(self)->SetOtherValue(
|
||||||
|
value);
|
||||||
|
}
|
||||||
|
|
||||||
|
int CEF_CALLBACK translator_test_ref_ptr_library_child_get_value(
|
||||||
|
struct _cef_translator_test_ref_ptr_library_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = CefTranslatorTestRefPtrLibraryChildCppToC::Get(
|
||||||
|
reinterpret_cast<cef_translator_test_ref_ptr_library_child_t*>(
|
||||||
|
self))->GetValue();
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CEF_CALLBACK translator_test_ref_ptr_library_child_set_value(
|
||||||
|
struct _cef_translator_test_ref_ptr_library_t* self, int value) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefTranslatorTestRefPtrLibraryChildCppToC::Get(
|
||||||
|
reinterpret_cast<cef_translator_test_ref_ptr_library_child_t*>(
|
||||||
|
self))->SetValue(
|
||||||
|
value);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
|
// CONSTRUCTOR - Do not edit by hand.
|
||||||
|
|
||||||
|
CefTranslatorTestRefPtrLibraryChildCppToC::CefTranslatorTestRefPtrLibraryChildCppToC(
|
||||||
|
) {
|
||||||
|
GetStruct()->get_other_value =
|
||||||
|
translator_test_ref_ptr_library_child_get_other_value;
|
||||||
|
GetStruct()->set_other_value =
|
||||||
|
translator_test_ref_ptr_library_child_set_other_value;
|
||||||
|
GetStruct()->base.get_value = translator_test_ref_ptr_library_child_get_value;
|
||||||
|
GetStruct()->base.set_value = translator_test_ref_ptr_library_child_set_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> CefRefPtr<CefTranslatorTestRefPtrLibraryChild> CefCppToC<CefTranslatorTestRefPtrLibraryChildCppToC,
|
||||||
|
CefTranslatorTestRefPtrLibraryChild,
|
||||||
|
cef_translator_test_ref_ptr_library_child_t>::UnwrapDerived(
|
||||||
|
CefWrapperType type, cef_translator_test_ref_ptr_library_child_t* s) {
|
||||||
|
if (type == WT_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CHILD) {
|
||||||
|
return CefTranslatorTestRefPtrLibraryChildChildCppToC::Unwrap(
|
||||||
|
reinterpret_cast<cef_translator_test_ref_ptr_library_child_child_t*>(
|
||||||
|
s));
|
||||||
|
}
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if DCHECK_IS_ON()
|
||||||
|
template<> base::AtomicRefCount CefCppToC<CefTranslatorTestRefPtrLibraryChildCppToC,
|
||||||
|
CefTranslatorTestRefPtrLibraryChild,
|
||||||
|
cef_translator_test_ref_ptr_library_child_t>::DebugObjCt = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<> CefWrapperType CefCppToC<CefTranslatorTestRefPtrLibraryChildCppToC,
|
||||||
|
CefTranslatorTestRefPtrLibraryChild,
|
||||||
|
cef_translator_test_ref_ptr_library_child_t>::kWrapperType =
|
||||||
|
WT_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD;
|
@ -10,8 +10,8 @@
|
|||||||
// for more information.
|
// for more information.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_OBJECT_CHILD_CHILD_CPPTOC_H_
|
#ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CPPTOC_H_
|
||||||
#define CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_OBJECT_CHILD_CHILD_CPPTOC_H_
|
#define CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CPPTOC_H_
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if !defined(BUILDING_CEF_SHARED)
|
#if !defined(BUILDING_CEF_SHARED)
|
||||||
@ -24,12 +24,12 @@
|
|||||||
|
|
||||||
// Wrap a C++ class with a C structure.
|
// Wrap a C++ class with a C structure.
|
||||||
// This class may be instantiated and accessed DLL-side only.
|
// This class may be instantiated and accessed DLL-side only.
|
||||||
class CefTranslatorTestObjectChildChildCppToC
|
class CefTranslatorTestRefPtrLibraryChildCppToC
|
||||||
: public CefCppToC<CefTranslatorTestObjectChildChildCppToC,
|
: public CefCppToC<CefTranslatorTestRefPtrLibraryChildCppToC,
|
||||||
CefTranslatorTestObjectChildChild,
|
CefTranslatorTestRefPtrLibraryChild,
|
||||||
cef_translator_test_object_child_child_t> {
|
cef_translator_test_ref_ptr_library_child_t> {
|
||||||
public:
|
public:
|
||||||
CefTranslatorTestObjectChildChildCppToC();
|
CefTranslatorTestRefPtrLibraryChildCppToC();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_OBJECT_CHILD_CHILD_CPPTOC_H_
|
#endif // CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CPPTOC_H_
|
102
libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.cc
Normal file
102
libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.cc
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This file was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.h"
|
||||||
|
#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.h"
|
||||||
|
#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.h"
|
||||||
|
|
||||||
|
|
||||||
|
// GLOBAL FUNCTIONS - Body may be edited by hand.
|
||||||
|
|
||||||
|
CEF_EXPORT cef_translator_test_ref_ptr_library_t* cef_translator_test_ref_ptr_library_create(
|
||||||
|
int value) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefRefPtr<CefTranslatorTestRefPtrLibrary> _retval =
|
||||||
|
CefTranslatorTestRefPtrLibrary::Create(
|
||||||
|
value);
|
||||||
|
|
||||||
|
// Return type: refptr_same
|
||||||
|
return CefTranslatorTestRefPtrLibraryCppToC::Wrap(_retval);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||||
|
|
||||||
|
int CEF_CALLBACK translator_test_ref_ptr_library_get_value(
|
||||||
|
struct _cef_translator_test_ref_ptr_library_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = CefTranslatorTestRefPtrLibraryCppToC::Get(self)->GetValue();
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CEF_CALLBACK translator_test_ref_ptr_library_set_value(
|
||||||
|
struct _cef_translator_test_ref_ptr_library_t* self, int value) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefTranslatorTestRefPtrLibraryCppToC::Get(self)->SetValue(
|
||||||
|
value);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
|
// CONSTRUCTOR - Do not edit by hand.
|
||||||
|
|
||||||
|
CefTranslatorTestRefPtrLibraryCppToC::CefTranslatorTestRefPtrLibraryCppToC() {
|
||||||
|
GetStruct()->get_value = translator_test_ref_ptr_library_get_value;
|
||||||
|
GetStruct()->set_value = translator_test_ref_ptr_library_set_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> CefRefPtr<CefTranslatorTestRefPtrLibrary> CefCppToC<CefTranslatorTestRefPtrLibraryCppToC,
|
||||||
|
CefTranslatorTestRefPtrLibrary,
|
||||||
|
cef_translator_test_ref_ptr_library_t>::UnwrapDerived(CefWrapperType type,
|
||||||
|
cef_translator_test_ref_ptr_library_t* s) {
|
||||||
|
if (type == WT_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD) {
|
||||||
|
return CefTranslatorTestRefPtrLibraryChildCppToC::Unwrap(
|
||||||
|
reinterpret_cast<cef_translator_test_ref_ptr_library_child_t*>(s));
|
||||||
|
}
|
||||||
|
if (type == WT_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CHILD) {
|
||||||
|
return CefTranslatorTestRefPtrLibraryChildChildCppToC::Unwrap(
|
||||||
|
reinterpret_cast<cef_translator_test_ref_ptr_library_child_child_t*>(
|
||||||
|
s));
|
||||||
|
}
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if DCHECK_IS_ON()
|
||||||
|
template<> base::AtomicRefCount CefCppToC<CefTranslatorTestRefPtrLibraryCppToC,
|
||||||
|
CefTranslatorTestRefPtrLibrary,
|
||||||
|
cef_translator_test_ref_ptr_library_t>::DebugObjCt = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<> CefWrapperType CefCppToC<CefTranslatorTestRefPtrLibraryCppToC,
|
||||||
|
CefTranslatorTestRefPtrLibrary,
|
||||||
|
cef_translator_test_ref_ptr_library_t>::kWrapperType =
|
||||||
|
WT_TRANSLATOR_TEST_REF_PTR_LIBRARY;
|
@ -10,8 +10,8 @@
|
|||||||
// for more information.
|
// for more information.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_OBJECT_CPPTOC_H_
|
#ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CPPTOC_H_
|
||||||
#define CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_OBJECT_CPPTOC_H_
|
#define CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CPPTOC_H_
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if !defined(BUILDING_CEF_SHARED)
|
#if !defined(BUILDING_CEF_SHARED)
|
||||||
@ -24,11 +24,12 @@
|
|||||||
|
|
||||||
// Wrap a C++ class with a C structure.
|
// Wrap a C++ class with a C structure.
|
||||||
// This class may be instantiated and accessed DLL-side only.
|
// This class may be instantiated and accessed DLL-side only.
|
||||||
class CefTranslatorTestObjectCppToC
|
class CefTranslatorTestRefPtrLibraryCppToC
|
||||||
: public CefCppToC<CefTranslatorTestObjectCppToC, CefTranslatorTestObject,
|
: public CefCppToC<CefTranslatorTestRefPtrLibraryCppToC,
|
||||||
cef_translator_test_object_t> {
|
CefTranslatorTestRefPtrLibrary,
|
||||||
|
cef_translator_test_ref_ptr_library_t> {
|
||||||
public:
|
public:
|
||||||
CefTranslatorTestObjectCppToC();
|
CefTranslatorTestRefPtrLibraryCppToC();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_OBJECT_CPPTOC_H_
|
#endif // CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CPPTOC_H_
|
@ -0,0 +1,90 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This file was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "libcef_dll/cpptoc/test/translator_test_scoped_client_child_cpptoc.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||||
|
|
||||||
|
int CEF_CALLBACK translator_test_scoped_client_child_get_other_value(
|
||||||
|
struct _cef_translator_test_scoped_client_child_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = CefTranslatorTestScopedClientChildCppToC::Get(
|
||||||
|
self)->GetOtherValue();
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CEF_CALLBACK translator_test_scoped_client_child_get_value(
|
||||||
|
struct _cef_translator_test_scoped_client_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = CefTranslatorTestScopedClientChildCppToC::Get(
|
||||||
|
reinterpret_cast<cef_translator_test_scoped_client_child_t*>(
|
||||||
|
self))->GetValue();
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
|
// CONSTRUCTOR - Do not edit by hand.
|
||||||
|
|
||||||
|
CefTranslatorTestScopedClientChildCppToC::CefTranslatorTestScopedClientChildCppToC(
|
||||||
|
) {
|
||||||
|
GetStruct()->get_other_value =
|
||||||
|
translator_test_scoped_client_child_get_other_value;
|
||||||
|
GetStruct()->base.get_value = translator_test_scoped_client_child_get_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> CefOwnPtr<CefTranslatorTestScopedClientChild> CefCppToCScoped<CefTranslatorTestScopedClientChildCppToC,
|
||||||
|
CefTranslatorTestScopedClientChild,
|
||||||
|
cef_translator_test_scoped_client_child_t>::UnwrapDerivedOwn(
|
||||||
|
CefWrapperType type, cef_translator_test_scoped_client_child_t* s) {
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return CefOwnPtr<CefTranslatorTestScopedClientChild>();
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> CefRawPtr<CefTranslatorTestScopedClientChild> CefCppToCScoped<CefTranslatorTestScopedClientChildCppToC,
|
||||||
|
CefTranslatorTestScopedClientChild,
|
||||||
|
cef_translator_test_scoped_client_child_t>::UnwrapDerivedRaw(
|
||||||
|
CefWrapperType type, cef_translator_test_scoped_client_child_t* s) {
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if DCHECK_IS_ON()
|
||||||
|
template<> base::AtomicRefCount CefCppToCScoped<CefTranslatorTestScopedClientChildCppToC,
|
||||||
|
CefTranslatorTestScopedClientChild,
|
||||||
|
cef_translator_test_scoped_client_child_t>::DebugObjCt = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<> CefWrapperType CefCppToCScoped<CefTranslatorTestScopedClientChildCppToC,
|
||||||
|
CefTranslatorTestScopedClientChild,
|
||||||
|
cef_translator_test_scoped_client_child_t>::kWrapperType =
|
||||||
|
WT_TRANSLATOR_TEST_SCOPED_CLIENT_CHILD;
|
@ -0,0 +1,35 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This file was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_CLIENT_CHILD_CPPTOC_H_
|
||||||
|
#define CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_CLIENT_CHILD_CPPTOC_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#if !defined(WRAPPING_CEF_SHARED)
|
||||||
|
#error This file can be included wrapper-side only
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "include/test/cef_translator_test.h"
|
||||||
|
#include "include/capi/test/cef_translator_test_capi.h"
|
||||||
|
#include "libcef_dll/cpptoc/cpptoc_scoped.h"
|
||||||
|
|
||||||
|
// Wrap a C++ class with a C structure.
|
||||||
|
// This class may be instantiated and accessed wrapper-side only.
|
||||||
|
class CefTranslatorTestScopedClientChildCppToC
|
||||||
|
: public CefCppToCScoped<CefTranslatorTestScopedClientChildCppToC,
|
||||||
|
CefTranslatorTestScopedClientChild,
|
||||||
|
cef_translator_test_scoped_client_child_t> {
|
||||||
|
public:
|
||||||
|
CefTranslatorTestScopedClientChildCppToC();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_CLIENT_CHILD_CPPTOC_H_
|
@ -0,0 +1,79 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This file was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.h"
|
||||||
|
#include "libcef_dll/cpptoc/test/translator_test_scoped_client_child_cpptoc.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||||
|
|
||||||
|
int CEF_CALLBACK translator_test_scoped_client_get_value(
|
||||||
|
struct _cef_translator_test_scoped_client_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = CefTranslatorTestScopedClientCppToC::Get(self)->GetValue();
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
|
// CONSTRUCTOR - Do not edit by hand.
|
||||||
|
|
||||||
|
CefTranslatorTestScopedClientCppToC::CefTranslatorTestScopedClientCppToC() {
|
||||||
|
GetStruct()->get_value = translator_test_scoped_client_get_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> CefOwnPtr<CefTranslatorTestScopedClient> CefCppToCScoped<CefTranslatorTestScopedClientCppToC,
|
||||||
|
CefTranslatorTestScopedClient,
|
||||||
|
cef_translator_test_scoped_client_t>::UnwrapDerivedOwn(CefWrapperType type,
|
||||||
|
cef_translator_test_scoped_client_t* s) {
|
||||||
|
if (type == WT_TRANSLATOR_TEST_SCOPED_CLIENT_CHILD) {
|
||||||
|
return OWN_RETURN_AS(CefTranslatorTestScopedClientChildCppToC::UnwrapOwn(
|
||||||
|
reinterpret_cast<cef_translator_test_scoped_client_child_t*>(s)),
|
||||||
|
CefTranslatorTestScopedClient);
|
||||||
|
}
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return CefOwnPtr<CefTranslatorTestScopedClient>();
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> CefRawPtr<CefTranslatorTestScopedClient> CefCppToCScoped<CefTranslatorTestScopedClientCppToC,
|
||||||
|
CefTranslatorTestScopedClient,
|
||||||
|
cef_translator_test_scoped_client_t>::UnwrapDerivedRaw(CefWrapperType type,
|
||||||
|
cef_translator_test_scoped_client_t* s) {
|
||||||
|
if (type == WT_TRANSLATOR_TEST_SCOPED_CLIENT_CHILD) {
|
||||||
|
return CefTranslatorTestScopedClientChildCppToC::UnwrapRaw(
|
||||||
|
reinterpret_cast<cef_translator_test_scoped_client_child_t*>(s));
|
||||||
|
}
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if DCHECK_IS_ON()
|
||||||
|
template<> base::AtomicRefCount CefCppToCScoped<CefTranslatorTestScopedClientCppToC,
|
||||||
|
CefTranslatorTestScopedClient,
|
||||||
|
cef_translator_test_scoped_client_t>::DebugObjCt = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<> CefWrapperType CefCppToCScoped<CefTranslatorTestScopedClientCppToC,
|
||||||
|
CefTranslatorTestScopedClient,
|
||||||
|
cef_translator_test_scoped_client_t>::kWrapperType =
|
||||||
|
WT_TRANSLATOR_TEST_SCOPED_CLIENT;
|
@ -0,0 +1,34 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This file was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_CLIENT_CPPTOC_H_
|
||||||
|
#define CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_CLIENT_CPPTOC_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#if !defined(WRAPPING_CEF_SHARED)
|
||||||
|
#error This file can be included wrapper-side only
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "include/test/cef_translator_test.h"
|
||||||
|
#include "include/capi/test/cef_translator_test_capi.h"
|
||||||
|
#include "libcef_dll/cpptoc/cpptoc_scoped.h"
|
||||||
|
|
||||||
|
// Wrap a C++ class with a C structure.
|
||||||
|
// This class may be instantiated and accessed wrapper-side only.
|
||||||
|
class CefTranslatorTestScopedClientCppToC
|
||||||
|
: public CefCppToCScoped<CefTranslatorTestScopedClientCppToC,
|
||||||
|
CefTranslatorTestScopedClient, cef_translator_test_scoped_client_t> {
|
||||||
|
public:
|
||||||
|
CefTranslatorTestScopedClientCppToC();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_CLIENT_CPPTOC_H_
|
@ -0,0 +1,179 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This file was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.h"
|
||||||
|
|
||||||
|
|
||||||
|
// GLOBAL FUNCTIONS - Body may be edited by hand.
|
||||||
|
|
||||||
|
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) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibraryChildChild> _retval =
|
||||||
|
CefTranslatorTestScopedLibraryChildChild::Create(
|
||||||
|
value,
|
||||||
|
other_value,
|
||||||
|
other_other_value);
|
||||||
|
|
||||||
|
// Return type: ownptr_same
|
||||||
|
return CefTranslatorTestScopedLibraryChildChildCppToC::WrapOwn(OWN_PASS(
|
||||||
|
_retval));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||||
|
|
||||||
|
int CEF_CALLBACK translator_test_scoped_library_child_child_get_other_other_value(
|
||||||
|
struct _cef_translator_test_scoped_library_child_child_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = CefTranslatorTestScopedLibraryChildChildCppToC::Get(
|
||||||
|
self)->GetOtherOtherValue();
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CEF_CALLBACK translator_test_scoped_library_child_child_set_other_other_value(
|
||||||
|
struct _cef_translator_test_scoped_library_child_child_t* self,
|
||||||
|
int value) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefTranslatorTestScopedLibraryChildChildCppToC::Get(self)->SetOtherOtherValue(
|
||||||
|
value);
|
||||||
|
}
|
||||||
|
|
||||||
|
int CEF_CALLBACK translator_test_scoped_library_child_child_get_other_value(
|
||||||
|
struct _cef_translator_test_scoped_library_child_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = CefTranslatorTestScopedLibraryChildChildCppToC::Get(
|
||||||
|
reinterpret_cast<cef_translator_test_scoped_library_child_child_t*>(
|
||||||
|
self))->GetOtherValue();
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CEF_CALLBACK translator_test_scoped_library_child_child_set_other_value(
|
||||||
|
struct _cef_translator_test_scoped_library_child_t* self, int value) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefTranslatorTestScopedLibraryChildChildCppToC::Get(
|
||||||
|
reinterpret_cast<cef_translator_test_scoped_library_child_child_t*>(
|
||||||
|
self))->SetOtherValue(
|
||||||
|
value);
|
||||||
|
}
|
||||||
|
|
||||||
|
int CEF_CALLBACK translator_test_scoped_library_child_child_get_value(
|
||||||
|
struct _cef_translator_test_scoped_library_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = CefTranslatorTestScopedLibraryChildChildCppToC::Get(
|
||||||
|
reinterpret_cast<cef_translator_test_scoped_library_child_child_t*>(
|
||||||
|
self))->GetValue();
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CEF_CALLBACK translator_test_scoped_library_child_child_set_value(
|
||||||
|
struct _cef_translator_test_scoped_library_t* self, int value) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefTranslatorTestScopedLibraryChildChildCppToC::Get(
|
||||||
|
reinterpret_cast<cef_translator_test_scoped_library_child_child_t*>(
|
||||||
|
self))->SetValue(
|
||||||
|
value);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
|
// CONSTRUCTOR - Do not edit by hand.
|
||||||
|
|
||||||
|
CefTranslatorTestScopedLibraryChildChildCppToC::CefTranslatorTestScopedLibraryChildChildCppToC(
|
||||||
|
) {
|
||||||
|
GetStruct()->get_other_other_value =
|
||||||
|
translator_test_scoped_library_child_child_get_other_other_value;
|
||||||
|
GetStruct()->set_other_other_value =
|
||||||
|
translator_test_scoped_library_child_child_set_other_other_value;
|
||||||
|
GetStruct()->base.get_other_value =
|
||||||
|
translator_test_scoped_library_child_child_get_other_value;
|
||||||
|
GetStruct()->base.set_other_value =
|
||||||
|
translator_test_scoped_library_child_child_set_other_value;
|
||||||
|
GetStruct()->base.base.get_value =
|
||||||
|
translator_test_scoped_library_child_child_get_value;
|
||||||
|
GetStruct()->base.base.set_value =
|
||||||
|
translator_test_scoped_library_child_child_set_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> CefOwnPtr<CefTranslatorTestScopedLibraryChildChild> CefCppToCScoped<CefTranslatorTestScopedLibraryChildChildCppToC,
|
||||||
|
CefTranslatorTestScopedLibraryChildChild,
|
||||||
|
cef_translator_test_scoped_library_child_child_t>::UnwrapDerivedOwn(
|
||||||
|
CefWrapperType type, cef_translator_test_scoped_library_child_child_t* s) {
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return CefOwnPtr<CefTranslatorTestScopedLibraryChildChild>();
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> CefRawPtr<CefTranslatorTestScopedLibraryChildChild> CefCppToCScoped<CefTranslatorTestScopedLibraryChildChildCppToC,
|
||||||
|
CefTranslatorTestScopedLibraryChildChild,
|
||||||
|
cef_translator_test_scoped_library_child_child_t>::UnwrapDerivedRaw(
|
||||||
|
CefWrapperType type, cef_translator_test_scoped_library_child_child_t* s) {
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if DCHECK_IS_ON()
|
||||||
|
template<> base::AtomicRefCount CefCppToCScoped<CefTranslatorTestScopedLibraryChildChildCppToC,
|
||||||
|
CefTranslatorTestScopedLibraryChildChild,
|
||||||
|
cef_translator_test_scoped_library_child_child_t>::DebugObjCt = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<> CefWrapperType CefCppToCScoped<CefTranslatorTestScopedLibraryChildChildCppToC,
|
||||||
|
CefTranslatorTestScopedLibraryChildChild,
|
||||||
|
cef_translator_test_scoped_library_child_child_t>::kWrapperType =
|
||||||
|
WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD;
|
@ -0,0 +1,35 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This file was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD_CPPTOC_H_
|
||||||
|
#define CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD_CPPTOC_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#if !defined(BUILDING_CEF_SHARED)
|
||||||
|
#error This file can be included DLL-side only
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "include/test/cef_translator_test.h"
|
||||||
|
#include "include/capi/test/cef_translator_test_capi.h"
|
||||||
|
#include "libcef_dll/cpptoc/cpptoc_scoped.h"
|
||||||
|
|
||||||
|
// Wrap a C++ class with a C structure.
|
||||||
|
// This class may be instantiated and accessed DLL-side only.
|
||||||
|
class CefTranslatorTestScopedLibraryChildChildCppToC
|
||||||
|
: public CefCppToCScoped<CefTranslatorTestScopedLibraryChildChildCppToC,
|
||||||
|
CefTranslatorTestScopedLibraryChildChild,
|
||||||
|
cef_translator_test_scoped_library_child_child_t> {
|
||||||
|
public:
|
||||||
|
CefTranslatorTestScopedLibraryChildChildCppToC();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD_CPPTOC_H_
|
@ -0,0 +1,150 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This file was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.h"
|
||||||
|
#include "libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.h"
|
||||||
|
|
||||||
|
|
||||||
|
// GLOBAL FUNCTIONS - Body may be edited by hand.
|
||||||
|
|
||||||
|
CEF_EXPORT cef_translator_test_scoped_library_child_t* cef_translator_test_scoped_library_child_create(
|
||||||
|
int value, int other_value) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibraryChild> _retval =
|
||||||
|
CefTranslatorTestScopedLibraryChild::Create(
|
||||||
|
value,
|
||||||
|
other_value);
|
||||||
|
|
||||||
|
// Return type: ownptr_same
|
||||||
|
return CefTranslatorTestScopedLibraryChildCppToC::WrapOwn(OWN_PASS(_retval));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||||
|
|
||||||
|
int CEF_CALLBACK translator_test_scoped_library_child_get_other_value(
|
||||||
|
struct _cef_translator_test_scoped_library_child_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = CefTranslatorTestScopedLibraryChildCppToC::Get(
|
||||||
|
self)->GetOtherValue();
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CEF_CALLBACK translator_test_scoped_library_child_set_other_value(
|
||||||
|
struct _cef_translator_test_scoped_library_child_t* self, int value) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefTranslatorTestScopedLibraryChildCppToC::Get(self)->SetOtherValue(
|
||||||
|
value);
|
||||||
|
}
|
||||||
|
|
||||||
|
int CEF_CALLBACK translator_test_scoped_library_child_get_value(
|
||||||
|
struct _cef_translator_test_scoped_library_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = CefTranslatorTestScopedLibraryChildCppToC::Get(
|
||||||
|
reinterpret_cast<cef_translator_test_scoped_library_child_t*>(
|
||||||
|
self))->GetValue();
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CEF_CALLBACK translator_test_scoped_library_child_set_value(
|
||||||
|
struct _cef_translator_test_scoped_library_t* self, int value) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefTranslatorTestScopedLibraryChildCppToC::Get(
|
||||||
|
reinterpret_cast<cef_translator_test_scoped_library_child_t*>(
|
||||||
|
self))->SetValue(
|
||||||
|
value);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
|
// CONSTRUCTOR - Do not edit by hand.
|
||||||
|
|
||||||
|
CefTranslatorTestScopedLibraryChildCppToC::CefTranslatorTestScopedLibraryChildCppToC(
|
||||||
|
) {
|
||||||
|
GetStruct()->get_other_value =
|
||||||
|
translator_test_scoped_library_child_get_other_value;
|
||||||
|
GetStruct()->set_other_value =
|
||||||
|
translator_test_scoped_library_child_set_other_value;
|
||||||
|
GetStruct()->base.get_value = translator_test_scoped_library_child_get_value;
|
||||||
|
GetStruct()->base.set_value = translator_test_scoped_library_child_set_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> CefOwnPtr<CefTranslatorTestScopedLibraryChild> CefCppToCScoped<CefTranslatorTestScopedLibraryChildCppToC,
|
||||||
|
CefTranslatorTestScopedLibraryChild,
|
||||||
|
cef_translator_test_scoped_library_child_t>::UnwrapDerivedOwn(
|
||||||
|
CefWrapperType type, cef_translator_test_scoped_library_child_t* s) {
|
||||||
|
if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD) {
|
||||||
|
return OWN_RETURN_AS(
|
||||||
|
CefTranslatorTestScopedLibraryChildChildCppToC::UnwrapOwn(
|
||||||
|
reinterpret_cast<cef_translator_test_scoped_library_child_child_t*>(s)),
|
||||||
|
CefTranslatorTestScopedLibraryChild);
|
||||||
|
}
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return CefOwnPtr<CefTranslatorTestScopedLibraryChild>();
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> CefRawPtr<CefTranslatorTestScopedLibraryChild> CefCppToCScoped<CefTranslatorTestScopedLibraryChildCppToC,
|
||||||
|
CefTranslatorTestScopedLibraryChild,
|
||||||
|
cef_translator_test_scoped_library_child_t>::UnwrapDerivedRaw(
|
||||||
|
CefWrapperType type, cef_translator_test_scoped_library_child_t* s) {
|
||||||
|
if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD) {
|
||||||
|
return CefTranslatorTestScopedLibraryChildChildCppToC::UnwrapRaw(
|
||||||
|
reinterpret_cast<cef_translator_test_scoped_library_child_child_t*>(
|
||||||
|
s));
|
||||||
|
}
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if DCHECK_IS_ON()
|
||||||
|
template<> base::AtomicRefCount CefCppToCScoped<CefTranslatorTestScopedLibraryChildCppToC,
|
||||||
|
CefTranslatorTestScopedLibraryChild,
|
||||||
|
cef_translator_test_scoped_library_child_t>::DebugObjCt = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<> CefWrapperType CefCppToCScoped<CefTranslatorTestScopedLibraryChildCppToC,
|
||||||
|
CefTranslatorTestScopedLibraryChild,
|
||||||
|
cef_translator_test_scoped_library_child_t>::kWrapperType =
|
||||||
|
WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD;
|
@ -0,0 +1,35 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This file was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CPPTOC_H_
|
||||||
|
#define CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CPPTOC_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#if !defined(BUILDING_CEF_SHARED)
|
||||||
|
#error This file can be included DLL-side only
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "include/test/cef_translator_test.h"
|
||||||
|
#include "include/capi/test/cef_translator_test_capi.h"
|
||||||
|
#include "libcef_dll/cpptoc/cpptoc_scoped.h"
|
||||||
|
|
||||||
|
// Wrap a C++ class with a C structure.
|
||||||
|
// This class may be instantiated and accessed DLL-side only.
|
||||||
|
class CefTranslatorTestScopedLibraryChildCppToC
|
||||||
|
: public CefCppToCScoped<CefTranslatorTestScopedLibraryChildCppToC,
|
||||||
|
CefTranslatorTestScopedLibraryChild,
|
||||||
|
cef_translator_test_scoped_library_child_t> {
|
||||||
|
public:
|
||||||
|
CefTranslatorTestScopedLibraryChildCppToC();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CPPTOC_H_
|
121
libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.cc
Normal file
121
libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.cc
Normal file
@ -0,0 +1,121 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This file was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.h"
|
||||||
|
#include "libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.h"
|
||||||
|
#include "libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.h"
|
||||||
|
|
||||||
|
|
||||||
|
// GLOBAL FUNCTIONS - Body may be edited by hand.
|
||||||
|
|
||||||
|
CEF_EXPORT cef_translator_test_scoped_library_t* cef_translator_test_scoped_library_create(
|
||||||
|
int value) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibrary> _retval =
|
||||||
|
CefTranslatorTestScopedLibrary::Create(
|
||||||
|
value);
|
||||||
|
|
||||||
|
// Return type: ownptr_same
|
||||||
|
return CefTranslatorTestScopedLibraryCppToC::WrapOwn(OWN_PASS(_retval));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||||
|
|
||||||
|
int CEF_CALLBACK translator_test_scoped_library_get_value(
|
||||||
|
struct _cef_translator_test_scoped_library_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = CefTranslatorTestScopedLibraryCppToC::Get(self)->GetValue();
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CEF_CALLBACK translator_test_scoped_library_set_value(
|
||||||
|
struct _cef_translator_test_scoped_library_t* self, int value) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefTranslatorTestScopedLibraryCppToC::Get(self)->SetValue(
|
||||||
|
value);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
|
// CONSTRUCTOR - Do not edit by hand.
|
||||||
|
|
||||||
|
CefTranslatorTestScopedLibraryCppToC::CefTranslatorTestScopedLibraryCppToC() {
|
||||||
|
GetStruct()->get_value = translator_test_scoped_library_get_value;
|
||||||
|
GetStruct()->set_value = translator_test_scoped_library_set_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> CefOwnPtr<CefTranslatorTestScopedLibrary> CefCppToCScoped<CefTranslatorTestScopedLibraryCppToC,
|
||||||
|
CefTranslatorTestScopedLibrary,
|
||||||
|
cef_translator_test_scoped_library_t>::UnwrapDerivedOwn(
|
||||||
|
CefWrapperType type, cef_translator_test_scoped_library_t* s) {
|
||||||
|
if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD) {
|
||||||
|
return OWN_RETURN_AS(CefTranslatorTestScopedLibraryChildCppToC::UnwrapOwn(
|
||||||
|
reinterpret_cast<cef_translator_test_scoped_library_child_t*>(s)),
|
||||||
|
CefTranslatorTestScopedLibrary);
|
||||||
|
}
|
||||||
|
if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD) {
|
||||||
|
return OWN_RETURN_AS(
|
||||||
|
CefTranslatorTestScopedLibraryChildChildCppToC::UnwrapOwn(
|
||||||
|
reinterpret_cast<cef_translator_test_scoped_library_child_child_t*>(s)),
|
||||||
|
CefTranslatorTestScopedLibrary);
|
||||||
|
}
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return CefOwnPtr<CefTranslatorTestScopedLibrary>();
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> CefRawPtr<CefTranslatorTestScopedLibrary> CefCppToCScoped<CefTranslatorTestScopedLibraryCppToC,
|
||||||
|
CefTranslatorTestScopedLibrary,
|
||||||
|
cef_translator_test_scoped_library_t>::UnwrapDerivedRaw(
|
||||||
|
CefWrapperType type, cef_translator_test_scoped_library_t* s) {
|
||||||
|
if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD) {
|
||||||
|
return CefTranslatorTestScopedLibraryChildCppToC::UnwrapRaw(
|
||||||
|
reinterpret_cast<cef_translator_test_scoped_library_child_t*>(s));
|
||||||
|
}
|
||||||
|
if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD) {
|
||||||
|
return CefTranslatorTestScopedLibraryChildChildCppToC::UnwrapRaw(
|
||||||
|
reinterpret_cast<cef_translator_test_scoped_library_child_child_t*>(
|
||||||
|
s));
|
||||||
|
}
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if DCHECK_IS_ON()
|
||||||
|
template<> base::AtomicRefCount CefCppToCScoped<CefTranslatorTestScopedLibraryCppToC,
|
||||||
|
CefTranslatorTestScopedLibrary,
|
||||||
|
cef_translator_test_scoped_library_t>::DebugObjCt = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<> CefWrapperType CefCppToCScoped<CefTranslatorTestScopedLibraryCppToC,
|
||||||
|
CefTranslatorTestScopedLibrary,
|
||||||
|
cef_translator_test_scoped_library_t>::kWrapperType =
|
||||||
|
WT_TRANSLATOR_TEST_SCOPED_LIBRARY;
|
@ -10,8 +10,8 @@
|
|||||||
// for more information.
|
// for more information.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_OBJECT_CHILD_CPPTOC_H_
|
#ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CPPTOC_H_
|
||||||
#define CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_OBJECT_CHILD_CPPTOC_H_
|
#define CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CPPTOC_H_
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if !defined(BUILDING_CEF_SHARED)
|
#if !defined(BUILDING_CEF_SHARED)
|
||||||
@ -20,15 +20,16 @@
|
|||||||
|
|
||||||
#include "include/test/cef_translator_test.h"
|
#include "include/test/cef_translator_test.h"
|
||||||
#include "include/capi/test/cef_translator_test_capi.h"
|
#include "include/capi/test/cef_translator_test_capi.h"
|
||||||
#include "libcef_dll/cpptoc/cpptoc.h"
|
#include "libcef_dll/cpptoc/cpptoc_scoped.h"
|
||||||
|
|
||||||
// Wrap a C++ class with a C structure.
|
// Wrap a C++ class with a C structure.
|
||||||
// This class may be instantiated and accessed DLL-side only.
|
// This class may be instantiated and accessed DLL-side only.
|
||||||
class CefTranslatorTestObjectChildCppToC
|
class CefTranslatorTestScopedLibraryCppToC
|
||||||
: public CefCppToC<CefTranslatorTestObjectChildCppToC,
|
: public CefCppToCScoped<CefTranslatorTestScopedLibraryCppToC,
|
||||||
CefTranslatorTestObjectChild, cef_translator_test_object_child_t> {
|
CefTranslatorTestScopedLibrary,
|
||||||
|
cef_translator_test_scoped_library_t> {
|
||||||
public:
|
public:
|
||||||
CefTranslatorTestObjectChildCppToC();
|
CefTranslatorTestScopedLibraryCppToC();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_OBJECT_CHILD_CPPTOC_H_
|
#endif // CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CPPTOC_H_
|
@ -41,21 +41,25 @@ void CefAppCToCpp::OnBeforeCommandLineProcessing(const CefString& process_type,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CefAppCToCpp::OnRegisterCustomSchemes(
|
void CefAppCToCpp::OnRegisterCustomSchemes(
|
||||||
CefRefPtr<CefSchemeRegistrar> registrar) {
|
CefRawPtr<CefSchemeRegistrar> registrar) {
|
||||||
cef_app_t* _struct = GetStruct();
|
cef_app_t* _struct = GetStruct();
|
||||||
if (CEF_MEMBER_MISSING(_struct, on_register_custom_schemes))
|
if (CEF_MEMBER_MISSING(_struct, on_register_custom_schemes))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
// Verify param: registrar; type: refptr_diff
|
// Verify param: registrar; type: rawptr_diff
|
||||||
DCHECK(registrar.get());
|
DCHECK(registrar);
|
||||||
if (!registrar.get())
|
if (!registrar)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Translate param: registrar; type: rawptr_diff
|
||||||
|
CefOwnPtr<CefSchemeRegistrarCppToC> registrarPtr(
|
||||||
|
CefSchemeRegistrarCppToC::WrapRaw(registrar));
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
_struct->on_register_custom_schemes(_struct,
|
_struct->on_register_custom_schemes(_struct,
|
||||||
CefSchemeRegistrarCppToC::Wrap(registrar));
|
registrarPtr->GetStruct());
|
||||||
}
|
}
|
||||||
|
|
||||||
CefRefPtr<CefResourceBundleHandler> CefAppCToCpp::GetResourceBundleHandler() {
|
CefRefPtr<CefResourceBundleHandler> CefAppCToCpp::GetResourceBundleHandler() {
|
||||||
|
@ -33,7 +33,7 @@ class CefAppCToCpp
|
|||||||
void OnBeforeCommandLineProcessing(const CefString& process_type,
|
void OnBeforeCommandLineProcessing(const CefString& process_type,
|
||||||
CefRefPtr<CefCommandLine> command_line) override;
|
CefRefPtr<CefCommandLine> command_line) override;
|
||||||
void OnRegisterCustomSchemes(
|
void OnRegisterCustomSchemes(
|
||||||
CefRefPtr<CefSchemeRegistrar> registrar) override;
|
CefRawPtr<CefSchemeRegistrar> registrar) override;
|
||||||
CefRefPtr<CefResourceBundleHandler> GetResourceBundleHandler() override;
|
CefRefPtr<CefResourceBundleHandler> GetResourceBundleHandler() override;
|
||||||
CefRefPtr<CefBrowserProcessHandler> GetBrowserProcessHandler() override;
|
CefRefPtr<CefBrowserProcessHandler> GetBrowserProcessHandler() override;
|
||||||
CefRefPtr<CefRenderProcessHandler> GetRenderProcessHandler() override;
|
CefRefPtr<CefRenderProcessHandler> GetRenderProcessHandler() override;
|
||||||
|
30
libcef_dll/ctocpp/base_scoped_ctocpp.cc
Normal file
30
libcef_dll/ctocpp/base_scoped_ctocpp.cc
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
|
||||||
|
#include "libcef_dll/ctocpp/base_scoped_ctocpp.h"
|
||||||
|
|
||||||
|
CefBaseScopedCToCpp::CefBaseScopedCToCpp() {
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> cef_base_scoped_t*
|
||||||
|
CefCToCppScoped<CefBaseScopedCToCpp, CefBaseScoped, cef_base_scoped_t>::
|
||||||
|
UnwrapDerivedOwn(CefWrapperType type, CefOwnPtr<CefBaseScoped> c) {
|
||||||
|
NOTREACHED();
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> cef_base_scoped_t*
|
||||||
|
CefCToCppScoped<CefBaseScopedCToCpp, CefBaseScoped, cef_base_scoped_t>::
|
||||||
|
UnwrapDerivedRaw(CefWrapperType type, CefRawPtr<CefBaseScoped> c) {
|
||||||
|
NOTREACHED();
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if DCHECK_IS_ON()
|
||||||
|
template<> base::AtomicRefCount CefCToCppScoped<CefBaseScopedCToCpp,
|
||||||
|
CefBaseScoped, cef_base_scoped_t>::DebugObjCt = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<> CefWrapperType CefCToCppScoped<CefBaseScopedCToCpp,
|
||||||
|
CefBaseScoped, cef_base_scoped_t>::kWrapperType = WT_BASE;
|
25
libcef_dll/ctocpp/base_scoped_ctocpp.h
Normal file
25
libcef_dll/ctocpp/base_scoped_ctocpp.h
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
|
||||||
|
#ifndef CEF_LIBCEF_DLL_CTOCPP_BASE_SCOPED_CTOCPP_H_
|
||||||
|
#define CEF_LIBCEF_DLL_CTOCPP_BASE_SCOPED_CTOCPP_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "include/cef_base.h"
|
||||||
|
#include "include/capi/cef_base_capi.h"
|
||||||
|
#include "libcef_dll/ctocpp/ctocpp_scoped.h"
|
||||||
|
|
||||||
|
#if !defined(BUILDING_CEF_SHARED)
|
||||||
|
#error This file can be included DLL-side only
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Wrap a C structure with a C++ class.
|
||||||
|
class CefBaseScopedCToCpp
|
||||||
|
: public CefCToCppScoped<CefBaseScopedCToCpp, CefBaseScoped,
|
||||||
|
cef_base_scoped_t> {
|
||||||
|
public:
|
||||||
|
CefBaseScopedCToCpp();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CEF_LIBCEF_DLL_CTOCPP_BASE_SCOPED_CTOCPP_H_
|
@ -26,16 +26,6 @@ class CefCToCpp : public BaseName {
|
|||||||
// return back to the other side.
|
// return back to the other side.
|
||||||
static StructName* Unwrap(CefRefPtr<BaseName> c);
|
static StructName* Unwrap(CefRefPtr<BaseName> c);
|
||||||
|
|
||||||
// If returning the structure across the DLL boundary you should call
|
|
||||||
// UnderlyingAddRef() on this wrapping CefCToCpp object. On the other side of
|
|
||||||
// the DLL boundary, call Release() on the CefCppToC object.
|
|
||||||
StructName* GetStruct() const {
|
|
||||||
WrapperStruct* wrapperStruct = GetWrapperStruct(this);
|
|
||||||
// Verify that the wrapper offset was calculated correctly.
|
|
||||||
DCHECK_EQ(kWrapperType, wrapperStruct->type_);
|
|
||||||
return wrapperStruct->struct_;
|
|
||||||
}
|
|
||||||
|
|
||||||
// CefBase methods increment/decrement reference counts on both this object
|
// CefBase methods increment/decrement reference counts on both this object
|
||||||
// and the underlying wrapped structure.
|
// and the underlying wrapped structure.
|
||||||
void AddRef() const {
|
void AddRef() const {
|
||||||
@ -63,6 +53,14 @@ class CefCToCpp : public BaseName {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If returning the structure across the DLL boundary use Unwrap() instead.
|
||||||
|
StructName* GetStruct() const {
|
||||||
|
WrapperStruct* wrapperStruct = GetWrapperStruct(this);
|
||||||
|
// Verify that the wrapper offset was calculated correctly.
|
||||||
|
DCHECK_EQ(kWrapperType, wrapperStruct->type_);
|
||||||
|
return wrapperStruct->struct_;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Used to associate this wrapper object and the structure reference received
|
// Used to associate this wrapper object and the structure reference received
|
||||||
// from the other side.
|
// from the other side.
|
||||||
|
211
libcef_dll/ctocpp/ctocpp_scoped.h
Normal file
211
libcef_dll/ctocpp/ctocpp_scoped.h
Normal file
@ -0,0 +1,211 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
|
||||||
|
#ifndef CEF_LIBCEF_DLL_CTOCPP_CTOCPP_SCOPED_H_
|
||||||
|
#define CEF_LIBCEF_DLL_CTOCPP_CTOCPP_SCOPED_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "include/base/cef_logging.h"
|
||||||
|
#include "include/base/cef_macros.h"
|
||||||
|
#include "include/cef_base.h"
|
||||||
|
#include "include/capi/cef_base_capi.h"
|
||||||
|
#include "libcef_dll/ptr_util.h"
|
||||||
|
#include "libcef_dll/wrapper_types.h"
|
||||||
|
|
||||||
|
// Wrap a C structure with a C++ class. This is used when the implementation
|
||||||
|
// exists on the other side of the DLL boundary but will have methods called on
|
||||||
|
// this side of the DLL boundary.
|
||||||
|
template <class ClassName, class BaseName, class StructName>
|
||||||
|
class CefCToCppScoped : public BaseName {
|
||||||
|
public:
|
||||||
|
// Create a new wrapper instance for a structure reference received from the
|
||||||
|
// other side. The caller owns the CToCpp wrapper instance but not necessarily
|
||||||
|
// the underling object on the CppToC side (depends if s->del is non-NULL).
|
||||||
|
// The returned wrapper object can be used as either a scoped argument or to
|
||||||
|
// pass ownership. For example:
|
||||||
|
//
|
||||||
|
// void my_method(my_type1_t* struct1, my_type2_t* struct2) {
|
||||||
|
// // Passes ownership to MyMethod1().
|
||||||
|
// MyMethod1(MyType1CToCpp::Wrap(struct1));
|
||||||
|
//
|
||||||
|
// // Passes reference to MyMethod2().
|
||||||
|
// CefOwnPtr<MyType1> obj2 = MyType2CToCpp::Wrap(struct2);
|
||||||
|
// MyMethod2(obj2.get());
|
||||||
|
// // |obj2| is deleted when my_method() goes out of scope.
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// void MyMethod1(CefOwnPtr<MyType1> obj1) {
|
||||||
|
// // |obj1| is deleted when MyMethod1() goes out of scope.
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// void MyMethod2(CefRawPtr<MyType2> obj2) {
|
||||||
|
// }
|
||||||
|
static CefOwnPtr<BaseName> Wrap(StructName* s);
|
||||||
|
|
||||||
|
// Retrieve the underlying structure reference from a wrapper instance for
|
||||||
|
// return back to the other side. Ownership will be passed back to the other
|
||||||
|
// side and the wrapper will be deleted. For example:
|
||||||
|
//
|
||||||
|
// void MyMethod(CefOwnPtr<MyType> obj) {
|
||||||
|
// // Ownership of the underlying MyType object is passed to my_method().
|
||||||
|
// my_method(MyTypeCToCpp::UnwrapOwn(obj.Pass()));
|
||||||
|
// // |obj| is now NULL.
|
||||||
|
// }
|
||||||
|
static StructName* UnwrapOwn(CefOwnPtr<BaseName> c);
|
||||||
|
|
||||||
|
// Retrieve the underlying structure reference from a wrapper instance for
|
||||||
|
// return back to the other side. Ownership does not change. For example:
|
||||||
|
//
|
||||||
|
// void MyMethod(CefRawPtr<MyType> obj) {
|
||||||
|
// // A reference is passed to my_method(). Ownership does not change.
|
||||||
|
// my_method2(MyTypeCToCpp::UnwrapRaw(obj));
|
||||||
|
// }
|
||||||
|
static StructName* UnwrapRaw(CefRawPtr<BaseName> c);
|
||||||
|
|
||||||
|
// Override delete operator to properly delete the WrapperStruct.
|
||||||
|
// ~CefCToCppScoped will be called first followed by this method.
|
||||||
|
static void operator delete(void* ptr);
|
||||||
|
|
||||||
|
#if DCHECK_IS_ON()
|
||||||
|
// Simple tracking of allocated objects.
|
||||||
|
static base::AtomicRefCount DebugObjCt; // NOLINT(runtime/int)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
protected:
|
||||||
|
CefCToCppScoped() {
|
||||||
|
#if DCHECK_IS_ON()
|
||||||
|
base::AtomicRefCountInc(&DebugObjCt);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual ~CefCToCppScoped() {
|
||||||
|
#if DCHECK_IS_ON()
|
||||||
|
base::AtomicRefCountDec(&DebugObjCt);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// If returning the structure across the DLL boundary use Unwrap() instead.
|
||||||
|
StructName* GetStruct() const {
|
||||||
|
WrapperStruct* wrapperStruct = GetWrapperStruct(this);
|
||||||
|
// Verify that the wrapper offset was calculated correctly.
|
||||||
|
DCHECK_EQ(kWrapperType, wrapperStruct->type_);
|
||||||
|
return wrapperStruct->struct_;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
// Used to associate this wrapper object and the structure reference received
|
||||||
|
// from the other side.
|
||||||
|
struct WrapperStruct;
|
||||||
|
|
||||||
|
static WrapperStruct* GetWrapperStruct(const BaseName* obj);
|
||||||
|
|
||||||
|
// Unwrap as the derived type.
|
||||||
|
static StructName* UnwrapDerivedOwn(CefWrapperType type,
|
||||||
|
CefOwnPtr<BaseName> c);
|
||||||
|
static StructName* UnwrapDerivedRaw(CefWrapperType type,
|
||||||
|
CefRawPtr<BaseName> c);
|
||||||
|
|
||||||
|
static CefWrapperType kWrapperType;
|
||||||
|
|
||||||
|
DISALLOW_COPY_AND_ASSIGN(CefCToCppScoped);
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class ClassName, class BaseName, class StructName>
|
||||||
|
struct CefCToCppScoped<ClassName,BaseName,StructName>::WrapperStruct {
|
||||||
|
CefWrapperType type_;
|
||||||
|
StructName* struct_;
|
||||||
|
ClassName wrapper_;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class ClassName, class BaseName, class StructName>
|
||||||
|
CefOwnPtr<BaseName> CefCToCppScoped<ClassName, BaseName, StructName>::Wrap(
|
||||||
|
StructName* s) {
|
||||||
|
if (!s)
|
||||||
|
return CefOwnPtr<BaseName>();
|
||||||
|
|
||||||
|
// Wrap their structure with the CefCToCpp object.
|
||||||
|
WrapperStruct* wrapperStruct = new WrapperStruct;
|
||||||
|
wrapperStruct->type_ = kWrapperType;
|
||||||
|
wrapperStruct->struct_ = s;
|
||||||
|
|
||||||
|
return CefOwnPtr<BaseName>(&wrapperStruct->wrapper_);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class ClassName, class BaseName, class StructName>
|
||||||
|
StructName* CefCToCppScoped<ClassName, BaseName, StructName>::UnwrapOwn(
|
||||||
|
CefOwnPtr<BaseName> c) {
|
||||||
|
if (!c.get())
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
WrapperStruct* wrapperStruct = GetWrapperStruct(c.get());
|
||||||
|
|
||||||
|
// If the type does not match this object then we need to unwrap as the
|
||||||
|
// derived type.
|
||||||
|
if (wrapperStruct->type_ != kWrapperType)
|
||||||
|
return UnwrapDerivedOwn(wrapperStruct->type_, OWN_PASS(c));
|
||||||
|
|
||||||
|
StructName* orig_struct = wrapperStruct->struct_;
|
||||||
|
|
||||||
|
// We should own the object currently.
|
||||||
|
cef_base_scoped_t* base = reinterpret_cast<cef_base_scoped_t*>(orig_struct);
|
||||||
|
DCHECK(base && base->del);
|
||||||
|
|
||||||
|
// Don't delete the original object when the wrapper is deleted.
|
||||||
|
wrapperStruct->struct_ = NULL;
|
||||||
|
|
||||||
|
// Return the original structure.
|
||||||
|
return orig_struct;
|
||||||
|
// The wrapper |c| is deleted when this method goes out of scope.
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class ClassName, class BaseName, class StructName>
|
||||||
|
StructName* CefCToCppScoped<ClassName, BaseName, StructName>::UnwrapRaw(
|
||||||
|
CefRawPtr<BaseName> c) {
|
||||||
|
if (!c)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
WrapperStruct* wrapperStruct = GetWrapperStruct(c);
|
||||||
|
|
||||||
|
// If the type does not match this object then we need to unwrap as the
|
||||||
|
// derived type.
|
||||||
|
if (wrapperStruct->type_ != kWrapperType)
|
||||||
|
return UnwrapDerivedRaw(wrapperStruct->type_, c);
|
||||||
|
|
||||||
|
// Return the original structure.
|
||||||
|
return wrapperStruct->struct_;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class ClassName, class BaseName, class StructName>
|
||||||
|
void CefCToCppScoped<ClassName, BaseName, StructName>::operator delete(
|
||||||
|
void* ptr) {
|
||||||
|
WrapperStruct* wrapperStruct = GetWrapperStruct(static_cast<BaseName*>(ptr));
|
||||||
|
// Verify that the wrapper offset was calculated correctly.
|
||||||
|
DCHECK_EQ(kWrapperType, wrapperStruct->type_);
|
||||||
|
|
||||||
|
// May be NULL if UnwrapOwn() was called.
|
||||||
|
cef_base_scoped_t* base =
|
||||||
|
reinterpret_cast<cef_base_scoped_t*>(wrapperStruct->struct_);
|
||||||
|
|
||||||
|
// If we own the object (base->del != NULL) then notify the other side that
|
||||||
|
// the object has been deleted.
|
||||||
|
if (base && base->del)
|
||||||
|
base->del(base);
|
||||||
|
|
||||||
|
// Delete the wrapper structure without executing ~CefCToCppScoped() an
|
||||||
|
// additional time.
|
||||||
|
::operator delete(wrapperStruct);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class ClassName, class BaseName, class StructName>
|
||||||
|
typename CefCToCppScoped<ClassName, BaseName, StructName>::WrapperStruct*
|
||||||
|
CefCToCppScoped<ClassName, BaseName, StructName>::GetWrapperStruct(
|
||||||
|
const BaseName* obj) {
|
||||||
|
// Offset using the WrapperStruct size instead of individual member sizes to
|
||||||
|
// avoid problems due to platform/compiler differences in structure padding.
|
||||||
|
return reinterpret_cast<WrapperStruct*>(
|
||||||
|
reinterpret_cast<char*>(const_cast<BaseName*>(obj)) -
|
||||||
|
(sizeof(WrapperStruct) - sizeof(ClassName)));
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // CEF_LIBCEF_DLL_CTOCPP_CTOCPP_SCOPED_H_
|
@ -48,18 +48,25 @@ bool CefSchemeRegistrarCToCpp::AddCustomScheme(const CefString& scheme_name,
|
|||||||
CefSchemeRegistrarCToCpp::CefSchemeRegistrarCToCpp() {
|
CefSchemeRegistrarCToCpp::CefSchemeRegistrarCToCpp() {
|
||||||
}
|
}
|
||||||
|
|
||||||
template<> cef_scheme_registrar_t* CefCToCpp<CefSchemeRegistrarCToCpp,
|
template<> cef_scheme_registrar_t* CefCToCppScoped<CefSchemeRegistrarCToCpp,
|
||||||
CefSchemeRegistrar, cef_scheme_registrar_t>::UnwrapDerived(
|
CefSchemeRegistrar, cef_scheme_registrar_t>::UnwrapDerivedOwn(
|
||||||
CefWrapperType type, CefSchemeRegistrar* c) {
|
CefWrapperType type, CefOwnPtr<CefSchemeRegistrar> c) {
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> cef_scheme_registrar_t* CefCToCppScoped<CefSchemeRegistrarCToCpp,
|
||||||
|
CefSchemeRegistrar, cef_scheme_registrar_t>::UnwrapDerivedRaw(
|
||||||
|
CefWrapperType type, CefRawPtr<CefSchemeRegistrar> c) {
|
||||||
NOTREACHED() << "Unexpected class type: " << type;
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if DCHECK_IS_ON()
|
#if DCHECK_IS_ON()
|
||||||
template<> base::AtomicRefCount CefCToCpp<CefSchemeRegistrarCToCpp,
|
template<> base::AtomicRefCount CefCToCppScoped<CefSchemeRegistrarCToCpp,
|
||||||
CefSchemeRegistrar, cef_scheme_registrar_t>::DebugObjCt = 0;
|
CefSchemeRegistrar, cef_scheme_registrar_t>::DebugObjCt = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
template<> CefWrapperType CefCToCpp<CefSchemeRegistrarCToCpp,
|
template<> CefWrapperType CefCToCppScoped<CefSchemeRegistrarCToCpp,
|
||||||
CefSchemeRegistrar, cef_scheme_registrar_t>::kWrapperType =
|
CefSchemeRegistrar, cef_scheme_registrar_t>::kWrapperType =
|
||||||
WT_SCHEME_REGISTRAR;
|
WT_SCHEME_REGISTRAR;
|
||||||
|
@ -20,12 +20,12 @@
|
|||||||
|
|
||||||
#include "include/cef_scheme.h"
|
#include "include/cef_scheme.h"
|
||||||
#include "include/capi/cef_scheme_capi.h"
|
#include "include/capi/cef_scheme_capi.h"
|
||||||
#include "libcef_dll/ctocpp/ctocpp.h"
|
#include "libcef_dll/ctocpp/ctocpp_scoped.h"
|
||||||
|
|
||||||
// Wrap a C structure with a C++ class.
|
// Wrap a C structure with a C++ class.
|
||||||
// This class may be instantiated and accessed wrapper-side only.
|
// This class may be instantiated and accessed wrapper-side only.
|
||||||
class CefSchemeRegistrarCToCpp
|
class CefSchemeRegistrarCToCpp
|
||||||
: public CefCToCpp<CefSchemeRegistrarCToCpp, CefSchemeRegistrar,
|
: public CefCToCppScoped<CefSchemeRegistrarCToCpp, CefSchemeRegistrar,
|
||||||
cef_scheme_registrar_t> {
|
cef_scheme_registrar_t> {
|
||||||
public:
|
public:
|
||||||
CefSchemeRegistrarCToCpp();
|
CefSchemeRegistrarCToCpp();
|
||||||
|
@ -11,11 +11,15 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include "libcef_dll/cpptoc/test/translator_test_handler_cpptoc.h"
|
#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.h"
|
||||||
#include "libcef_dll/cpptoc/test/translator_test_handler_child_cpptoc.h"
|
#include "libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.h"
|
||||||
|
#include "libcef_dll/cpptoc/test/translator_test_scoped_client_cpptoc.h"
|
||||||
|
#include "libcef_dll/cpptoc/test/translator_test_scoped_client_child_cpptoc.h"
|
||||||
#include "libcef_dll/ctocpp/test/translator_test_ctocpp.h"
|
#include "libcef_dll/ctocpp/test/translator_test_ctocpp.h"
|
||||||
#include "libcef_dll/ctocpp/test/translator_test_object_ctocpp.h"
|
#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.h"
|
||||||
#include "libcef_dll/ctocpp/test/translator_test_object_child_ctocpp.h"
|
#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.h"
|
||||||
|
#include "libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.h"
|
||||||
|
#include "libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.h"
|
||||||
#include "libcef_dll/transfer_util.h"
|
#include "libcef_dll/transfer_util.h"
|
||||||
|
|
||||||
|
|
||||||
@ -632,24 +636,27 @@ size_t CefTranslatorTestCToCpp::GetPointListSize() {
|
|||||||
return _retval;
|
return _retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
CefRefPtr<CefTranslatorTestObject> CefTranslatorTestCToCpp::GetObject(int val) {
|
CefRefPtr<CefTranslatorTestRefPtrLibrary> CefTranslatorTestCToCpp::GetRefPtrLibrary(
|
||||||
|
int val) {
|
||||||
cef_translator_test_t* _struct = GetStruct();
|
cef_translator_test_t* _struct = GetStruct();
|
||||||
if (CEF_MEMBER_MISSING(_struct, get_object))
|
if (CEF_MEMBER_MISSING(_struct, get_ref_ptr_library))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
cef_translator_test_object_t* _retval = _struct->get_object(_struct,
|
cef_translator_test_ref_ptr_library_t* _retval = _struct->get_ref_ptr_library(
|
||||||
|
_struct,
|
||||||
val);
|
val);
|
||||||
|
|
||||||
// Return type: refptr_same
|
// Return type: refptr_same
|
||||||
return CefTranslatorTestObjectCToCpp::Wrap(_retval);
|
return CefTranslatorTestRefPtrLibraryCToCpp::Wrap(_retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
int CefTranslatorTestCToCpp::SetObject(CefRefPtr<CefTranslatorTestObject> val) {
|
int CefTranslatorTestCToCpp::SetRefPtrLibrary(
|
||||||
|
CefRefPtr<CefTranslatorTestRefPtrLibrary> val) {
|
||||||
cef_translator_test_t* _struct = GetStruct();
|
cef_translator_test_t* _struct = GetStruct();
|
||||||
if (CEF_MEMBER_MISSING(_struct, set_object))
|
if (CEF_MEMBER_MISSING(_struct, set_ref_ptr_library))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
@ -660,17 +667,17 @@ int CefTranslatorTestCToCpp::SetObject(CefRefPtr<CefTranslatorTestObject> val) {
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
int _retval = _struct->set_object(_struct,
|
int _retval = _struct->set_ref_ptr_library(_struct,
|
||||||
CefTranslatorTestObjectCToCpp::Unwrap(val));
|
CefTranslatorTestRefPtrLibraryCToCpp::Unwrap(val));
|
||||||
|
|
||||||
// Return type: simple
|
// Return type: simple
|
||||||
return _retval;
|
return _retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
CefRefPtr<CefTranslatorTestObject> CefTranslatorTestCToCpp::SetObjectAndReturn(
|
CefRefPtr<CefTranslatorTestRefPtrLibrary> CefTranslatorTestCToCpp::SetRefPtrLibraryAndReturn(
|
||||||
CefRefPtr<CefTranslatorTestObject> val) {
|
CefRefPtr<CefTranslatorTestRefPtrLibrary> val) {
|
||||||
cef_translator_test_t* _struct = GetStruct();
|
cef_translator_test_t* _struct = GetStruct();
|
||||||
if (CEF_MEMBER_MISSING(_struct, set_object_and_return))
|
if (CEF_MEMBER_MISSING(_struct, set_ref_ptr_library_and_return))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
@ -681,18 +688,18 @@ CefRefPtr<CefTranslatorTestObject> CefTranslatorTestCToCpp::SetObjectAndReturn(
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
cef_translator_test_object_t* _retval = _struct->set_object_and_return(
|
cef_translator_test_ref_ptr_library_t* _retval =
|
||||||
_struct,
|
_struct->set_ref_ptr_library_and_return(_struct,
|
||||||
CefTranslatorTestObjectCToCpp::Unwrap(val));
|
CefTranslatorTestRefPtrLibraryCToCpp::Unwrap(val));
|
||||||
|
|
||||||
// Return type: refptr_same
|
// Return type: refptr_same
|
||||||
return CefTranslatorTestObjectCToCpp::Wrap(_retval);
|
return CefTranslatorTestRefPtrLibraryCToCpp::Wrap(_retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
int CefTranslatorTestCToCpp::SetChildObject(
|
int CefTranslatorTestCToCpp::SetChildRefPtrLibrary(
|
||||||
CefRefPtr<CefTranslatorTestObjectChild> val) {
|
CefRefPtr<CefTranslatorTestRefPtrLibraryChild> val) {
|
||||||
cef_translator_test_t* _struct = GetStruct();
|
cef_translator_test_t* _struct = GetStruct();
|
||||||
if (CEF_MEMBER_MISSING(_struct, set_child_object))
|
if (CEF_MEMBER_MISSING(_struct, set_child_ref_ptr_library))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
@ -703,17 +710,17 @@ int CefTranslatorTestCToCpp::SetChildObject(
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
int _retval = _struct->set_child_object(_struct,
|
int _retval = _struct->set_child_ref_ptr_library(_struct,
|
||||||
CefTranslatorTestObjectChildCToCpp::Unwrap(val));
|
CefTranslatorTestRefPtrLibraryChildCToCpp::Unwrap(val));
|
||||||
|
|
||||||
// Return type: simple
|
// Return type: simple
|
||||||
return _retval;
|
return _retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
CefRefPtr<CefTranslatorTestObject> CefTranslatorTestCToCpp::SetChildObjectAndReturnParent(
|
CefRefPtr<CefTranslatorTestRefPtrLibrary> CefTranslatorTestCToCpp::SetChildRefPtrLibraryAndReturnParent(
|
||||||
CefRefPtr<CefTranslatorTestObjectChild> val) {
|
CefRefPtr<CefTranslatorTestRefPtrLibraryChild> val) {
|
||||||
cef_translator_test_t* _struct = GetStruct();
|
cef_translator_test_t* _struct = GetStruct();
|
||||||
if (CEF_MEMBER_MISSING(_struct, set_child_object_and_return_parent))
|
if (CEF_MEMBER_MISSING(_struct, set_child_ref_ptr_library_and_return_parent))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
@ -724,38 +731,38 @@ CefRefPtr<CefTranslatorTestObject> CefTranslatorTestCToCpp::SetChildObjectAndRet
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
cef_translator_test_object_t* _retval =
|
cef_translator_test_ref_ptr_library_t* _retval =
|
||||||
_struct->set_child_object_and_return_parent(_struct,
|
_struct->set_child_ref_ptr_library_and_return_parent(_struct,
|
||||||
CefTranslatorTestObjectChildCToCpp::Unwrap(val));
|
CefTranslatorTestRefPtrLibraryChildCToCpp::Unwrap(val));
|
||||||
|
|
||||||
// Return type: refptr_same
|
// Return type: refptr_same
|
||||||
return CefTranslatorTestObjectCToCpp::Wrap(_retval);
|
return CefTranslatorTestRefPtrLibraryCToCpp::Wrap(_retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CefTranslatorTestCToCpp::SetObjectList(
|
bool CefTranslatorTestCToCpp::SetRefPtrLibraryList(
|
||||||
const std::vector<CefRefPtr<CefTranslatorTestObject>>& val, int val1,
|
const std::vector<CefRefPtr<CefTranslatorTestRefPtrLibrary>>& val, int val1,
|
||||||
int val2) {
|
int val2) {
|
||||||
cef_translator_test_t* _struct = GetStruct();
|
cef_translator_test_t* _struct = GetStruct();
|
||||||
if (CEF_MEMBER_MISSING(_struct, set_object_list))
|
if (CEF_MEMBER_MISSING(_struct, set_ref_ptr_library_list))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
// Translate param: val; type: refptr_vec_same_byref_const
|
// Translate param: val; type: refptr_vec_same_byref_const
|
||||||
const size_t valCount = val.size();
|
const size_t valCount = val.size();
|
||||||
cef_translator_test_object_t** valList = NULL;
|
cef_translator_test_ref_ptr_library_t** valList = NULL;
|
||||||
if (valCount > 0) {
|
if (valCount > 0) {
|
||||||
valList = new cef_translator_test_object_t*[valCount];
|
valList = new cef_translator_test_ref_ptr_library_t*[valCount];
|
||||||
DCHECK(valList);
|
DCHECK(valList);
|
||||||
if (valList) {
|
if (valList) {
|
||||||
for (size_t i = 0; i < valCount; ++i) {
|
for (size_t i = 0; i < valCount; ++i) {
|
||||||
valList[i] = CefTranslatorTestObjectCToCpp::Unwrap(val[i]);
|
valList[i] = CefTranslatorTestRefPtrLibraryCToCpp::Unwrap(val[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
int _retval = _struct->set_object_list(_struct,
|
int _retval = _struct->set_ref_ptr_library_list(_struct,
|
||||||
valCount,
|
valCount,
|
||||||
valList,
|
valList,
|
||||||
val1,
|
val1,
|
||||||
@ -769,33 +776,34 @@ bool CefTranslatorTestCToCpp::SetObjectList(
|
|||||||
return _retval?true:false;
|
return _retval?true:false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CefTranslatorTestCToCpp::GetObjectListByRef(ObjectList& val, int val1,
|
bool CefTranslatorTestCToCpp::GetRefPtrLibraryListByRef(RefPtrLibraryList& val,
|
||||||
int val2) {
|
int val1, int val2) {
|
||||||
cef_translator_test_t* _struct = GetStruct();
|
cef_translator_test_t* _struct = GetStruct();
|
||||||
if (CEF_MEMBER_MISSING(_struct, get_object_list_by_ref))
|
if (CEF_MEMBER_MISSING(_struct, get_ref_ptr_library_list_by_ref))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
// Translate param: val; type: refptr_vec_same_byref
|
// Translate param: val; type: refptr_vec_same_byref
|
||||||
size_t valSize = val.size();
|
size_t valSize = val.size();
|
||||||
size_t valCount = std::max(GetObjectListSize(), valSize);
|
size_t valCount = std::max(GetRefPtrLibraryListSize(), valSize);
|
||||||
cef_translator_test_object_t** valList = NULL;
|
cef_translator_test_ref_ptr_library_t** valList = NULL;
|
||||||
if (valCount > 0) {
|
if (valCount > 0) {
|
||||||
valList = new cef_translator_test_object_t*[valCount];
|
valList = new cef_translator_test_ref_ptr_library_t*[valCount];
|
||||||
DCHECK(valList);
|
DCHECK(valList);
|
||||||
if (valList) {
|
if (valList) {
|
||||||
memset(valList, 0, sizeof(cef_translator_test_object_t*)*valCount);
|
memset(valList, 0, sizeof(
|
||||||
|
cef_translator_test_ref_ptr_library_t*)*valCount);
|
||||||
}
|
}
|
||||||
if (valList && valSize > 0) {
|
if (valList && valSize > 0) {
|
||||||
for (size_t i = 0; i < valSize; ++i) {
|
for (size_t i = 0; i < valSize; ++i) {
|
||||||
valList[i] = CefTranslatorTestObjectCToCpp::Unwrap(val[i]);
|
valList[i] = CefTranslatorTestRefPtrLibraryCToCpp::Unwrap(val[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
int _retval = _struct->get_object_list_by_ref(_struct,
|
int _retval = _struct->get_ref_ptr_library_list_by_ref(_struct,
|
||||||
&valCount,
|
&valCount,
|
||||||
valList,
|
valList,
|
||||||
val1,
|
val1,
|
||||||
@ -805,7 +813,7 @@ bool CefTranslatorTestCToCpp::GetObjectListByRef(ObjectList& val, int val1,
|
|||||||
val.clear();
|
val.clear();
|
||||||
if (valCount > 0 && valList) {
|
if (valCount > 0 && valList) {
|
||||||
for (size_t i = 0; i < valCount; ++i) {
|
for (size_t i = 0; i < valCount; ++i) {
|
||||||
val.push_back(CefTranslatorTestObjectCToCpp::Wrap(valList[i]));
|
val.push_back(CefTranslatorTestRefPtrLibraryCToCpp::Wrap(valList[i]));
|
||||||
}
|
}
|
||||||
delete [] valList;
|
delete [] valList;
|
||||||
}
|
}
|
||||||
@ -814,24 +822,24 @@ bool CefTranslatorTestCToCpp::GetObjectListByRef(ObjectList& val, int val1,
|
|||||||
return _retval?true:false;
|
return _retval?true:false;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t CefTranslatorTestCToCpp::GetObjectListSize() {
|
size_t CefTranslatorTestCToCpp::GetRefPtrLibraryListSize() {
|
||||||
cef_translator_test_t* _struct = GetStruct();
|
cef_translator_test_t* _struct = GetStruct();
|
||||||
if (CEF_MEMBER_MISSING(_struct, get_object_list_size))
|
if (CEF_MEMBER_MISSING(_struct, get_ref_ptr_library_list_size))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
size_t _retval = _struct->get_object_list_size(_struct);
|
size_t _retval = _struct->get_ref_ptr_library_list_size(_struct);
|
||||||
|
|
||||||
// Return type: simple
|
// Return type: simple
|
||||||
return _retval;
|
return _retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CefTranslatorTestCToCpp::SetHandler(
|
int CefTranslatorTestCToCpp::SetRefPtrClient(
|
||||||
CefRefPtr<CefTranslatorTestHandler> val) {
|
CefRefPtr<CefTranslatorTestRefPtrClient> val) {
|
||||||
cef_translator_test_t* _struct = GetStruct();
|
cef_translator_test_t* _struct = GetStruct();
|
||||||
if (CEF_MEMBER_MISSING(_struct, set_handler))
|
if (CEF_MEMBER_MISSING(_struct, set_ref_ptr_client))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
@ -842,17 +850,17 @@ int CefTranslatorTestCToCpp::SetHandler(
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
int _retval = _struct->set_handler(_struct,
|
int _retval = _struct->set_ref_ptr_client(_struct,
|
||||||
CefTranslatorTestHandlerCppToC::Wrap(val));
|
CefTranslatorTestRefPtrClientCppToC::Wrap(val));
|
||||||
|
|
||||||
// Return type: simple
|
// Return type: simple
|
||||||
return _retval;
|
return _retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
CefRefPtr<CefTranslatorTestHandler> CefTranslatorTestCToCpp::SetHandlerAndReturn(
|
CefRefPtr<CefTranslatorTestRefPtrClient> CefTranslatorTestCToCpp::SetRefPtrClientAndReturn(
|
||||||
CefRefPtr<CefTranslatorTestHandler> val) {
|
CefRefPtr<CefTranslatorTestRefPtrClient> val) {
|
||||||
cef_translator_test_t* _struct = GetStruct();
|
cef_translator_test_t* _struct = GetStruct();
|
||||||
if (CEF_MEMBER_MISSING(_struct, set_handler_and_return))
|
if (CEF_MEMBER_MISSING(_struct, set_ref_ptr_client_and_return))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
@ -863,18 +871,18 @@ CefRefPtr<CefTranslatorTestHandler> CefTranslatorTestCToCpp::SetHandlerAndReturn
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
cef_translator_test_handler_t* _retval = _struct->set_handler_and_return(
|
cef_translator_test_ref_ptr_client_t* _retval =
|
||||||
_struct,
|
_struct->set_ref_ptr_client_and_return(_struct,
|
||||||
CefTranslatorTestHandlerCppToC::Wrap(val));
|
CefTranslatorTestRefPtrClientCppToC::Wrap(val));
|
||||||
|
|
||||||
// Return type: refptr_diff
|
// Return type: refptr_diff
|
||||||
return CefTranslatorTestHandlerCppToC::Unwrap(_retval);
|
return CefTranslatorTestRefPtrClientCppToC::Unwrap(_retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
int CefTranslatorTestCToCpp::SetChildHandler(
|
int CefTranslatorTestCToCpp::SetChildRefPtrClient(
|
||||||
CefRefPtr<CefTranslatorTestHandlerChild> val) {
|
CefRefPtr<CefTranslatorTestRefPtrClientChild> val) {
|
||||||
cef_translator_test_t* _struct = GetStruct();
|
cef_translator_test_t* _struct = GetStruct();
|
||||||
if (CEF_MEMBER_MISSING(_struct, set_child_handler))
|
if (CEF_MEMBER_MISSING(_struct, set_child_ref_ptr_client))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
@ -885,17 +893,17 @@ int CefTranslatorTestCToCpp::SetChildHandler(
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
int _retval = _struct->set_child_handler(_struct,
|
int _retval = _struct->set_child_ref_ptr_client(_struct,
|
||||||
CefTranslatorTestHandlerChildCppToC::Wrap(val));
|
CefTranslatorTestRefPtrClientChildCppToC::Wrap(val));
|
||||||
|
|
||||||
// Return type: simple
|
// Return type: simple
|
||||||
return _retval;
|
return _retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
CefRefPtr<CefTranslatorTestHandler> CefTranslatorTestCToCpp::SetChildHandlerAndReturnParent(
|
CefRefPtr<CefTranslatorTestRefPtrClient> CefTranslatorTestCToCpp::SetChildRefPtrClientAndReturnParent(
|
||||||
CefRefPtr<CefTranslatorTestHandlerChild> val) {
|
CefRefPtr<CefTranslatorTestRefPtrClientChild> val) {
|
||||||
cef_translator_test_t* _struct = GetStruct();
|
cef_translator_test_t* _struct = GetStruct();
|
||||||
if (CEF_MEMBER_MISSING(_struct, set_child_handler_and_return_parent))
|
if (CEF_MEMBER_MISSING(_struct, set_child_ref_ptr_client_and_return_parent))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
@ -906,38 +914,38 @@ CefRefPtr<CefTranslatorTestHandler> CefTranslatorTestCToCpp::SetChildHandlerAndR
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
cef_translator_test_handler_t* _retval =
|
cef_translator_test_ref_ptr_client_t* _retval =
|
||||||
_struct->set_child_handler_and_return_parent(_struct,
|
_struct->set_child_ref_ptr_client_and_return_parent(_struct,
|
||||||
CefTranslatorTestHandlerChildCppToC::Wrap(val));
|
CefTranslatorTestRefPtrClientChildCppToC::Wrap(val));
|
||||||
|
|
||||||
// Return type: refptr_diff
|
// Return type: refptr_diff
|
||||||
return CefTranslatorTestHandlerCppToC::Unwrap(_retval);
|
return CefTranslatorTestRefPtrClientCppToC::Unwrap(_retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CefTranslatorTestCToCpp::SetHandlerList(
|
bool CefTranslatorTestCToCpp::SetRefPtrClientList(
|
||||||
const std::vector<CefRefPtr<CefTranslatorTestHandler>>& val, int val1,
|
const std::vector<CefRefPtr<CefTranslatorTestRefPtrClient>>& val, int val1,
|
||||||
int val2) {
|
int val2) {
|
||||||
cef_translator_test_t* _struct = GetStruct();
|
cef_translator_test_t* _struct = GetStruct();
|
||||||
if (CEF_MEMBER_MISSING(_struct, set_handler_list))
|
if (CEF_MEMBER_MISSING(_struct, set_ref_ptr_client_list))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
// Translate param: val; type: refptr_vec_diff_byref_const
|
// Translate param: val; type: refptr_vec_diff_byref_const
|
||||||
const size_t valCount = val.size();
|
const size_t valCount = val.size();
|
||||||
cef_translator_test_handler_t** valList = NULL;
|
cef_translator_test_ref_ptr_client_t** valList = NULL;
|
||||||
if (valCount > 0) {
|
if (valCount > 0) {
|
||||||
valList = new cef_translator_test_handler_t*[valCount];
|
valList = new cef_translator_test_ref_ptr_client_t*[valCount];
|
||||||
DCHECK(valList);
|
DCHECK(valList);
|
||||||
if (valList) {
|
if (valList) {
|
||||||
for (size_t i = 0; i < valCount; ++i) {
|
for (size_t i = 0; i < valCount; ++i) {
|
||||||
valList[i] = CefTranslatorTestHandlerCppToC::Wrap(val[i]);
|
valList[i] = CefTranslatorTestRefPtrClientCppToC::Wrap(val[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
int _retval = _struct->set_handler_list(_struct,
|
int _retval = _struct->set_ref_ptr_client_list(_struct,
|
||||||
valCount,
|
valCount,
|
||||||
valList,
|
valList,
|
||||||
val1,
|
val1,
|
||||||
@ -951,11 +959,11 @@ bool CefTranslatorTestCToCpp::SetHandlerList(
|
|||||||
return _retval?true:false;
|
return _retval?true:false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CefTranslatorTestCToCpp::GetHandlerListByRef(HandlerList& val,
|
bool CefTranslatorTestCToCpp::GetRefPtrClientListByRef(RefPtrClientList& val,
|
||||||
CefRefPtr<CefTranslatorTestHandler> val1,
|
CefRefPtr<CefTranslatorTestRefPtrClient> val1,
|
||||||
CefRefPtr<CefTranslatorTestHandler> val2) {
|
CefRefPtr<CefTranslatorTestRefPtrClient> val2) {
|
||||||
cef_translator_test_t* _struct = GetStruct();
|
cef_translator_test_t* _struct = GetStruct();
|
||||||
if (CEF_MEMBER_MISSING(_struct, get_handler_list_by_ref))
|
if (CEF_MEMBER_MISSING(_struct, get_ref_ptr_client_list_by_ref))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
@ -971,33 +979,34 @@ bool CefTranslatorTestCToCpp::GetHandlerListByRef(HandlerList& val,
|
|||||||
|
|
||||||
// Translate param: val; type: refptr_vec_diff_byref
|
// Translate param: val; type: refptr_vec_diff_byref
|
||||||
size_t valSize = val.size();
|
size_t valSize = val.size();
|
||||||
size_t valCount = std::max(GetObjectListSize(), valSize);
|
size_t valCount = std::max(GetRefPtrLibraryListSize(), valSize);
|
||||||
cef_translator_test_handler_t** valList = NULL;
|
cef_translator_test_ref_ptr_client_t** valList = NULL;
|
||||||
if (valCount > 0) {
|
if (valCount > 0) {
|
||||||
valList = new cef_translator_test_handler_t*[valCount];
|
valList = new cef_translator_test_ref_ptr_client_t*[valCount];
|
||||||
DCHECK(valList);
|
DCHECK(valList);
|
||||||
if (valList) {
|
if (valList) {
|
||||||
memset(valList, 0, sizeof(cef_translator_test_handler_t*)*valCount);
|
memset(valList, 0, sizeof(
|
||||||
|
cef_translator_test_ref_ptr_client_t*)*valCount);
|
||||||
}
|
}
|
||||||
if (valList && valSize > 0) {
|
if (valList && valSize > 0) {
|
||||||
for (size_t i = 0; i < valSize; ++i) {
|
for (size_t i = 0; i < valSize; ++i) {
|
||||||
valList[i] = CefTranslatorTestHandlerCppToC::Wrap(val[i]);
|
valList[i] = CefTranslatorTestRefPtrClientCppToC::Wrap(val[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
int _retval = _struct->get_handler_list_by_ref(_struct,
|
int _retval = _struct->get_ref_ptr_client_list_by_ref(_struct,
|
||||||
&valCount,
|
&valCount,
|
||||||
valList,
|
valList,
|
||||||
CefTranslatorTestHandlerCppToC::Wrap(val1),
|
CefTranslatorTestRefPtrClientCppToC::Wrap(val1),
|
||||||
CefTranslatorTestHandlerCppToC::Wrap(val2));
|
CefTranslatorTestRefPtrClientCppToC::Wrap(val2));
|
||||||
|
|
||||||
// Restore param:val; type: refptr_vec_diff_byref
|
// Restore param:val; type: refptr_vec_diff_byref
|
||||||
val.clear();
|
val.clear();
|
||||||
if (valCount > 0 && valList) {
|
if (valCount > 0 && valList) {
|
||||||
for (size_t i = 0; i < valCount; ++i) {
|
for (size_t i = 0; i < valCount; ++i) {
|
||||||
val.push_back(CefTranslatorTestHandlerCppToC::Unwrap(valList[i]));
|
val.push_back(CefTranslatorTestRefPtrClientCppToC::Unwrap(valList[i]));
|
||||||
}
|
}
|
||||||
delete [] valList;
|
delete [] valList;
|
||||||
}
|
}
|
||||||
@ -1006,20 +1015,381 @@ bool CefTranslatorTestCToCpp::GetHandlerListByRef(HandlerList& val,
|
|||||||
return _retval?true:false;
|
return _retval?true:false;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t CefTranslatorTestCToCpp::GetHandlerListSize() {
|
size_t CefTranslatorTestCToCpp::GetRefPtrClientListSize() {
|
||||||
cef_translator_test_t* _struct = GetStruct();
|
cef_translator_test_t* _struct = GetStruct();
|
||||||
if (CEF_MEMBER_MISSING(_struct, get_handler_list_size))
|
if (CEF_MEMBER_MISSING(_struct, get_ref_ptr_client_list_size))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
size_t _retval = _struct->get_handler_list_size(_struct);
|
size_t _retval = _struct->get_ref_ptr_client_list_size(_struct);
|
||||||
|
|
||||||
// Return type: simple
|
// Return type: simple
|
||||||
return _retval;
|
return _retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibrary> CefTranslatorTestCToCpp::GetOwnPtrLibrary(
|
||||||
|
int val) {
|
||||||
|
cef_translator_test_t* _struct = GetStruct();
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, get_own_ptr_library))
|
||||||
|
return CefOwnPtr<CefTranslatorTestScopedLibrary>();
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
cef_translator_test_scoped_library_t* _retval = _struct->get_own_ptr_library(
|
||||||
|
_struct,
|
||||||
|
val);
|
||||||
|
|
||||||
|
// Return type: ownptr_same
|
||||||
|
return CefTranslatorTestScopedLibraryCToCpp::Wrap(_retval);
|
||||||
|
}
|
||||||
|
|
||||||
|
int CefTranslatorTestCToCpp::SetOwnPtrLibrary(
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibrary> val) {
|
||||||
|
cef_translator_test_t* _struct = GetStruct();
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, set_own_ptr_library))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Verify param: val; type: ownptr_same
|
||||||
|
DCHECK(val.get());
|
||||||
|
if (!val.get())
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = _struct->set_own_ptr_library(_struct,
|
||||||
|
CefTranslatorTestScopedLibraryCToCpp::UnwrapOwn(OWN_PASS(val)));
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibrary> CefTranslatorTestCToCpp::SetOwnPtrLibraryAndReturn(
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibrary> val) {
|
||||||
|
cef_translator_test_t* _struct = GetStruct();
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, set_own_ptr_library_and_return))
|
||||||
|
return CefOwnPtr<CefTranslatorTestScopedLibrary>();
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Verify param: val; type: ownptr_same
|
||||||
|
DCHECK(val.get());
|
||||||
|
if (!val.get())
|
||||||
|
return CefOwnPtr<CefTranslatorTestScopedLibrary>();
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
cef_translator_test_scoped_library_t* _retval =
|
||||||
|
_struct->set_own_ptr_library_and_return(_struct,
|
||||||
|
CefTranslatorTestScopedLibraryCToCpp::UnwrapOwn(OWN_PASS(val)));
|
||||||
|
|
||||||
|
// Return type: ownptr_same
|
||||||
|
return CefTranslatorTestScopedLibraryCToCpp::Wrap(_retval);
|
||||||
|
}
|
||||||
|
|
||||||
|
int CefTranslatorTestCToCpp::SetChildOwnPtrLibrary(
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibraryChild> val) {
|
||||||
|
cef_translator_test_t* _struct = GetStruct();
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, set_child_own_ptr_library))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Verify param: val; type: ownptr_same
|
||||||
|
DCHECK(val.get());
|
||||||
|
if (!val.get())
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = _struct->set_child_own_ptr_library(_struct,
|
||||||
|
CefTranslatorTestScopedLibraryChildCToCpp::UnwrapOwn(OWN_PASS(val)));
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibrary> CefTranslatorTestCToCpp::SetChildOwnPtrLibraryAndReturnParent(
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibraryChild> val) {
|
||||||
|
cef_translator_test_t* _struct = GetStruct();
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, set_child_own_ptr_library_and_return_parent))
|
||||||
|
return CefOwnPtr<CefTranslatorTestScopedLibrary>();
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Verify param: val; type: ownptr_same
|
||||||
|
DCHECK(val.get());
|
||||||
|
if (!val.get())
|
||||||
|
return CefOwnPtr<CefTranslatorTestScopedLibrary>();
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
cef_translator_test_scoped_library_t* _retval =
|
||||||
|
_struct->set_child_own_ptr_library_and_return_parent(_struct,
|
||||||
|
CefTranslatorTestScopedLibraryChildCToCpp::UnwrapOwn(OWN_PASS(val)));
|
||||||
|
|
||||||
|
// Return type: ownptr_same
|
||||||
|
return CefTranslatorTestScopedLibraryCToCpp::Wrap(_retval);
|
||||||
|
}
|
||||||
|
|
||||||
|
int CefTranslatorTestCToCpp::SetOwnPtrClient(
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClient> val) {
|
||||||
|
cef_translator_test_t* _struct = GetStruct();
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, set_own_ptr_client))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Verify param: val; type: ownptr_diff
|
||||||
|
DCHECK(val.get());
|
||||||
|
if (!val.get())
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = _struct->set_own_ptr_client(_struct,
|
||||||
|
CefTranslatorTestScopedClientCppToC::WrapOwn(OWN_PASS(val)));
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClient> CefTranslatorTestCToCpp::SetOwnPtrClientAndReturn(
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClient> val) {
|
||||||
|
cef_translator_test_t* _struct = GetStruct();
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, set_own_ptr_client_and_return))
|
||||||
|
return CefOwnPtr<CefTranslatorTestScopedClient>();
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Verify param: val; type: ownptr_diff
|
||||||
|
DCHECK(val.get());
|
||||||
|
if (!val.get())
|
||||||
|
return CefOwnPtr<CefTranslatorTestScopedClient>();
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
cef_translator_test_scoped_client_t* _retval =
|
||||||
|
_struct->set_own_ptr_client_and_return(_struct,
|
||||||
|
CefTranslatorTestScopedClientCppToC::WrapOwn(OWN_PASS(val)));
|
||||||
|
|
||||||
|
// Return type: ownptr_diff
|
||||||
|
return CefTranslatorTestScopedClientCppToC::UnwrapOwn(_retval);
|
||||||
|
}
|
||||||
|
|
||||||
|
int CefTranslatorTestCToCpp::SetChildOwnPtrClient(
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClientChild> val) {
|
||||||
|
cef_translator_test_t* _struct = GetStruct();
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, set_child_own_ptr_client))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Verify param: val; type: ownptr_diff
|
||||||
|
DCHECK(val.get());
|
||||||
|
if (!val.get())
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = _struct->set_child_own_ptr_client(_struct,
|
||||||
|
CefTranslatorTestScopedClientChildCppToC::WrapOwn(OWN_PASS(val)));
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClient> CefTranslatorTestCToCpp::SetChildOwnPtrClientAndReturnParent(
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClientChild> val) {
|
||||||
|
cef_translator_test_t* _struct = GetStruct();
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, set_child_own_ptr_client_and_return_parent))
|
||||||
|
return CefOwnPtr<CefTranslatorTestScopedClient>();
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Verify param: val; type: ownptr_diff
|
||||||
|
DCHECK(val.get());
|
||||||
|
if (!val.get())
|
||||||
|
return CefOwnPtr<CefTranslatorTestScopedClient>();
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
cef_translator_test_scoped_client_t* _retval =
|
||||||
|
_struct->set_child_own_ptr_client_and_return_parent(_struct,
|
||||||
|
CefTranslatorTestScopedClientChildCppToC::WrapOwn(OWN_PASS(val)));
|
||||||
|
|
||||||
|
// Return type: ownptr_diff
|
||||||
|
return CefTranslatorTestScopedClientCppToC::UnwrapOwn(_retval);
|
||||||
|
}
|
||||||
|
|
||||||
|
int CefTranslatorTestCToCpp::SetRawPtrLibrary(
|
||||||
|
CefRawPtr<CefTranslatorTestScopedLibrary> val) {
|
||||||
|
cef_translator_test_t* _struct = GetStruct();
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, set_raw_ptr_library))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Verify param: val; type: rawptr_same
|
||||||
|
DCHECK(val);
|
||||||
|
if (!val)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = _struct->set_raw_ptr_library(_struct,
|
||||||
|
CefTranslatorTestScopedLibraryCToCpp::UnwrapRaw(val));
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CefTranslatorTestCToCpp::SetChildRawPtrLibrary(
|
||||||
|
CefRawPtr<CefTranslatorTestScopedLibraryChild> val) {
|
||||||
|
cef_translator_test_t* _struct = GetStruct();
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, set_child_raw_ptr_library))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Verify param: val; type: rawptr_same
|
||||||
|
DCHECK(val);
|
||||||
|
if (!val)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = _struct->set_child_raw_ptr_library(_struct,
|
||||||
|
CefTranslatorTestScopedLibraryChildCToCpp::UnwrapRaw(val));
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CefTranslatorTestCToCpp::SetRawPtrLibraryList(
|
||||||
|
const std::vector<CefRawPtr<CefTranslatorTestScopedLibrary>>& val, int val1,
|
||||||
|
int val2) {
|
||||||
|
cef_translator_test_t* _struct = GetStruct();
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, set_raw_ptr_library_list))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Translate param: val; type: rawptr_vec_same_byref_const
|
||||||
|
const size_t valCount = val.size();
|
||||||
|
cef_translator_test_scoped_library_t** valList = NULL;
|
||||||
|
if (valCount > 0) {
|
||||||
|
valList = new cef_translator_test_scoped_library_t*[valCount];
|
||||||
|
DCHECK(valList);
|
||||||
|
if (valList) {
|
||||||
|
for (size_t i = 0; i < valCount; ++i) {
|
||||||
|
valList[i] = CefTranslatorTestScopedLibraryCToCpp::UnwrapRaw(val[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = _struct->set_raw_ptr_library_list(_struct,
|
||||||
|
valCount,
|
||||||
|
valList,
|
||||||
|
val1,
|
||||||
|
val2);
|
||||||
|
|
||||||
|
// Restore param:val; type: rawptr_vec_same_byref_const
|
||||||
|
if (valList)
|
||||||
|
delete [] valList;
|
||||||
|
|
||||||
|
// Return type: bool
|
||||||
|
return _retval?true:false;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CefTranslatorTestCToCpp::SetRawPtrClient(
|
||||||
|
CefRawPtr<CefTranslatorTestScopedClient> val) {
|
||||||
|
cef_translator_test_t* _struct = GetStruct();
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, set_raw_ptr_client))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Verify param: val; type: rawptr_diff
|
||||||
|
DCHECK(val);
|
||||||
|
if (!val)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Translate param: val; type: rawptr_diff
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClientCppToC> valPtr(
|
||||||
|
CefTranslatorTestScopedClientCppToC::WrapRaw(val));
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = _struct->set_raw_ptr_client(_struct,
|
||||||
|
valPtr->GetStruct());
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CefTranslatorTestCToCpp::SetChildRawPtrClient(
|
||||||
|
CefRawPtr<CefTranslatorTestScopedClientChild> val) {
|
||||||
|
cef_translator_test_t* _struct = GetStruct();
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, set_child_raw_ptr_client))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Verify param: val; type: rawptr_diff
|
||||||
|
DCHECK(val);
|
||||||
|
if (!val)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Translate param: val; type: rawptr_diff
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClientChildCppToC> valPtr(
|
||||||
|
CefTranslatorTestScopedClientChildCppToC::WrapRaw(val));
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = _struct->set_child_raw_ptr_client(_struct,
|
||||||
|
valPtr->GetStruct());
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CefTranslatorTestCToCpp::SetRawPtrClientList(
|
||||||
|
const std::vector<CefRawPtr<CefTranslatorTestScopedClient>>& val, int val1,
|
||||||
|
int val2) {
|
||||||
|
cef_translator_test_t* _struct = GetStruct();
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, set_raw_ptr_client_list))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Translate param: val; type: rawptr_vec_diff_byref_const
|
||||||
|
const size_t valCount = val.size();
|
||||||
|
cef_translator_test_scoped_client_t** valList = NULL;
|
||||||
|
if (valCount > 0) {
|
||||||
|
valList = new cef_translator_test_scoped_client_t*[valCount];
|
||||||
|
DCHECK(valList);
|
||||||
|
if (valList) {
|
||||||
|
for (size_t i = 0; i < valCount; ++i) {
|
||||||
|
valList[i] = CefTranslatorTestScopedClientCppToC::WrapRaw(
|
||||||
|
val[i]).release()->GetStruct();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = _struct->set_raw_ptr_client_list(_struct,
|
||||||
|
valCount,
|
||||||
|
valList,
|
||||||
|
val1,
|
||||||
|
val2);
|
||||||
|
|
||||||
|
// Restore param:val; type: rawptr_vec_diff_byref_const
|
||||||
|
if (valCount > 0) {
|
||||||
|
for (size_t i = 0; i < valCount; ++i) {
|
||||||
|
delete CefTranslatorTestScopedClientCppToC::GetWrapper(valList[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (valList)
|
||||||
|
delete [] valList;
|
||||||
|
|
||||||
|
// Return type: bool
|
||||||
|
return _retval?true:false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// CONSTRUCTOR - Do not edit by hand.
|
// CONSTRUCTOR - Do not edit by hand.
|
||||||
|
|
||||||
|
@ -64,30 +64,61 @@ class CefTranslatorTestCToCpp
|
|||||||
bool SetPointList(const std::vector<CefPoint>& val) OVERRIDE;
|
bool SetPointList(const std::vector<CefPoint>& val) OVERRIDE;
|
||||||
bool GetPointListByRef(PointList& val) OVERRIDE;
|
bool GetPointListByRef(PointList& val) OVERRIDE;
|
||||||
size_t GetPointListSize() OVERRIDE;
|
size_t GetPointListSize() OVERRIDE;
|
||||||
CefRefPtr<CefTranslatorTestObject> GetObject(int val) OVERRIDE;
|
CefRefPtr<CefTranslatorTestRefPtrLibrary> GetRefPtrLibrary(int val) OVERRIDE;
|
||||||
int SetObject(CefRefPtr<CefTranslatorTestObject> val) OVERRIDE;
|
int SetRefPtrLibrary(CefRefPtr<CefTranslatorTestRefPtrLibrary> val) OVERRIDE;
|
||||||
CefRefPtr<CefTranslatorTestObject> SetObjectAndReturn(
|
CefRefPtr<CefTranslatorTestRefPtrLibrary> SetRefPtrLibraryAndReturn(
|
||||||
CefRefPtr<CefTranslatorTestObject> val) OVERRIDE;
|
CefRefPtr<CefTranslatorTestRefPtrLibrary> val) OVERRIDE;
|
||||||
int SetChildObject(CefRefPtr<CefTranslatorTestObjectChild> val) OVERRIDE;
|
int SetChildRefPtrLibrary(
|
||||||
CefRefPtr<CefTranslatorTestObject> SetChildObjectAndReturnParent(
|
CefRefPtr<CefTranslatorTestRefPtrLibraryChild> val) OVERRIDE;
|
||||||
CefRefPtr<CefTranslatorTestObjectChild> val) OVERRIDE;
|
CefRefPtr<CefTranslatorTestRefPtrLibrary> SetChildRefPtrLibraryAndReturnParent(
|
||||||
bool SetObjectList(const std::vector<CefRefPtr<CefTranslatorTestObject>>& val,
|
CefRefPtr<CefTranslatorTestRefPtrLibraryChild> val) OVERRIDE;
|
||||||
|
bool SetRefPtrLibraryList(
|
||||||
|
const std::vector<CefRefPtr<CefTranslatorTestRefPtrLibrary>>& val,
|
||||||
int val1, int val2) OVERRIDE;
|
int val1, int val2) OVERRIDE;
|
||||||
bool GetObjectListByRef(ObjectList& val, int val1, int val2) OVERRIDE;
|
bool GetRefPtrLibraryListByRef(RefPtrLibraryList& val, int val1,
|
||||||
size_t GetObjectListSize() OVERRIDE;
|
|
||||||
int SetHandler(CefRefPtr<CefTranslatorTestHandler> val) OVERRIDE;
|
|
||||||
CefRefPtr<CefTranslatorTestHandler> SetHandlerAndReturn(
|
|
||||||
CefRefPtr<CefTranslatorTestHandler> val) OVERRIDE;
|
|
||||||
int SetChildHandler(CefRefPtr<CefTranslatorTestHandlerChild> val) OVERRIDE;
|
|
||||||
CefRefPtr<CefTranslatorTestHandler> SetChildHandlerAndReturnParent(
|
|
||||||
CefRefPtr<CefTranslatorTestHandlerChild> val) OVERRIDE;
|
|
||||||
bool SetHandlerList(
|
|
||||||
const std::vector<CefRefPtr<CefTranslatorTestHandler>>& val, int val1,
|
|
||||||
int val2) OVERRIDE;
|
int val2) OVERRIDE;
|
||||||
bool GetHandlerListByRef(HandlerList& val,
|
size_t GetRefPtrLibraryListSize() OVERRIDE;
|
||||||
CefRefPtr<CefTranslatorTestHandler> val1,
|
int SetRefPtrClient(CefRefPtr<CefTranslatorTestRefPtrClient> val) OVERRIDE;
|
||||||
CefRefPtr<CefTranslatorTestHandler> val2) OVERRIDE;
|
CefRefPtr<CefTranslatorTestRefPtrClient> SetRefPtrClientAndReturn(
|
||||||
size_t GetHandlerListSize() OVERRIDE;
|
CefRefPtr<CefTranslatorTestRefPtrClient> val) OVERRIDE;
|
||||||
|
int SetChildRefPtrClient(
|
||||||
|
CefRefPtr<CefTranslatorTestRefPtrClientChild> val) OVERRIDE;
|
||||||
|
CefRefPtr<CefTranslatorTestRefPtrClient> SetChildRefPtrClientAndReturnParent(
|
||||||
|
CefRefPtr<CefTranslatorTestRefPtrClientChild> val) OVERRIDE;
|
||||||
|
bool SetRefPtrClientList(
|
||||||
|
const std::vector<CefRefPtr<CefTranslatorTestRefPtrClient>>& val,
|
||||||
|
int val1, int val2) OVERRIDE;
|
||||||
|
bool GetRefPtrClientListByRef(RefPtrClientList& val,
|
||||||
|
CefRefPtr<CefTranslatorTestRefPtrClient> val1,
|
||||||
|
CefRefPtr<CefTranslatorTestRefPtrClient> val2) OVERRIDE;
|
||||||
|
size_t GetRefPtrClientListSize() OVERRIDE;
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibrary> GetOwnPtrLibrary(int val) OVERRIDE;
|
||||||
|
int SetOwnPtrLibrary(CefOwnPtr<CefTranslatorTestScopedLibrary> val) OVERRIDE;
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibrary> SetOwnPtrLibraryAndReturn(
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibrary> val) OVERRIDE;
|
||||||
|
int SetChildOwnPtrLibrary(
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibraryChild> val) OVERRIDE;
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibrary> SetChildOwnPtrLibraryAndReturnParent(
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibraryChild> val) OVERRIDE;
|
||||||
|
int SetOwnPtrClient(CefOwnPtr<CefTranslatorTestScopedClient> val) OVERRIDE;
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClient> SetOwnPtrClientAndReturn(
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClient> val) OVERRIDE;
|
||||||
|
int SetChildOwnPtrClient(
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClientChild> val) OVERRIDE;
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClient> SetChildOwnPtrClientAndReturnParent(
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClientChild> val) OVERRIDE;
|
||||||
|
int SetRawPtrLibrary(CefRawPtr<CefTranslatorTestScopedLibrary> val) OVERRIDE;
|
||||||
|
int SetChildRawPtrLibrary(
|
||||||
|
CefRawPtr<CefTranslatorTestScopedLibraryChild> val) OVERRIDE;
|
||||||
|
bool SetRawPtrLibraryList(
|
||||||
|
const std::vector<CefRawPtr<CefTranslatorTestScopedLibrary>>& val,
|
||||||
|
int val1, int val2) OVERRIDE;
|
||||||
|
int SetRawPtrClient(CefRawPtr<CefTranslatorTestScopedClient> val) OVERRIDE;
|
||||||
|
int SetChildRawPtrClient(
|
||||||
|
CefRawPtr<CefTranslatorTestScopedClientChild> val) OVERRIDE;
|
||||||
|
bool SetRawPtrClientList(
|
||||||
|
const std::vector<CefRawPtr<CefTranslatorTestScopedClient>>& val,
|
||||||
|
int val1, int val2) OVERRIDE;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_CTOCPP_H_
|
#endif // CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_CTOCPP_H_
|
||||||
|
@ -1,58 +0,0 @@
|
|||||||
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
|
||||||
// reserved. Use of this source code is governed by a BSD-style license that
|
|
||||||
// can be found in the LICENSE file.
|
|
||||||
//
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
//
|
|
||||||
// This file was generated by the CEF translator tool. If making changes by
|
|
||||||
// hand only do so within the body of existing method and function
|
|
||||||
// implementations. See the translator.README.txt file in the tools directory
|
|
||||||
// for more information.
|
|
||||||
//
|
|
||||||
|
|
||||||
#include "libcef_dll/ctocpp/test/translator_test_handler_ctocpp.h"
|
|
||||||
#include "libcef_dll/ctocpp/test/translator_test_handler_child_ctocpp.h"
|
|
||||||
|
|
||||||
|
|
||||||
// VIRTUAL METHODS - Body may be edited by hand.
|
|
||||||
|
|
||||||
int CefTranslatorTestHandlerCToCpp::GetValue() {
|
|
||||||
cef_translator_test_handler_t* _struct = GetStruct();
|
|
||||||
if (CEF_MEMBER_MISSING(_struct, get_value))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
int _retval = _struct->get_value(_struct);
|
|
||||||
|
|
||||||
// Return type: simple
|
|
||||||
return _retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// CONSTRUCTOR - Do not edit by hand.
|
|
||||||
|
|
||||||
CefTranslatorTestHandlerCToCpp::CefTranslatorTestHandlerCToCpp() {
|
|
||||||
}
|
|
||||||
|
|
||||||
template<> cef_translator_test_handler_t* CefCToCpp<CefTranslatorTestHandlerCToCpp,
|
|
||||||
CefTranslatorTestHandler, cef_translator_test_handler_t>::UnwrapDerived(
|
|
||||||
CefWrapperType type, CefTranslatorTestHandler* c) {
|
|
||||||
if (type == WT_TRANSLATOR_TEST_HANDLER_CHILD) {
|
|
||||||
return reinterpret_cast<cef_translator_test_handler_t*>(
|
|
||||||
CefTranslatorTestHandlerChildCToCpp::Unwrap(
|
|
||||||
reinterpret_cast<CefTranslatorTestHandlerChild*>(c)));
|
|
||||||
}
|
|
||||||
NOTREACHED() << "Unexpected class type: " << type;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if DCHECK_IS_ON()
|
|
||||||
template<> base::AtomicRefCount CefCToCpp<CefTranslatorTestHandlerCToCpp,
|
|
||||||
CefTranslatorTestHandler, cef_translator_test_handler_t>::DebugObjCt = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template<> CefWrapperType CefCToCpp<CefTranslatorTestHandlerCToCpp,
|
|
||||||
CefTranslatorTestHandler, cef_translator_test_handler_t>::kWrapperType =
|
|
||||||
WT_TRANSLATOR_TEST_HANDLER;
|
|
@ -1,142 +0,0 @@
|
|||||||
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
|
||||||
// reserved. Use of this source code is governed by a BSD-style license that
|
|
||||||
// can be found in the LICENSE file.
|
|
||||||
//
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
//
|
|
||||||
// This file was generated by the CEF translator tool. If making changes by
|
|
||||||
// hand only do so within the body of existing method and function
|
|
||||||
// implementations. See the translator.README.txt file in the tools directory
|
|
||||||
// for more information.
|
|
||||||
//
|
|
||||||
|
|
||||||
#include "libcef_dll/ctocpp/test/translator_test_object_child_child_ctocpp.h"
|
|
||||||
|
|
||||||
|
|
||||||
// STATIC METHODS - Body may be edited by hand.
|
|
||||||
|
|
||||||
CefRefPtr<CefTranslatorTestObjectChildChild> CefTranslatorTestObjectChildChild::Create(
|
|
||||||
int value, int other_value, int other_other_value) {
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
cef_translator_test_object_child_child_t* _retval =
|
|
||||||
cef_translator_test_object_child_child_create(
|
|
||||||
value,
|
|
||||||
other_value,
|
|
||||||
other_other_value);
|
|
||||||
|
|
||||||
// Return type: refptr_same
|
|
||||||
return CefTranslatorTestObjectChildChildCToCpp::Wrap(_retval);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// VIRTUAL METHODS - Body may be edited by hand.
|
|
||||||
|
|
||||||
int CefTranslatorTestObjectChildChildCToCpp::GetOtherOtherValue() {
|
|
||||||
cef_translator_test_object_child_child_t* _struct = GetStruct();
|
|
||||||
if (CEF_MEMBER_MISSING(_struct, get_other_other_value))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
int _retval = _struct->get_other_other_value(_struct);
|
|
||||||
|
|
||||||
// Return type: simple
|
|
||||||
return _retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CefTranslatorTestObjectChildChildCToCpp::SetOtherOtherValue(int value) {
|
|
||||||
cef_translator_test_object_child_child_t* _struct = GetStruct();
|
|
||||||
if (CEF_MEMBER_MISSING(_struct, set_other_other_value))
|
|
||||||
return;
|
|
||||||
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
_struct->set_other_other_value(_struct,
|
|
||||||
value);
|
|
||||||
}
|
|
||||||
|
|
||||||
int CefTranslatorTestObjectChildChildCToCpp::GetOtherValue() {
|
|
||||||
cef_translator_test_object_child_t* _struct =
|
|
||||||
reinterpret_cast<cef_translator_test_object_child_t*>(GetStruct());
|
|
||||||
if (CEF_MEMBER_MISSING(_struct, get_other_value))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
int _retval = _struct->get_other_value(_struct);
|
|
||||||
|
|
||||||
// Return type: simple
|
|
||||||
return _retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CefTranslatorTestObjectChildChildCToCpp::SetOtherValue(int value) {
|
|
||||||
cef_translator_test_object_child_t* _struct =
|
|
||||||
reinterpret_cast<cef_translator_test_object_child_t*>(GetStruct());
|
|
||||||
if (CEF_MEMBER_MISSING(_struct, set_other_value))
|
|
||||||
return;
|
|
||||||
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
_struct->set_other_value(_struct,
|
|
||||||
value);
|
|
||||||
}
|
|
||||||
|
|
||||||
int CefTranslatorTestObjectChildChildCToCpp::GetValue() {
|
|
||||||
cef_translator_test_object_t* _struct =
|
|
||||||
reinterpret_cast<cef_translator_test_object_t*>(GetStruct());
|
|
||||||
if (CEF_MEMBER_MISSING(_struct, get_value))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
int _retval = _struct->get_value(_struct);
|
|
||||||
|
|
||||||
// Return type: simple
|
|
||||||
return _retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CefTranslatorTestObjectChildChildCToCpp::SetValue(int value) {
|
|
||||||
cef_translator_test_object_t* _struct =
|
|
||||||
reinterpret_cast<cef_translator_test_object_t*>(GetStruct());
|
|
||||||
if (CEF_MEMBER_MISSING(_struct, set_value))
|
|
||||||
return;
|
|
||||||
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
_struct->set_value(_struct,
|
|
||||||
value);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// CONSTRUCTOR - Do not edit by hand.
|
|
||||||
|
|
||||||
CefTranslatorTestObjectChildChildCToCpp::CefTranslatorTestObjectChildChildCToCpp(
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
|
|
||||||
template<> cef_translator_test_object_child_child_t* CefCToCpp<CefTranslatorTestObjectChildChildCToCpp,
|
|
||||||
CefTranslatorTestObjectChildChild,
|
|
||||||
cef_translator_test_object_child_child_t>::UnwrapDerived(
|
|
||||||
CefWrapperType type, CefTranslatorTestObjectChildChild* c) {
|
|
||||||
NOTREACHED() << "Unexpected class type: " << type;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if DCHECK_IS_ON()
|
|
||||||
template<> base::AtomicRefCount CefCToCpp<CefTranslatorTestObjectChildChildCToCpp,
|
|
||||||
CefTranslatorTestObjectChildChild,
|
|
||||||
cef_translator_test_object_child_child_t>::DebugObjCt = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template<> CefWrapperType CefCToCpp<CefTranslatorTestObjectChildChildCToCpp,
|
|
||||||
CefTranslatorTestObjectChildChild,
|
|
||||||
cef_translator_test_object_child_child_t>::kWrapperType =
|
|
||||||
WT_TRANSLATOR_TEST_OBJECT_CHILD_CHILD;
|
|
@ -1,118 +0,0 @@
|
|||||||
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
|
||||||
// reserved. Use of this source code is governed by a BSD-style license that
|
|
||||||
// can be found in the LICENSE file.
|
|
||||||
//
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
//
|
|
||||||
// This file was generated by the CEF translator tool. If making changes by
|
|
||||||
// hand only do so within the body of existing method and function
|
|
||||||
// implementations. See the translator.README.txt file in the tools directory
|
|
||||||
// for more information.
|
|
||||||
//
|
|
||||||
|
|
||||||
#include "libcef_dll/ctocpp/test/translator_test_object_child_ctocpp.h"
|
|
||||||
#include "libcef_dll/ctocpp/test/translator_test_object_child_child_ctocpp.h"
|
|
||||||
|
|
||||||
|
|
||||||
// STATIC METHODS - Body may be edited by hand.
|
|
||||||
|
|
||||||
CefRefPtr<CefTranslatorTestObjectChild> CefTranslatorTestObjectChild::Create(
|
|
||||||
int value, int other_value) {
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
cef_translator_test_object_child_t* _retval =
|
|
||||||
cef_translator_test_object_child_create(
|
|
||||||
value,
|
|
||||||
other_value);
|
|
||||||
|
|
||||||
// Return type: refptr_same
|
|
||||||
return CefTranslatorTestObjectChildCToCpp::Wrap(_retval);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// VIRTUAL METHODS - Body may be edited by hand.
|
|
||||||
|
|
||||||
int CefTranslatorTestObjectChildCToCpp::GetOtherValue() {
|
|
||||||
cef_translator_test_object_child_t* _struct = GetStruct();
|
|
||||||
if (CEF_MEMBER_MISSING(_struct, get_other_value))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
int _retval = _struct->get_other_value(_struct);
|
|
||||||
|
|
||||||
// Return type: simple
|
|
||||||
return _retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CefTranslatorTestObjectChildCToCpp::SetOtherValue(int value) {
|
|
||||||
cef_translator_test_object_child_t* _struct = GetStruct();
|
|
||||||
if (CEF_MEMBER_MISSING(_struct, set_other_value))
|
|
||||||
return;
|
|
||||||
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
_struct->set_other_value(_struct,
|
|
||||||
value);
|
|
||||||
}
|
|
||||||
|
|
||||||
int CefTranslatorTestObjectChildCToCpp::GetValue() {
|
|
||||||
cef_translator_test_object_t* _struct =
|
|
||||||
reinterpret_cast<cef_translator_test_object_t*>(GetStruct());
|
|
||||||
if (CEF_MEMBER_MISSING(_struct, get_value))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
int _retval = _struct->get_value(_struct);
|
|
||||||
|
|
||||||
// Return type: simple
|
|
||||||
return _retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CefTranslatorTestObjectChildCToCpp::SetValue(int value) {
|
|
||||||
cef_translator_test_object_t* _struct =
|
|
||||||
reinterpret_cast<cef_translator_test_object_t*>(GetStruct());
|
|
||||||
if (CEF_MEMBER_MISSING(_struct, set_value))
|
|
||||||
return;
|
|
||||||
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
_struct->set_value(_struct,
|
|
||||||
value);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// CONSTRUCTOR - Do not edit by hand.
|
|
||||||
|
|
||||||
CefTranslatorTestObjectChildCToCpp::CefTranslatorTestObjectChildCToCpp() {
|
|
||||||
}
|
|
||||||
|
|
||||||
template<> cef_translator_test_object_child_t* CefCToCpp<CefTranslatorTestObjectChildCToCpp,
|
|
||||||
CefTranslatorTestObjectChild,
|
|
||||||
cef_translator_test_object_child_t>::UnwrapDerived(CefWrapperType type,
|
|
||||||
CefTranslatorTestObjectChild* c) {
|
|
||||||
if (type == WT_TRANSLATOR_TEST_OBJECT_CHILD_CHILD) {
|
|
||||||
return reinterpret_cast<cef_translator_test_object_child_t*>(
|
|
||||||
CefTranslatorTestObjectChildChildCToCpp::Unwrap(
|
|
||||||
reinterpret_cast<CefTranslatorTestObjectChildChild*>(c)));
|
|
||||||
}
|
|
||||||
NOTREACHED() << "Unexpected class type: " << type;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if DCHECK_IS_ON()
|
|
||||||
template<> base::AtomicRefCount CefCToCpp<CefTranslatorTestObjectChildCToCpp,
|
|
||||||
CefTranslatorTestObjectChild,
|
|
||||||
cef_translator_test_object_child_t>::DebugObjCt = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template<> CefWrapperType CefCToCpp<CefTranslatorTestObjectChildCToCpp,
|
|
||||||
CefTranslatorTestObjectChild,
|
|
||||||
cef_translator_test_object_child_t>::kWrapperType =
|
|
||||||
WT_TRANSLATOR_TEST_OBJECT_CHILD;
|
|
@ -1,90 +0,0 @@
|
|||||||
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
|
||||||
// reserved. Use of this source code is governed by a BSD-style license that
|
|
||||||
// can be found in the LICENSE file.
|
|
||||||
//
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
//
|
|
||||||
// This file was generated by the CEF translator tool. If making changes by
|
|
||||||
// hand only do so within the body of existing method and function
|
|
||||||
// implementations. See the translator.README.txt file in the tools directory
|
|
||||||
// for more information.
|
|
||||||
//
|
|
||||||
|
|
||||||
#include "libcef_dll/ctocpp/test/translator_test_object_ctocpp.h"
|
|
||||||
#include "libcef_dll/ctocpp/test/translator_test_object_child_ctocpp.h"
|
|
||||||
#include "libcef_dll/ctocpp/test/translator_test_object_child_child_ctocpp.h"
|
|
||||||
|
|
||||||
|
|
||||||
// STATIC METHODS - Body may be edited by hand.
|
|
||||||
|
|
||||||
CefRefPtr<CefTranslatorTestObject> CefTranslatorTestObject::Create(int value) {
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
cef_translator_test_object_t* _retval = cef_translator_test_object_create(
|
|
||||||
value);
|
|
||||||
|
|
||||||
// Return type: refptr_same
|
|
||||||
return CefTranslatorTestObjectCToCpp::Wrap(_retval);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// VIRTUAL METHODS - Body may be edited by hand.
|
|
||||||
|
|
||||||
int CefTranslatorTestObjectCToCpp::GetValue() {
|
|
||||||
cef_translator_test_object_t* _struct = GetStruct();
|
|
||||||
if (CEF_MEMBER_MISSING(_struct, get_value))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
int _retval = _struct->get_value(_struct);
|
|
||||||
|
|
||||||
// Return type: simple
|
|
||||||
return _retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CefTranslatorTestObjectCToCpp::SetValue(int value) {
|
|
||||||
cef_translator_test_object_t* _struct = GetStruct();
|
|
||||||
if (CEF_MEMBER_MISSING(_struct, set_value))
|
|
||||||
return;
|
|
||||||
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
||||||
|
|
||||||
// Execute
|
|
||||||
_struct->set_value(_struct,
|
|
||||||
value);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// CONSTRUCTOR - Do not edit by hand.
|
|
||||||
|
|
||||||
CefTranslatorTestObjectCToCpp::CefTranslatorTestObjectCToCpp() {
|
|
||||||
}
|
|
||||||
|
|
||||||
template<> cef_translator_test_object_t* CefCToCpp<CefTranslatorTestObjectCToCpp,
|
|
||||||
CefTranslatorTestObject, cef_translator_test_object_t>::UnwrapDerived(
|
|
||||||
CefWrapperType type, CefTranslatorTestObject* c) {
|
|
||||||
if (type == WT_TRANSLATOR_TEST_OBJECT_CHILD) {
|
|
||||||
return reinterpret_cast<cef_translator_test_object_t*>(
|
|
||||||
CefTranslatorTestObjectChildCToCpp::Unwrap(
|
|
||||||
reinterpret_cast<CefTranslatorTestObjectChild*>(c)));
|
|
||||||
}
|
|
||||||
if (type == WT_TRANSLATOR_TEST_OBJECT_CHILD_CHILD) {
|
|
||||||
return reinterpret_cast<cef_translator_test_object_t*>(
|
|
||||||
CefTranslatorTestObjectChildChildCToCpp::Unwrap(
|
|
||||||
reinterpret_cast<CefTranslatorTestObjectChildChild*>(c)));
|
|
||||||
}
|
|
||||||
NOTREACHED() << "Unexpected class type: " << type;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if DCHECK_IS_ON()
|
|
||||||
template<> base::AtomicRefCount CefCToCpp<CefTranslatorTestObjectCToCpp,
|
|
||||||
CefTranslatorTestObject, cef_translator_test_object_t>::DebugObjCt = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template<> CefWrapperType CefCToCpp<CefTranslatorTestObjectCToCpp,
|
|
||||||
CefTranslatorTestObject, cef_translator_test_object_t>::kWrapperType =
|
|
||||||
WT_TRANSLATOR_TEST_OBJECT;
|
|
@ -10,13 +10,13 @@
|
|||||||
// for more information.
|
// for more information.
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "libcef_dll/ctocpp/test/translator_test_handler_child_ctocpp.h"
|
#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.h"
|
||||||
|
|
||||||
|
|
||||||
// VIRTUAL METHODS - Body may be edited by hand.
|
// VIRTUAL METHODS - Body may be edited by hand.
|
||||||
|
|
||||||
int CefTranslatorTestHandlerChildCToCpp::GetOtherValue() {
|
int CefTranslatorTestRefPtrClientChildCToCpp::GetOtherValue() {
|
||||||
cef_translator_test_handler_child_t* _struct = GetStruct();
|
cef_translator_test_ref_ptr_client_child_t* _struct = GetStruct();
|
||||||
if (CEF_MEMBER_MISSING(_struct, get_other_value))
|
if (CEF_MEMBER_MISSING(_struct, get_other_value))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@ -29,9 +29,9 @@ int CefTranslatorTestHandlerChildCToCpp::GetOtherValue() {
|
|||||||
return _retval;
|
return _retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CefTranslatorTestHandlerChildCToCpp::GetValue() {
|
int CefTranslatorTestRefPtrClientChildCToCpp::GetValue() {
|
||||||
cef_translator_test_handler_t* _struct =
|
cef_translator_test_ref_ptr_client_t* _struct =
|
||||||
reinterpret_cast<cef_translator_test_handler_t*>(GetStruct());
|
reinterpret_cast<cef_translator_test_ref_ptr_client_t*>(GetStruct());
|
||||||
if (CEF_MEMBER_MISSING(_struct, get_value))
|
if (CEF_MEMBER_MISSING(_struct, get_value))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@ -47,24 +47,25 @@ int CefTranslatorTestHandlerChildCToCpp::GetValue() {
|
|||||||
|
|
||||||
// CONSTRUCTOR - Do not edit by hand.
|
// CONSTRUCTOR - Do not edit by hand.
|
||||||
|
|
||||||
CefTranslatorTestHandlerChildCToCpp::CefTranslatorTestHandlerChildCToCpp() {
|
CefTranslatorTestRefPtrClientChildCToCpp::CefTranslatorTestRefPtrClientChildCToCpp(
|
||||||
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
template<> cef_translator_test_handler_child_t* CefCToCpp<CefTranslatorTestHandlerChildCToCpp,
|
template<> cef_translator_test_ref_ptr_client_child_t* CefCToCpp<CefTranslatorTestRefPtrClientChildCToCpp,
|
||||||
CefTranslatorTestHandlerChild,
|
CefTranslatorTestRefPtrClientChild,
|
||||||
cef_translator_test_handler_child_t>::UnwrapDerived(CefWrapperType type,
|
cef_translator_test_ref_ptr_client_child_t>::UnwrapDerived(
|
||||||
CefTranslatorTestHandlerChild* c) {
|
CefWrapperType type, CefTranslatorTestRefPtrClientChild* c) {
|
||||||
NOTREACHED() << "Unexpected class type: " << type;
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if DCHECK_IS_ON()
|
#if DCHECK_IS_ON()
|
||||||
template<> base::AtomicRefCount CefCToCpp<CefTranslatorTestHandlerChildCToCpp,
|
template<> base::AtomicRefCount CefCToCpp<CefTranslatorTestRefPtrClientChildCToCpp,
|
||||||
CefTranslatorTestHandlerChild,
|
CefTranslatorTestRefPtrClientChild,
|
||||||
cef_translator_test_handler_child_t>::DebugObjCt = 0;
|
cef_translator_test_ref_ptr_client_child_t>::DebugObjCt = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
template<> CefWrapperType CefCToCpp<CefTranslatorTestHandlerChildCToCpp,
|
template<> CefWrapperType CefCToCpp<CefTranslatorTestRefPtrClientChildCToCpp,
|
||||||
CefTranslatorTestHandlerChild,
|
CefTranslatorTestRefPtrClientChild,
|
||||||
cef_translator_test_handler_child_t>::kWrapperType =
|
cef_translator_test_ref_ptr_client_child_t>::kWrapperType =
|
||||||
WT_TRANSLATOR_TEST_HANDLER_CHILD;
|
WT_TRANSLATOR_TEST_REF_PTR_CLIENT_CHILD;
|
@ -10,8 +10,8 @@
|
|||||||
// for more information.
|
// for more information.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_HANDLER_CHILD_CTOCPP_H_
|
#ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_CLIENT_CHILD_CTOCPP_H_
|
||||||
#define CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_HANDLER_CHILD_CTOCPP_H_
|
#define CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_CLIENT_CHILD_CTOCPP_H_
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if !defined(BUILDING_CEF_SHARED)
|
#if !defined(BUILDING_CEF_SHARED)
|
||||||
@ -24,17 +24,18 @@
|
|||||||
|
|
||||||
// Wrap a C structure with a C++ class.
|
// Wrap a C structure with a C++ class.
|
||||||
// This class may be instantiated and accessed DLL-side only.
|
// This class may be instantiated and accessed DLL-side only.
|
||||||
class CefTranslatorTestHandlerChildCToCpp
|
class CefTranslatorTestRefPtrClientChildCToCpp
|
||||||
: public CefCToCpp<CefTranslatorTestHandlerChildCToCpp,
|
: public CefCToCpp<CefTranslatorTestRefPtrClientChildCToCpp,
|
||||||
CefTranslatorTestHandlerChild, cef_translator_test_handler_child_t> {
|
CefTranslatorTestRefPtrClientChild,
|
||||||
|
cef_translator_test_ref_ptr_client_child_t> {
|
||||||
public:
|
public:
|
||||||
CefTranslatorTestHandlerChildCToCpp();
|
CefTranslatorTestRefPtrClientChildCToCpp();
|
||||||
|
|
||||||
// CefTranslatorTestHandlerChild methods.
|
// CefTranslatorTestRefPtrClientChild methods.
|
||||||
int GetOtherValue() override;
|
int GetOtherValue() override;
|
||||||
|
|
||||||
// CefTranslatorTestHandler methods.
|
// CefTranslatorTestRefPtrClient methods.
|
||||||
int GetValue() override;
|
int GetValue() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_HANDLER_CHILD_CTOCPP_H_
|
#endif // CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_CLIENT_CHILD_CTOCPP_H_
|
@ -0,0 +1,61 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This file was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.h"
|
||||||
|
#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.h"
|
||||||
|
|
||||||
|
|
||||||
|
// VIRTUAL METHODS - Body may be edited by hand.
|
||||||
|
|
||||||
|
int CefTranslatorTestRefPtrClientCToCpp::GetValue() {
|
||||||
|
cef_translator_test_ref_ptr_client_t* _struct = GetStruct();
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, get_value))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = _struct->get_value(_struct);
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// CONSTRUCTOR - Do not edit by hand.
|
||||||
|
|
||||||
|
CefTranslatorTestRefPtrClientCToCpp::CefTranslatorTestRefPtrClientCToCpp() {
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> cef_translator_test_ref_ptr_client_t* CefCToCpp<CefTranslatorTestRefPtrClientCToCpp,
|
||||||
|
CefTranslatorTestRefPtrClient,
|
||||||
|
cef_translator_test_ref_ptr_client_t>::UnwrapDerived(CefWrapperType type,
|
||||||
|
CefTranslatorTestRefPtrClient* c) {
|
||||||
|
if (type == WT_TRANSLATOR_TEST_REF_PTR_CLIENT_CHILD) {
|
||||||
|
return reinterpret_cast<cef_translator_test_ref_ptr_client_t*>(
|
||||||
|
CefTranslatorTestRefPtrClientChildCToCpp::Unwrap(
|
||||||
|
reinterpret_cast<CefTranslatorTestRefPtrClientChild*>(c)));
|
||||||
|
}
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if DCHECK_IS_ON()
|
||||||
|
template<> base::AtomicRefCount CefCToCpp<CefTranslatorTestRefPtrClientCToCpp,
|
||||||
|
CefTranslatorTestRefPtrClient,
|
||||||
|
cef_translator_test_ref_ptr_client_t>::DebugObjCt = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<> CefWrapperType CefCToCpp<CefTranslatorTestRefPtrClientCToCpp,
|
||||||
|
CefTranslatorTestRefPtrClient,
|
||||||
|
cef_translator_test_ref_ptr_client_t>::kWrapperType =
|
||||||
|
WT_TRANSLATOR_TEST_REF_PTR_CLIENT;
|
@ -10,8 +10,8 @@
|
|||||||
// for more information.
|
// for more information.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_HANDLER_CTOCPP_H_
|
#ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_CLIENT_CTOCPP_H_
|
||||||
#define CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_HANDLER_CTOCPP_H_
|
#define CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_CLIENT_CTOCPP_H_
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if !defined(BUILDING_CEF_SHARED)
|
#if !defined(BUILDING_CEF_SHARED)
|
||||||
@ -24,14 +24,14 @@
|
|||||||
|
|
||||||
// Wrap a C structure with a C++ class.
|
// Wrap a C structure with a C++ class.
|
||||||
// This class may be instantiated and accessed DLL-side only.
|
// This class may be instantiated and accessed DLL-side only.
|
||||||
class CefTranslatorTestHandlerCToCpp
|
class CefTranslatorTestRefPtrClientCToCpp
|
||||||
: public CefCToCpp<CefTranslatorTestHandlerCToCpp, CefTranslatorTestHandler,
|
: public CefCToCpp<CefTranslatorTestRefPtrClientCToCpp,
|
||||||
cef_translator_test_handler_t> {
|
CefTranslatorTestRefPtrClient, cef_translator_test_ref_ptr_client_t> {
|
||||||
public:
|
public:
|
||||||
CefTranslatorTestHandlerCToCpp();
|
CefTranslatorTestRefPtrClientCToCpp();
|
||||||
|
|
||||||
// CefTranslatorTestHandler methods.
|
// CefTranslatorTestRefPtrClient methods.
|
||||||
int GetValue() override;
|
int GetValue() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_HANDLER_CTOCPP_H_
|
#endif // CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_CLIENT_CTOCPP_H_
|
@ -0,0 +1,145 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This file was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.h"
|
||||||
|
|
||||||
|
|
||||||
|
// STATIC METHODS - Body may be edited by hand.
|
||||||
|
|
||||||
|
CefRefPtr<CefTranslatorTestRefPtrLibraryChildChild> CefTranslatorTestRefPtrLibraryChildChild::Create(
|
||||||
|
int value, int other_value, int other_other_value) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
cef_translator_test_ref_ptr_library_child_child_t* _retval =
|
||||||
|
cef_translator_test_ref_ptr_library_child_child_create(
|
||||||
|
value,
|
||||||
|
other_value,
|
||||||
|
other_other_value);
|
||||||
|
|
||||||
|
// Return type: refptr_same
|
||||||
|
return CefTranslatorTestRefPtrLibraryChildChildCToCpp::Wrap(_retval);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// VIRTUAL METHODS - Body may be edited by hand.
|
||||||
|
|
||||||
|
int CefTranslatorTestRefPtrLibraryChildChildCToCpp::GetOtherOtherValue() {
|
||||||
|
cef_translator_test_ref_ptr_library_child_child_t* _struct = GetStruct();
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, get_other_other_value))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = _struct->get_other_other_value(_struct);
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CefTranslatorTestRefPtrLibraryChildChildCToCpp::SetOtherOtherValue(
|
||||||
|
int value) {
|
||||||
|
cef_translator_test_ref_ptr_library_child_child_t* _struct = GetStruct();
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, set_other_other_value))
|
||||||
|
return;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
_struct->set_other_other_value(_struct,
|
||||||
|
value);
|
||||||
|
}
|
||||||
|
|
||||||
|
int CefTranslatorTestRefPtrLibraryChildChildCToCpp::GetOtherValue() {
|
||||||
|
cef_translator_test_ref_ptr_library_child_t* _struct =
|
||||||
|
reinterpret_cast<cef_translator_test_ref_ptr_library_child_t*>(GetStruct(
|
||||||
|
));
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, get_other_value))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = _struct->get_other_value(_struct);
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CefTranslatorTestRefPtrLibraryChildChildCToCpp::SetOtherValue(int value) {
|
||||||
|
cef_translator_test_ref_ptr_library_child_t* _struct =
|
||||||
|
reinterpret_cast<cef_translator_test_ref_ptr_library_child_t*>(GetStruct(
|
||||||
|
));
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, set_other_value))
|
||||||
|
return;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
_struct->set_other_value(_struct,
|
||||||
|
value);
|
||||||
|
}
|
||||||
|
|
||||||
|
int CefTranslatorTestRefPtrLibraryChildChildCToCpp::GetValue() {
|
||||||
|
cef_translator_test_ref_ptr_library_t* _struct =
|
||||||
|
reinterpret_cast<cef_translator_test_ref_ptr_library_t*>(GetStruct());
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, get_value))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = _struct->get_value(_struct);
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CefTranslatorTestRefPtrLibraryChildChildCToCpp::SetValue(int value) {
|
||||||
|
cef_translator_test_ref_ptr_library_t* _struct =
|
||||||
|
reinterpret_cast<cef_translator_test_ref_ptr_library_t*>(GetStruct());
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, set_value))
|
||||||
|
return;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
_struct->set_value(_struct,
|
||||||
|
value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// CONSTRUCTOR - Do not edit by hand.
|
||||||
|
|
||||||
|
CefTranslatorTestRefPtrLibraryChildChildCToCpp::CefTranslatorTestRefPtrLibraryChildChildCToCpp(
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> cef_translator_test_ref_ptr_library_child_child_t* CefCToCpp<CefTranslatorTestRefPtrLibraryChildChildCToCpp,
|
||||||
|
CefTranslatorTestRefPtrLibraryChildChild,
|
||||||
|
cef_translator_test_ref_ptr_library_child_child_t>::UnwrapDerived(
|
||||||
|
CefWrapperType type, CefTranslatorTestRefPtrLibraryChildChild* c) {
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if DCHECK_IS_ON()
|
||||||
|
template<> base::AtomicRefCount CefCToCpp<CefTranslatorTestRefPtrLibraryChildChildCToCpp,
|
||||||
|
CefTranslatorTestRefPtrLibraryChildChild,
|
||||||
|
cef_translator_test_ref_ptr_library_child_child_t>::DebugObjCt = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<> CefWrapperType CefCToCpp<CefTranslatorTestRefPtrLibraryChildChildCToCpp,
|
||||||
|
CefTranslatorTestRefPtrLibraryChildChild,
|
||||||
|
cef_translator_test_ref_ptr_library_child_child_t>::kWrapperType =
|
||||||
|
WT_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CHILD;
|
@ -10,8 +10,8 @@
|
|||||||
// for more information.
|
// for more information.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_OBJECT_CHILD_CHILD_CTOCPP_H_
|
#ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CHILD_CTOCPP_H_
|
||||||
#define CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_OBJECT_CHILD_CHILD_CTOCPP_H_
|
#define CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CHILD_CTOCPP_H_
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if !defined(WRAPPING_CEF_SHARED)
|
#if !defined(WRAPPING_CEF_SHARED)
|
||||||
@ -24,24 +24,24 @@
|
|||||||
|
|
||||||
// Wrap a C structure with a C++ class.
|
// Wrap a C structure with a C++ class.
|
||||||
// This class may be instantiated and accessed wrapper-side only.
|
// This class may be instantiated and accessed wrapper-side only.
|
||||||
class CefTranslatorTestObjectChildChildCToCpp
|
class CefTranslatorTestRefPtrLibraryChildChildCToCpp
|
||||||
: public CefCToCpp<CefTranslatorTestObjectChildChildCToCpp,
|
: public CefCToCpp<CefTranslatorTestRefPtrLibraryChildChildCToCpp,
|
||||||
CefTranslatorTestObjectChildChild,
|
CefTranslatorTestRefPtrLibraryChildChild,
|
||||||
cef_translator_test_object_child_child_t> {
|
cef_translator_test_ref_ptr_library_child_child_t> {
|
||||||
public:
|
public:
|
||||||
CefTranslatorTestObjectChildChildCToCpp();
|
CefTranslatorTestRefPtrLibraryChildChildCToCpp();
|
||||||
|
|
||||||
// CefTranslatorTestObjectChildChild methods.
|
// CefTranslatorTestRefPtrLibraryChildChild methods.
|
||||||
int GetOtherOtherValue() OVERRIDE;
|
int GetOtherOtherValue() OVERRIDE;
|
||||||
void SetOtherOtherValue(int value) OVERRIDE;
|
void SetOtherOtherValue(int value) OVERRIDE;
|
||||||
|
|
||||||
// CefTranslatorTestObjectChild methods.
|
// CefTranslatorTestRefPtrLibraryChild methods.
|
||||||
int GetOtherValue() OVERRIDE;
|
int GetOtherValue() OVERRIDE;
|
||||||
void SetOtherValue(int value) OVERRIDE;
|
void SetOtherValue(int value) OVERRIDE;
|
||||||
|
|
||||||
// CefTranslatorTestObject methods.
|
// CefTranslatorTestRefPtrLibrary methods.
|
||||||
int GetValue() OVERRIDE;
|
int GetValue() OVERRIDE;
|
||||||
void SetValue(int value) OVERRIDE;
|
void SetValue(int value) OVERRIDE;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_OBJECT_CHILD_CHILD_CTOCPP_H_
|
#endif // CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CHILD_CTOCPP_H_
|
@ -0,0 +1,119 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This file was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.h"
|
||||||
|
#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.h"
|
||||||
|
|
||||||
|
|
||||||
|
// STATIC METHODS - Body may be edited by hand.
|
||||||
|
|
||||||
|
CefRefPtr<CefTranslatorTestRefPtrLibraryChild> CefTranslatorTestRefPtrLibraryChild::Create(
|
||||||
|
int value, int other_value) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
cef_translator_test_ref_ptr_library_child_t* _retval =
|
||||||
|
cef_translator_test_ref_ptr_library_child_create(
|
||||||
|
value,
|
||||||
|
other_value);
|
||||||
|
|
||||||
|
// Return type: refptr_same
|
||||||
|
return CefTranslatorTestRefPtrLibraryChildCToCpp::Wrap(_retval);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// VIRTUAL METHODS - Body may be edited by hand.
|
||||||
|
|
||||||
|
int CefTranslatorTestRefPtrLibraryChildCToCpp::GetOtherValue() {
|
||||||
|
cef_translator_test_ref_ptr_library_child_t* _struct = GetStruct();
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, get_other_value))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = _struct->get_other_value(_struct);
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CefTranslatorTestRefPtrLibraryChildCToCpp::SetOtherValue(int value) {
|
||||||
|
cef_translator_test_ref_ptr_library_child_t* _struct = GetStruct();
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, set_other_value))
|
||||||
|
return;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
_struct->set_other_value(_struct,
|
||||||
|
value);
|
||||||
|
}
|
||||||
|
|
||||||
|
int CefTranslatorTestRefPtrLibraryChildCToCpp::GetValue() {
|
||||||
|
cef_translator_test_ref_ptr_library_t* _struct =
|
||||||
|
reinterpret_cast<cef_translator_test_ref_ptr_library_t*>(GetStruct());
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, get_value))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = _struct->get_value(_struct);
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CefTranslatorTestRefPtrLibraryChildCToCpp::SetValue(int value) {
|
||||||
|
cef_translator_test_ref_ptr_library_t* _struct =
|
||||||
|
reinterpret_cast<cef_translator_test_ref_ptr_library_t*>(GetStruct());
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, set_value))
|
||||||
|
return;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
_struct->set_value(_struct,
|
||||||
|
value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// CONSTRUCTOR - Do not edit by hand.
|
||||||
|
|
||||||
|
CefTranslatorTestRefPtrLibraryChildCToCpp::CefTranslatorTestRefPtrLibraryChildCToCpp(
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> cef_translator_test_ref_ptr_library_child_t* CefCToCpp<CefTranslatorTestRefPtrLibraryChildCToCpp,
|
||||||
|
CefTranslatorTestRefPtrLibraryChild,
|
||||||
|
cef_translator_test_ref_ptr_library_child_t>::UnwrapDerived(
|
||||||
|
CefWrapperType type, CefTranslatorTestRefPtrLibraryChild* c) {
|
||||||
|
if (type == WT_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CHILD) {
|
||||||
|
return reinterpret_cast<cef_translator_test_ref_ptr_library_child_t*>(
|
||||||
|
CefTranslatorTestRefPtrLibraryChildChildCToCpp::Unwrap(
|
||||||
|
reinterpret_cast<CefTranslatorTestRefPtrLibraryChildChild*>(c)));
|
||||||
|
}
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if DCHECK_IS_ON()
|
||||||
|
template<> base::AtomicRefCount CefCToCpp<CefTranslatorTestRefPtrLibraryChildCToCpp,
|
||||||
|
CefTranslatorTestRefPtrLibraryChild,
|
||||||
|
cef_translator_test_ref_ptr_library_child_t>::DebugObjCt = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<> CefWrapperType CefCToCpp<CefTranslatorTestRefPtrLibraryChildCToCpp,
|
||||||
|
CefTranslatorTestRefPtrLibraryChild,
|
||||||
|
cef_translator_test_ref_ptr_library_child_t>::kWrapperType =
|
||||||
|
WT_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD;
|
@ -10,8 +10,8 @@
|
|||||||
// for more information.
|
// for more information.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_OBJECT_CHILD_CTOCPP_H_
|
#ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CTOCPP_H_
|
||||||
#define CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_OBJECT_CHILD_CTOCPP_H_
|
#define CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CTOCPP_H_
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if !defined(WRAPPING_CEF_SHARED)
|
#if !defined(WRAPPING_CEF_SHARED)
|
||||||
@ -24,19 +24,20 @@
|
|||||||
|
|
||||||
// Wrap a C structure with a C++ class.
|
// Wrap a C structure with a C++ class.
|
||||||
// This class may be instantiated and accessed wrapper-side only.
|
// This class may be instantiated and accessed wrapper-side only.
|
||||||
class CefTranslatorTestObjectChildCToCpp
|
class CefTranslatorTestRefPtrLibraryChildCToCpp
|
||||||
: public CefCToCpp<CefTranslatorTestObjectChildCToCpp,
|
: public CefCToCpp<CefTranslatorTestRefPtrLibraryChildCToCpp,
|
||||||
CefTranslatorTestObjectChild, cef_translator_test_object_child_t> {
|
CefTranslatorTestRefPtrLibraryChild,
|
||||||
|
cef_translator_test_ref_ptr_library_child_t> {
|
||||||
public:
|
public:
|
||||||
CefTranslatorTestObjectChildCToCpp();
|
CefTranslatorTestRefPtrLibraryChildCToCpp();
|
||||||
|
|
||||||
// CefTranslatorTestObjectChild methods.
|
// CefTranslatorTestRefPtrLibraryChild methods.
|
||||||
int GetOtherValue() OVERRIDE;
|
int GetOtherValue() OVERRIDE;
|
||||||
void SetOtherValue(int value) OVERRIDE;
|
void SetOtherValue(int value) OVERRIDE;
|
||||||
|
|
||||||
// CefTranslatorTestObject methods.
|
// CefTranslatorTestRefPtrLibrary methods.
|
||||||
int GetValue() OVERRIDE;
|
int GetValue() OVERRIDE;
|
||||||
void SetValue(int value) OVERRIDE;
|
void SetValue(int value) OVERRIDE;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_OBJECT_CHILD_CTOCPP_H_
|
#endif // CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CTOCPP_H_
|
@ -0,0 +1,95 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This file was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.h"
|
||||||
|
#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.h"
|
||||||
|
#include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.h"
|
||||||
|
|
||||||
|
|
||||||
|
// STATIC METHODS - Body may be edited by hand.
|
||||||
|
|
||||||
|
CefRefPtr<CefTranslatorTestRefPtrLibrary> CefTranslatorTestRefPtrLibrary::Create(
|
||||||
|
int value) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
cef_translator_test_ref_ptr_library_t* _retval =
|
||||||
|
cef_translator_test_ref_ptr_library_create(
|
||||||
|
value);
|
||||||
|
|
||||||
|
// Return type: refptr_same
|
||||||
|
return CefTranslatorTestRefPtrLibraryCToCpp::Wrap(_retval);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// VIRTUAL METHODS - Body may be edited by hand.
|
||||||
|
|
||||||
|
int CefTranslatorTestRefPtrLibraryCToCpp::GetValue() {
|
||||||
|
cef_translator_test_ref_ptr_library_t* _struct = GetStruct();
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, get_value))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = _struct->get_value(_struct);
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CefTranslatorTestRefPtrLibraryCToCpp::SetValue(int value) {
|
||||||
|
cef_translator_test_ref_ptr_library_t* _struct = GetStruct();
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, set_value))
|
||||||
|
return;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
_struct->set_value(_struct,
|
||||||
|
value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// CONSTRUCTOR - Do not edit by hand.
|
||||||
|
|
||||||
|
CefTranslatorTestRefPtrLibraryCToCpp::CefTranslatorTestRefPtrLibraryCToCpp() {
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> cef_translator_test_ref_ptr_library_t* CefCToCpp<CefTranslatorTestRefPtrLibraryCToCpp,
|
||||||
|
CefTranslatorTestRefPtrLibrary,
|
||||||
|
cef_translator_test_ref_ptr_library_t>::UnwrapDerived(CefWrapperType type,
|
||||||
|
CefTranslatorTestRefPtrLibrary* c) {
|
||||||
|
if (type == WT_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD) {
|
||||||
|
return reinterpret_cast<cef_translator_test_ref_ptr_library_t*>(
|
||||||
|
CefTranslatorTestRefPtrLibraryChildCToCpp::Unwrap(
|
||||||
|
reinterpret_cast<CefTranslatorTestRefPtrLibraryChild*>(c)));
|
||||||
|
}
|
||||||
|
if (type == WT_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CHILD) {
|
||||||
|
return reinterpret_cast<cef_translator_test_ref_ptr_library_t*>(
|
||||||
|
CefTranslatorTestRefPtrLibraryChildChildCToCpp::Unwrap(
|
||||||
|
reinterpret_cast<CefTranslatorTestRefPtrLibraryChildChild*>(c)));
|
||||||
|
}
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if DCHECK_IS_ON()
|
||||||
|
template<> base::AtomicRefCount CefCToCpp<CefTranslatorTestRefPtrLibraryCToCpp,
|
||||||
|
CefTranslatorTestRefPtrLibrary,
|
||||||
|
cef_translator_test_ref_ptr_library_t>::DebugObjCt = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<> CefWrapperType CefCToCpp<CefTranslatorTestRefPtrLibraryCToCpp,
|
||||||
|
CefTranslatorTestRefPtrLibrary,
|
||||||
|
cef_translator_test_ref_ptr_library_t>::kWrapperType =
|
||||||
|
WT_TRANSLATOR_TEST_REF_PTR_LIBRARY;
|
@ -10,8 +10,8 @@
|
|||||||
// for more information.
|
// for more information.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_OBJECT_CTOCPP_H_
|
#ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CTOCPP_H_
|
||||||
#define CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_OBJECT_CTOCPP_H_
|
#define CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CTOCPP_H_
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if !defined(WRAPPING_CEF_SHARED)
|
#if !defined(WRAPPING_CEF_SHARED)
|
||||||
@ -24,15 +24,16 @@
|
|||||||
|
|
||||||
// Wrap a C structure with a C++ class.
|
// Wrap a C structure with a C++ class.
|
||||||
// This class may be instantiated and accessed wrapper-side only.
|
// This class may be instantiated and accessed wrapper-side only.
|
||||||
class CefTranslatorTestObjectCToCpp
|
class CefTranslatorTestRefPtrLibraryCToCpp
|
||||||
: public CefCToCpp<CefTranslatorTestObjectCToCpp, CefTranslatorTestObject,
|
: public CefCToCpp<CefTranslatorTestRefPtrLibraryCToCpp,
|
||||||
cef_translator_test_object_t> {
|
CefTranslatorTestRefPtrLibrary,
|
||||||
|
cef_translator_test_ref_ptr_library_t> {
|
||||||
public:
|
public:
|
||||||
CefTranslatorTestObjectCToCpp();
|
CefTranslatorTestRefPtrLibraryCToCpp();
|
||||||
|
|
||||||
// CefTranslatorTestObject methods.
|
// CefTranslatorTestRefPtrLibrary methods.
|
||||||
int GetValue() OVERRIDE;
|
int GetValue() OVERRIDE;
|
||||||
void SetValue(int value) OVERRIDE;
|
void SetValue(int value) OVERRIDE;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_OBJECT_CTOCPP_H_
|
#endif // CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_REF_PTR_LIBRARY_CTOCPP_H_
|
@ -0,0 +1,79 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This file was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "libcef_dll/ctocpp/test/translator_test_scoped_client_child_ctocpp.h"
|
||||||
|
|
||||||
|
|
||||||
|
// VIRTUAL METHODS - Body may be edited by hand.
|
||||||
|
|
||||||
|
int CefTranslatorTestScopedClientChildCToCpp::GetOtherValue() {
|
||||||
|
cef_translator_test_scoped_client_child_t* _struct = GetStruct();
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, get_other_value))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = _struct->get_other_value(_struct);
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CefTranslatorTestScopedClientChildCToCpp::GetValue() {
|
||||||
|
cef_translator_test_scoped_client_t* _struct =
|
||||||
|
reinterpret_cast<cef_translator_test_scoped_client_t*>(GetStruct());
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, get_value))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = _struct->get_value(_struct);
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// CONSTRUCTOR - Do not edit by hand.
|
||||||
|
|
||||||
|
CefTranslatorTestScopedClientChildCToCpp::CefTranslatorTestScopedClientChildCToCpp(
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> cef_translator_test_scoped_client_child_t* CefCToCppScoped<CefTranslatorTestScopedClientChildCToCpp,
|
||||||
|
CefTranslatorTestScopedClientChild,
|
||||||
|
cef_translator_test_scoped_client_child_t>::UnwrapDerivedOwn(
|
||||||
|
CefWrapperType type, CefOwnPtr<CefTranslatorTestScopedClientChild> c) {
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> cef_translator_test_scoped_client_child_t* CefCToCppScoped<CefTranslatorTestScopedClientChildCToCpp,
|
||||||
|
CefTranslatorTestScopedClientChild,
|
||||||
|
cef_translator_test_scoped_client_child_t>::UnwrapDerivedRaw(
|
||||||
|
CefWrapperType type, CefRawPtr<CefTranslatorTestScopedClientChild> c) {
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if DCHECK_IS_ON()
|
||||||
|
template<> base::AtomicRefCount CefCToCppScoped<CefTranslatorTestScopedClientChildCToCpp,
|
||||||
|
CefTranslatorTestScopedClientChild,
|
||||||
|
cef_translator_test_scoped_client_child_t>::DebugObjCt = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<> CefWrapperType CefCToCppScoped<CefTranslatorTestScopedClientChildCToCpp,
|
||||||
|
CefTranslatorTestScopedClientChild,
|
||||||
|
cef_translator_test_scoped_client_child_t>::kWrapperType =
|
||||||
|
WT_TRANSLATOR_TEST_SCOPED_CLIENT_CHILD;
|
@ -0,0 +1,41 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This file was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_CLIENT_CHILD_CTOCPP_H_
|
||||||
|
#define CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_CLIENT_CHILD_CTOCPP_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#if !defined(BUILDING_CEF_SHARED)
|
||||||
|
#error This file can be included DLL-side only
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "include/test/cef_translator_test.h"
|
||||||
|
#include "include/capi/test/cef_translator_test_capi.h"
|
||||||
|
#include "libcef_dll/ctocpp/ctocpp_scoped.h"
|
||||||
|
|
||||||
|
// Wrap a C structure with a C++ class.
|
||||||
|
// This class may be instantiated and accessed DLL-side only.
|
||||||
|
class CefTranslatorTestScopedClientChildCToCpp
|
||||||
|
: public CefCToCppScoped<CefTranslatorTestScopedClientChildCToCpp,
|
||||||
|
CefTranslatorTestScopedClientChild,
|
||||||
|
cef_translator_test_scoped_client_child_t> {
|
||||||
|
public:
|
||||||
|
CefTranslatorTestScopedClientChildCToCpp();
|
||||||
|
|
||||||
|
// CefTranslatorTestScopedClientChild methods.
|
||||||
|
int GetOtherValue() override;
|
||||||
|
|
||||||
|
// CefTranslatorTestScopedClient methods.
|
||||||
|
int GetValue() override;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_CLIENT_CHILD_CTOCPP_H_
|
@ -0,0 +1,76 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This file was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "libcef_dll/ctocpp/test/translator_test_scoped_client_ctocpp.h"
|
||||||
|
#include "libcef_dll/ctocpp/test/translator_test_scoped_client_child_ctocpp.h"
|
||||||
|
|
||||||
|
|
||||||
|
// VIRTUAL METHODS - Body may be edited by hand.
|
||||||
|
|
||||||
|
int CefTranslatorTestScopedClientCToCpp::GetValue() {
|
||||||
|
cef_translator_test_scoped_client_t* _struct = GetStruct();
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, get_value))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = _struct->get_value(_struct);
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// CONSTRUCTOR - Do not edit by hand.
|
||||||
|
|
||||||
|
CefTranslatorTestScopedClientCToCpp::CefTranslatorTestScopedClientCToCpp() {
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> cef_translator_test_scoped_client_t* CefCToCppScoped<CefTranslatorTestScopedClientCToCpp,
|
||||||
|
CefTranslatorTestScopedClient,
|
||||||
|
cef_translator_test_scoped_client_t>::UnwrapDerivedOwn(CefWrapperType type,
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClient> c) {
|
||||||
|
if (type == WT_TRANSLATOR_TEST_SCOPED_CLIENT_CHILD) {
|
||||||
|
return reinterpret_cast<cef_translator_test_scoped_client_t*>(
|
||||||
|
CefTranslatorTestScopedClientChildCToCpp::UnwrapOwn(
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClientChild>(
|
||||||
|
reinterpret_cast<CefTranslatorTestScopedClientChild*>(c.release()))));
|
||||||
|
}
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> cef_translator_test_scoped_client_t* CefCToCppScoped<CefTranslatorTestScopedClientCToCpp,
|
||||||
|
CefTranslatorTestScopedClient,
|
||||||
|
cef_translator_test_scoped_client_t>::UnwrapDerivedRaw(CefWrapperType type,
|
||||||
|
CefRawPtr<CefTranslatorTestScopedClient> c) {
|
||||||
|
if (type == WT_TRANSLATOR_TEST_SCOPED_CLIENT_CHILD) {
|
||||||
|
return reinterpret_cast<cef_translator_test_scoped_client_t*>(
|
||||||
|
CefTranslatorTestScopedClientChildCToCpp::UnwrapRaw(
|
||||||
|
CefRawPtr<CefTranslatorTestScopedClientChild>(
|
||||||
|
reinterpret_cast<CefTranslatorTestScopedClientChild*>(c))));
|
||||||
|
}
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if DCHECK_IS_ON()
|
||||||
|
template<> base::AtomicRefCount CefCToCppScoped<CefTranslatorTestScopedClientCToCpp,
|
||||||
|
CefTranslatorTestScopedClient,
|
||||||
|
cef_translator_test_scoped_client_t>::DebugObjCt = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<> CefWrapperType CefCToCppScoped<CefTranslatorTestScopedClientCToCpp,
|
||||||
|
CefTranslatorTestScopedClient,
|
||||||
|
cef_translator_test_scoped_client_t>::kWrapperType =
|
||||||
|
WT_TRANSLATOR_TEST_SCOPED_CLIENT;
|
@ -0,0 +1,37 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This file was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_CLIENT_CTOCPP_H_
|
||||||
|
#define CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_CLIENT_CTOCPP_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#if !defined(BUILDING_CEF_SHARED)
|
||||||
|
#error This file can be included DLL-side only
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "include/test/cef_translator_test.h"
|
||||||
|
#include "include/capi/test/cef_translator_test_capi.h"
|
||||||
|
#include "libcef_dll/ctocpp/ctocpp_scoped.h"
|
||||||
|
|
||||||
|
// Wrap a C structure with a C++ class.
|
||||||
|
// This class may be instantiated and accessed DLL-side only.
|
||||||
|
class CefTranslatorTestScopedClientCToCpp
|
||||||
|
: public CefCToCppScoped<CefTranslatorTestScopedClientCToCpp,
|
||||||
|
CefTranslatorTestScopedClient, cef_translator_test_scoped_client_t> {
|
||||||
|
public:
|
||||||
|
CefTranslatorTestScopedClientCToCpp();
|
||||||
|
|
||||||
|
// CefTranslatorTestScopedClient methods.
|
||||||
|
int GetValue() override;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_CLIENT_CTOCPP_H_
|
@ -0,0 +1,155 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This file was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "libcef_dll/ctocpp/test/translator_test_scoped_library_child_child_ctocpp.h"
|
||||||
|
|
||||||
|
|
||||||
|
// STATIC METHODS - Body may be edited by hand.
|
||||||
|
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibraryChildChild> CefTranslatorTestScopedLibraryChildChild::Create(
|
||||||
|
int value, int other_value, int other_other_value) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
cef_translator_test_scoped_library_child_child_t* _retval =
|
||||||
|
cef_translator_test_scoped_library_child_child_create(
|
||||||
|
value,
|
||||||
|
other_value,
|
||||||
|
other_other_value);
|
||||||
|
|
||||||
|
// Return type: ownptr_same
|
||||||
|
return CefTranslatorTestScopedLibraryChildChildCToCpp::Wrap(_retval);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// VIRTUAL METHODS - Body may be edited by hand.
|
||||||
|
|
||||||
|
int CefTranslatorTestScopedLibraryChildChildCToCpp::GetOtherOtherValue() {
|
||||||
|
cef_translator_test_scoped_library_child_child_t* _struct = GetStruct();
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, get_other_other_value))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = _struct->get_other_other_value(_struct);
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CefTranslatorTestScopedLibraryChildChildCToCpp::SetOtherOtherValue(
|
||||||
|
int value) {
|
||||||
|
cef_translator_test_scoped_library_child_child_t* _struct = GetStruct();
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, set_other_other_value))
|
||||||
|
return;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
_struct->set_other_other_value(_struct,
|
||||||
|
value);
|
||||||
|
}
|
||||||
|
|
||||||
|
int CefTranslatorTestScopedLibraryChildChildCToCpp::GetOtherValue() {
|
||||||
|
cef_translator_test_scoped_library_child_t* _struct =
|
||||||
|
reinterpret_cast<cef_translator_test_scoped_library_child_t*>(GetStruct(
|
||||||
|
));
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, get_other_value))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = _struct->get_other_value(_struct);
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CefTranslatorTestScopedLibraryChildChildCToCpp::SetOtherValue(int value) {
|
||||||
|
cef_translator_test_scoped_library_child_t* _struct =
|
||||||
|
reinterpret_cast<cef_translator_test_scoped_library_child_t*>(GetStruct(
|
||||||
|
));
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, set_other_value))
|
||||||
|
return;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
_struct->set_other_value(_struct,
|
||||||
|
value);
|
||||||
|
}
|
||||||
|
|
||||||
|
int CefTranslatorTestScopedLibraryChildChildCToCpp::GetValue() {
|
||||||
|
cef_translator_test_scoped_library_t* _struct =
|
||||||
|
reinterpret_cast<cef_translator_test_scoped_library_t*>(GetStruct());
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, get_value))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = _struct->get_value(_struct);
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CefTranslatorTestScopedLibraryChildChildCToCpp::SetValue(int value) {
|
||||||
|
cef_translator_test_scoped_library_t* _struct =
|
||||||
|
reinterpret_cast<cef_translator_test_scoped_library_t*>(GetStruct());
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, set_value))
|
||||||
|
return;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
_struct->set_value(_struct,
|
||||||
|
value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// CONSTRUCTOR - Do not edit by hand.
|
||||||
|
|
||||||
|
CefTranslatorTestScopedLibraryChildChildCToCpp::CefTranslatorTestScopedLibraryChildChildCToCpp(
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> cef_translator_test_scoped_library_child_child_t* CefCToCppScoped<CefTranslatorTestScopedLibraryChildChildCToCpp,
|
||||||
|
CefTranslatorTestScopedLibraryChildChild,
|
||||||
|
cef_translator_test_scoped_library_child_child_t>::UnwrapDerivedOwn(
|
||||||
|
CefWrapperType type,
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibraryChildChild> c) {
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> cef_translator_test_scoped_library_child_child_t* CefCToCppScoped<CefTranslatorTestScopedLibraryChildChildCToCpp,
|
||||||
|
CefTranslatorTestScopedLibraryChildChild,
|
||||||
|
cef_translator_test_scoped_library_child_child_t>::UnwrapDerivedRaw(
|
||||||
|
CefWrapperType type,
|
||||||
|
CefRawPtr<CefTranslatorTestScopedLibraryChildChild> c) {
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if DCHECK_IS_ON()
|
||||||
|
template<> base::AtomicRefCount CefCToCppScoped<CefTranslatorTestScopedLibraryChildChildCToCpp,
|
||||||
|
CefTranslatorTestScopedLibraryChildChild,
|
||||||
|
cef_translator_test_scoped_library_child_child_t>::DebugObjCt = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<> CefWrapperType CefCToCppScoped<CefTranslatorTestScopedLibraryChildChildCToCpp,
|
||||||
|
CefTranslatorTestScopedLibraryChildChild,
|
||||||
|
cef_translator_test_scoped_library_child_child_t>::kWrapperType =
|
||||||
|
WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD;
|
@ -0,0 +1,47 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This file was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD_CTOCPP_H_
|
||||||
|
#define CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD_CTOCPP_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#if !defined(WRAPPING_CEF_SHARED)
|
||||||
|
#error This file can be included wrapper-side only
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "include/test/cef_translator_test.h"
|
||||||
|
#include "include/capi/test/cef_translator_test_capi.h"
|
||||||
|
#include "libcef_dll/ctocpp/ctocpp_scoped.h"
|
||||||
|
|
||||||
|
// Wrap a C structure with a C++ class.
|
||||||
|
// This class may be instantiated and accessed wrapper-side only.
|
||||||
|
class CefTranslatorTestScopedLibraryChildChildCToCpp
|
||||||
|
: public CefCToCppScoped<CefTranslatorTestScopedLibraryChildChildCToCpp,
|
||||||
|
CefTranslatorTestScopedLibraryChildChild,
|
||||||
|
cef_translator_test_scoped_library_child_child_t> {
|
||||||
|
public:
|
||||||
|
CefTranslatorTestScopedLibraryChildChildCToCpp();
|
||||||
|
|
||||||
|
// CefTranslatorTestScopedLibraryChildChild methods.
|
||||||
|
int GetOtherOtherValue() OVERRIDE;
|
||||||
|
void SetOtherOtherValue(int value) OVERRIDE;
|
||||||
|
|
||||||
|
// CefTranslatorTestScopedLibraryChild methods.
|
||||||
|
int GetOtherValue() OVERRIDE;
|
||||||
|
void SetOtherValue(int value) OVERRIDE;
|
||||||
|
|
||||||
|
// CefTranslatorTestScopedLibrary methods.
|
||||||
|
int GetValue() OVERRIDE;
|
||||||
|
void SetValue(int value) OVERRIDE;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD_CTOCPP_H_
|
@ -0,0 +1,135 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This file was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.h"
|
||||||
|
#include "libcef_dll/ctocpp/test/translator_test_scoped_library_child_child_ctocpp.h"
|
||||||
|
|
||||||
|
|
||||||
|
// STATIC METHODS - Body may be edited by hand.
|
||||||
|
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibraryChild> CefTranslatorTestScopedLibraryChild::Create(
|
||||||
|
int value, int other_value) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
cef_translator_test_scoped_library_child_t* _retval =
|
||||||
|
cef_translator_test_scoped_library_child_create(
|
||||||
|
value,
|
||||||
|
other_value);
|
||||||
|
|
||||||
|
// Return type: ownptr_same
|
||||||
|
return CefTranslatorTestScopedLibraryChildCToCpp::Wrap(_retval);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// VIRTUAL METHODS - Body may be edited by hand.
|
||||||
|
|
||||||
|
int CefTranslatorTestScopedLibraryChildCToCpp::GetOtherValue() {
|
||||||
|
cef_translator_test_scoped_library_child_t* _struct = GetStruct();
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, get_other_value))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = _struct->get_other_value(_struct);
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CefTranslatorTestScopedLibraryChildCToCpp::SetOtherValue(int value) {
|
||||||
|
cef_translator_test_scoped_library_child_t* _struct = GetStruct();
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, set_other_value))
|
||||||
|
return;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
_struct->set_other_value(_struct,
|
||||||
|
value);
|
||||||
|
}
|
||||||
|
|
||||||
|
int CefTranslatorTestScopedLibraryChildCToCpp::GetValue() {
|
||||||
|
cef_translator_test_scoped_library_t* _struct =
|
||||||
|
reinterpret_cast<cef_translator_test_scoped_library_t*>(GetStruct());
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, get_value))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = _struct->get_value(_struct);
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CefTranslatorTestScopedLibraryChildCToCpp::SetValue(int value) {
|
||||||
|
cef_translator_test_scoped_library_t* _struct =
|
||||||
|
reinterpret_cast<cef_translator_test_scoped_library_t*>(GetStruct());
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, set_value))
|
||||||
|
return;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
_struct->set_value(_struct,
|
||||||
|
value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// CONSTRUCTOR - Do not edit by hand.
|
||||||
|
|
||||||
|
CefTranslatorTestScopedLibraryChildCToCpp::CefTranslatorTestScopedLibraryChildCToCpp(
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> cef_translator_test_scoped_library_child_t* CefCToCppScoped<CefTranslatorTestScopedLibraryChildCToCpp,
|
||||||
|
CefTranslatorTestScopedLibraryChild,
|
||||||
|
cef_translator_test_scoped_library_child_t>::UnwrapDerivedOwn(
|
||||||
|
CefWrapperType type, CefOwnPtr<CefTranslatorTestScopedLibraryChild> c) {
|
||||||
|
if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD) {
|
||||||
|
return reinterpret_cast<cef_translator_test_scoped_library_child_t*>(
|
||||||
|
CefTranslatorTestScopedLibraryChildChildCToCpp::UnwrapOwn(
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibraryChildChild>(
|
||||||
|
reinterpret_cast<CefTranslatorTestScopedLibraryChildChild*>(c.release(
|
||||||
|
)))));
|
||||||
|
}
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> cef_translator_test_scoped_library_child_t* CefCToCppScoped<CefTranslatorTestScopedLibraryChildCToCpp,
|
||||||
|
CefTranslatorTestScopedLibraryChild,
|
||||||
|
cef_translator_test_scoped_library_child_t>::UnwrapDerivedRaw(
|
||||||
|
CefWrapperType type, CefRawPtr<CefTranslatorTestScopedLibraryChild> c) {
|
||||||
|
if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD) {
|
||||||
|
return reinterpret_cast<cef_translator_test_scoped_library_child_t*>(
|
||||||
|
CefTranslatorTestScopedLibraryChildChildCToCpp::UnwrapRaw(
|
||||||
|
CefRawPtr<CefTranslatorTestScopedLibraryChildChild>(
|
||||||
|
reinterpret_cast<CefTranslatorTestScopedLibraryChildChild*>(c))));
|
||||||
|
}
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if DCHECK_IS_ON()
|
||||||
|
template<> base::AtomicRefCount CefCToCppScoped<CefTranslatorTestScopedLibraryChildCToCpp,
|
||||||
|
CefTranslatorTestScopedLibraryChild,
|
||||||
|
cef_translator_test_scoped_library_child_t>::DebugObjCt = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<> CefWrapperType CefCToCppScoped<CefTranslatorTestScopedLibraryChildCToCpp,
|
||||||
|
CefTranslatorTestScopedLibraryChild,
|
||||||
|
cef_translator_test_scoped_library_child_t>::kWrapperType =
|
||||||
|
WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD;
|
@ -0,0 +1,43 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This file was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CTOCPP_H_
|
||||||
|
#define CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CTOCPP_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#if !defined(WRAPPING_CEF_SHARED)
|
||||||
|
#error This file can be included wrapper-side only
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "include/test/cef_translator_test.h"
|
||||||
|
#include "include/capi/test/cef_translator_test_capi.h"
|
||||||
|
#include "libcef_dll/ctocpp/ctocpp_scoped.h"
|
||||||
|
|
||||||
|
// Wrap a C structure with a C++ class.
|
||||||
|
// This class may be instantiated and accessed wrapper-side only.
|
||||||
|
class CefTranslatorTestScopedLibraryChildCToCpp
|
||||||
|
: public CefCToCppScoped<CefTranslatorTestScopedLibraryChildCToCpp,
|
||||||
|
CefTranslatorTestScopedLibraryChild,
|
||||||
|
cef_translator_test_scoped_library_child_t> {
|
||||||
|
public:
|
||||||
|
CefTranslatorTestScopedLibraryChildCToCpp();
|
||||||
|
|
||||||
|
// CefTranslatorTestScopedLibraryChild methods.
|
||||||
|
int GetOtherValue() OVERRIDE;
|
||||||
|
void SetOtherValue(int value) OVERRIDE;
|
||||||
|
|
||||||
|
// CefTranslatorTestScopedLibrary methods.
|
||||||
|
int GetValue() OVERRIDE;
|
||||||
|
void SetValue(int value) OVERRIDE;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CTOCPP_H_
|
118
libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.cc
Normal file
118
libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.cc
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This file was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.h"
|
||||||
|
#include "libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.h"
|
||||||
|
#include "libcef_dll/ctocpp/test/translator_test_scoped_library_child_child_ctocpp.h"
|
||||||
|
|
||||||
|
|
||||||
|
// STATIC METHODS - Body may be edited by hand.
|
||||||
|
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibrary> CefTranslatorTestScopedLibrary::Create(
|
||||||
|
int value) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
cef_translator_test_scoped_library_t* _retval =
|
||||||
|
cef_translator_test_scoped_library_create(
|
||||||
|
value);
|
||||||
|
|
||||||
|
// Return type: ownptr_same
|
||||||
|
return CefTranslatorTestScopedLibraryCToCpp::Wrap(_retval);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// VIRTUAL METHODS - Body may be edited by hand.
|
||||||
|
|
||||||
|
int CefTranslatorTestScopedLibraryCToCpp::GetValue() {
|
||||||
|
cef_translator_test_scoped_library_t* _struct = GetStruct();
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, get_value))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
int _retval = _struct->get_value(_struct);
|
||||||
|
|
||||||
|
// Return type: simple
|
||||||
|
return _retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CefTranslatorTestScopedLibraryCToCpp::SetValue(int value) {
|
||||||
|
cef_translator_test_scoped_library_t* _struct = GetStruct();
|
||||||
|
if (CEF_MEMBER_MISSING(_struct, set_value))
|
||||||
|
return;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
_struct->set_value(_struct,
|
||||||
|
value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// CONSTRUCTOR - Do not edit by hand.
|
||||||
|
|
||||||
|
CefTranslatorTestScopedLibraryCToCpp::CefTranslatorTestScopedLibraryCToCpp() {
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> cef_translator_test_scoped_library_t* CefCToCppScoped<CefTranslatorTestScopedLibraryCToCpp,
|
||||||
|
CefTranslatorTestScopedLibrary,
|
||||||
|
cef_translator_test_scoped_library_t>::UnwrapDerivedOwn(
|
||||||
|
CefWrapperType type, CefOwnPtr<CefTranslatorTestScopedLibrary> c) {
|
||||||
|
if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD) {
|
||||||
|
return reinterpret_cast<cef_translator_test_scoped_library_t*>(
|
||||||
|
CefTranslatorTestScopedLibraryChildCToCpp::UnwrapOwn(
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibraryChild>(
|
||||||
|
reinterpret_cast<CefTranslatorTestScopedLibraryChild*>(c.release()))));
|
||||||
|
}
|
||||||
|
if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD) {
|
||||||
|
return reinterpret_cast<cef_translator_test_scoped_library_t*>(
|
||||||
|
CefTranslatorTestScopedLibraryChildChildCToCpp::UnwrapOwn(
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibraryChildChild>(
|
||||||
|
reinterpret_cast<CefTranslatorTestScopedLibraryChildChild*>(c.release(
|
||||||
|
)))));
|
||||||
|
}
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> cef_translator_test_scoped_library_t* CefCToCppScoped<CefTranslatorTestScopedLibraryCToCpp,
|
||||||
|
CefTranslatorTestScopedLibrary,
|
||||||
|
cef_translator_test_scoped_library_t>::UnwrapDerivedRaw(
|
||||||
|
CefWrapperType type, CefRawPtr<CefTranslatorTestScopedLibrary> c) {
|
||||||
|
if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD) {
|
||||||
|
return reinterpret_cast<cef_translator_test_scoped_library_t*>(
|
||||||
|
CefTranslatorTestScopedLibraryChildCToCpp::UnwrapRaw(
|
||||||
|
CefRawPtr<CefTranslatorTestScopedLibraryChild>(
|
||||||
|
reinterpret_cast<CefTranslatorTestScopedLibraryChild*>(c))));
|
||||||
|
}
|
||||||
|
if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD) {
|
||||||
|
return reinterpret_cast<cef_translator_test_scoped_library_t*>(
|
||||||
|
CefTranslatorTestScopedLibraryChildChildCToCpp::UnwrapRaw(
|
||||||
|
CefRawPtr<CefTranslatorTestScopedLibraryChildChild>(
|
||||||
|
reinterpret_cast<CefTranslatorTestScopedLibraryChildChild*>(c))));
|
||||||
|
}
|
||||||
|
NOTREACHED() << "Unexpected class type: " << type;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if DCHECK_IS_ON()
|
||||||
|
template<> base::AtomicRefCount CefCToCppScoped<CefTranslatorTestScopedLibraryCToCpp,
|
||||||
|
CefTranslatorTestScopedLibrary,
|
||||||
|
cef_translator_test_scoped_library_t>::DebugObjCt = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<> CefWrapperType CefCToCppScoped<CefTranslatorTestScopedLibraryCToCpp,
|
||||||
|
CefTranslatorTestScopedLibrary,
|
||||||
|
cef_translator_test_scoped_library_t>::kWrapperType =
|
||||||
|
WT_TRANSLATOR_TEST_SCOPED_LIBRARY;
|
@ -0,0 +1,39 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This file was generated by the CEF translator tool. If making changes by
|
||||||
|
// hand only do so within the body of existing method and function
|
||||||
|
// implementations. See the translator.README.txt file in the tools directory
|
||||||
|
// for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CTOCPP_H_
|
||||||
|
#define CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CTOCPP_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#if !defined(WRAPPING_CEF_SHARED)
|
||||||
|
#error This file can be included wrapper-side only
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "include/test/cef_translator_test.h"
|
||||||
|
#include "include/capi/test/cef_translator_test_capi.h"
|
||||||
|
#include "libcef_dll/ctocpp/ctocpp_scoped.h"
|
||||||
|
|
||||||
|
// Wrap a C structure with a C++ class.
|
||||||
|
// This class may be instantiated and accessed wrapper-side only.
|
||||||
|
class CefTranslatorTestScopedLibraryCToCpp
|
||||||
|
: public CefCToCppScoped<CefTranslatorTestScopedLibraryCToCpp,
|
||||||
|
CefTranslatorTestScopedLibrary,
|
||||||
|
cef_translator_test_scoped_library_t> {
|
||||||
|
public:
|
||||||
|
CefTranslatorTestScopedLibraryCToCpp();
|
||||||
|
|
||||||
|
// CefTranslatorTestScopedLibrary methods.
|
||||||
|
int GetValue() OVERRIDE;
|
||||||
|
void SetValue(int value) OVERRIDE;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_SCOPED_LIBRARY_CTOCPP_H_
|
19
libcef_dll/ptr_util.h
Normal file
19
libcef_dll/ptr_util.h
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||||
|
// reserved. Use of this source code is governed by a BSD-style license that
|
||||||
|
// can be found in the LICENSE file.
|
||||||
|
|
||||||
|
#ifndef CEF_LIBCEF_DLL_PTR_UTIL_H_
|
||||||
|
#define CEF_LIBCEF_DLL_PTR_UTIL_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
// Helpers for CefOwnPtr<>.
|
||||||
|
#if defined(USING_CHROMIUM_INCLUDES)
|
||||||
|
#define OWN_PASS(p) std::move(p)
|
||||||
|
#define OWN_RETURN_AS(p,t) (p)
|
||||||
|
#else
|
||||||
|
#define OWN_PASS(p) (p).Pass()
|
||||||
|
#define OWN_RETURN_AS(p,t) (p).PassAs<t>()
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // CEF_LIBCEF_DLL_PTR_UTIL_H_
|
||||||
|
|
@ -117,11 +117,16 @@ enum CefWrapperType {
|
|||||||
WT_TEXTFIELD_DELEGATE,
|
WT_TEXTFIELD_DELEGATE,
|
||||||
WT_THREAD,
|
WT_THREAD,
|
||||||
WT_TRANSLATOR_TEST,
|
WT_TRANSLATOR_TEST,
|
||||||
WT_TRANSLATOR_TEST_HANDLER,
|
WT_TRANSLATOR_TEST_REF_PTR_CLIENT,
|
||||||
WT_TRANSLATOR_TEST_HANDLER_CHILD,
|
WT_TRANSLATOR_TEST_REF_PTR_CLIENT_CHILD,
|
||||||
WT_TRANSLATOR_TEST_OBJECT,
|
WT_TRANSLATOR_TEST_REF_PTR_LIBRARY,
|
||||||
WT_TRANSLATOR_TEST_OBJECT_CHILD,
|
WT_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD,
|
||||||
WT_TRANSLATOR_TEST_OBJECT_CHILD_CHILD,
|
WT_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CHILD,
|
||||||
|
WT_TRANSLATOR_TEST_SCOPED_CLIENT,
|
||||||
|
WT_TRANSLATOR_TEST_SCOPED_CLIENT_CHILD,
|
||||||
|
WT_TRANSLATOR_TEST_SCOPED_LIBRARY,
|
||||||
|
WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD,
|
||||||
|
WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD,
|
||||||
WT_URLREQUEST,
|
WT_URLREQUEST,
|
||||||
WT_URLREQUEST_CLIENT,
|
WT_URLREQUEST_CLIENT,
|
||||||
WT_V8ACCESSOR,
|
WT_V8ACCESSOR,
|
||||||
|
@ -9,7 +9,7 @@ namespace client {
|
|||||||
|
|
||||||
// static
|
// static
|
||||||
void ClientApp::RegisterCustomSchemes(
|
void ClientApp::RegisterCustomSchemes(
|
||||||
CefRefPtr<CefSchemeRegistrar> registrar,
|
CefRawPtr<CefSchemeRegistrar> registrar,
|
||||||
std::vector<CefString>& cookiable_schemes) {
|
std::vector<CefString>& cookiable_schemes) {
|
||||||
scheme_test::RegisterCustomSchemes(registrar, cookiable_schemes);
|
scheme_test::RegisterCustomSchemes(registrar, cookiable_schemes);
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
namespace client {
|
namespace client {
|
||||||
namespace scheme_test {
|
namespace scheme_test {
|
||||||
|
|
||||||
void RegisterCustomSchemes(CefRefPtr<CefSchemeRegistrar> registrar,
|
void RegisterCustomSchemes(CefRawPtr<CefSchemeRegistrar> registrar,
|
||||||
std::vector<CefString>& cookiable_schemes) {
|
std::vector<CefString>& cookiable_schemes) {
|
||||||
registrar->AddCustomScheme("client", true, false, false, false, true);
|
registrar->AddCustomScheme("client", true, false, false, false, true);
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ namespace scheme_test {
|
|||||||
// See browser/scheme_test.h for creation/registration of the custom scheme
|
// See browser/scheme_test.h for creation/registration of the custom scheme
|
||||||
// handler which only occurs in the browser process. Called from
|
// handler which only occurs in the browser process. Called from
|
||||||
// client_app_delegates_common.cc.
|
// client_app_delegates_common.cc.
|
||||||
void RegisterCustomSchemes(CefRefPtr<CefSchemeRegistrar> registrar,
|
void RegisterCustomSchemes(CefRawPtr<CefSchemeRegistrar> registrar,
|
||||||
std::vector<CefString>& cookiable_schemes);
|
std::vector<CefString>& cookiable_schemes);
|
||||||
|
|
||||||
} // namespace scheme_test
|
} // namespace scheme_test
|
||||||
|
@ -98,23 +98,23 @@ void CreateRenderDelegates(ClientAppRenderer::DelegateSet& delegates) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RegisterCustomSchemes(
|
void RegisterCustomSchemes(
|
||||||
CefRefPtr<CefSchemeRegistrar> registrar,
|
CefRawPtr<CefSchemeRegistrar> registrar,
|
||||||
std::vector<CefString>& cookiable_schemes) {
|
std::vector<CefString>& cookiable_schemes) {
|
||||||
// Bring in the scheme handler tests.
|
// Bring in the scheme handler tests.
|
||||||
extern void RegisterSchemeHandlerCustomSchemes(
|
extern void RegisterSchemeHandlerCustomSchemes(
|
||||||
CefRefPtr<CefSchemeRegistrar> registrar,
|
CefRawPtr<CefSchemeRegistrar> registrar,
|
||||||
std::vector<CefString>& cookiable_schemes);
|
std::vector<CefString>& cookiable_schemes);
|
||||||
RegisterSchemeHandlerCustomSchemes(registrar, cookiable_schemes);
|
RegisterSchemeHandlerCustomSchemes(registrar, cookiable_schemes);
|
||||||
|
|
||||||
// Bring in the cookie tests.
|
// Bring in the cookie tests.
|
||||||
extern void RegisterCookieCustomSchemes(
|
extern void RegisterCookieCustomSchemes(
|
||||||
CefRefPtr<CefSchemeRegistrar> registrar,
|
CefRawPtr<CefSchemeRegistrar> registrar,
|
||||||
std::vector<CefString>& cookiable_schemes);
|
std::vector<CefString>& cookiable_schemes);
|
||||||
RegisterCookieCustomSchemes(registrar, cookiable_schemes);
|
RegisterCookieCustomSchemes(registrar, cookiable_schemes);
|
||||||
|
|
||||||
// Bring in the URLRequest tests.
|
// Bring in the URLRequest tests.
|
||||||
extern void RegisterURLRequestCustomSchemes(
|
extern void RegisterURLRequestCustomSchemes(
|
||||||
CefRefPtr<CefSchemeRegistrar> registrar,
|
CefRawPtr<CefSchemeRegistrar> registrar,
|
||||||
std::vector<CefString>& cookiable_schemes);
|
std::vector<CefString>& cookiable_schemes);
|
||||||
RegisterURLRequestCustomSchemes(registrar, cookiable_schemes);
|
RegisterURLRequestCustomSchemes(registrar, cookiable_schemes);
|
||||||
}
|
}
|
||||||
@ -139,7 +139,7 @@ void ClientAppRenderer::CreateDelegates(DelegateSet& delegates) {
|
|||||||
|
|
||||||
// static
|
// static
|
||||||
void ClientApp::RegisterCustomSchemes(
|
void ClientApp::RegisterCustomSchemes(
|
||||||
CefRefPtr<CefSchemeRegistrar> registrar,
|
CefRawPtr<CefSchemeRegistrar> registrar,
|
||||||
std::vector<CefString>& cookiable_schemes) {
|
std::vector<CefString>& cookiable_schemes) {
|
||||||
::RegisterCustomSchemes(registrar, cookiable_schemes);
|
::RegisterCustomSchemes(registrar, cookiable_schemes);
|
||||||
}
|
}
|
||||||
|
@ -1336,7 +1336,7 @@ TEST(CookieTest, GetCookieManagerCustom) {
|
|||||||
// Entry point for registering custom schemes.
|
// Entry point for registering custom schemes.
|
||||||
// Called from client_app_delegates.cc.
|
// Called from client_app_delegates.cc.
|
||||||
void RegisterCookieCustomSchemes(
|
void RegisterCookieCustomSchemes(
|
||||||
CefRefPtr<CefSchemeRegistrar> registrar,
|
CefRawPtr<CefSchemeRegistrar> registrar,
|
||||||
std::vector<CefString>& cookiable_schemes) {
|
std::vector<CefString>& cookiable_schemes) {
|
||||||
// Used by GetCookieManagerCustom test.
|
// Used by GetCookieManagerCustom test.
|
||||||
registrar->AddCustomScheme("ccustom", true, false, false, false, true);
|
registrar->AddCustomScheme("ccustom", true, false, false, false, true);
|
||||||
|
@ -1667,7 +1667,7 @@ TEST(SchemeHandlerTest, AcceptLanguage) {
|
|||||||
// Entry point for registering custom schemes.
|
// Entry point for registering custom schemes.
|
||||||
// Called from client_app_delegates.cc.
|
// Called from client_app_delegates.cc.
|
||||||
void RegisterSchemeHandlerCustomSchemes(
|
void RegisterSchemeHandlerCustomSchemes(
|
||||||
CefRefPtr<CefSchemeRegistrar> registrar,
|
CefRawPtr<CefSchemeRegistrar> registrar,
|
||||||
std::vector<CefString>& cookiable_schemes) {
|
std::vector<CefString>& cookiable_schemes) {
|
||||||
// Add a custom standard scheme.
|
// Add a custom standard scheme.
|
||||||
registrar->AddCustomScheme("customstd", true, false, false, false, true);
|
registrar->AddCustomScheme("customstd", true, false, false, false, true);
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
// can be found in the LICENSE file.
|
// can be found in the LICENSE file.
|
||||||
|
|
||||||
#include "include/test/cef_translator_test.h"
|
#include "include/test/cef_translator_test.h"
|
||||||
|
#include "tests/ceftests/test_handler.h"
|
||||||
#include "tests/gtest/include/gtest/gtest.h"
|
#include "tests/gtest/include/gtest/gtest.h"
|
||||||
|
|
||||||
// Test getting/setting primitive types.
|
// Test getting/setting primitive types.
|
||||||
@ -168,22 +169,23 @@ TEST(TranslatorTest, StructList) {
|
|||||||
EXPECT_TRUE(obj->HasOneRef());
|
EXPECT_TRUE(obj->HasOneRef());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test getting/setting library-side object types.
|
// Test getting/setting library-side RefPtr types.
|
||||||
TEST(TranslatorTest, Object) {
|
TEST(TranslatorTest, RefPtrLibrary) {
|
||||||
CefRefPtr<CefTranslatorTest> obj = CefTranslatorTest::Create();
|
CefRefPtr<CefTranslatorTest> obj = CefTranslatorTest::Create();
|
||||||
|
|
||||||
const int kTestVal = 12;
|
const int kTestVal = 12;
|
||||||
CefRefPtr<CefTranslatorTestObject> test_obj =
|
CefRefPtr<CefTranslatorTestRefPtrLibrary> test_obj =
|
||||||
CefTranslatorTestObject::Create(kTestVal);
|
CefTranslatorTestRefPtrLibrary::Create(kTestVal);
|
||||||
EXPECT_EQ(kTestVal, test_obj->GetValue());
|
EXPECT_EQ(kTestVal, test_obj->GetValue());
|
||||||
int retval = obj->SetObject(test_obj);
|
int retval = obj->SetRefPtrLibrary(test_obj);
|
||||||
EXPECT_EQ(kTestVal, retval);
|
EXPECT_EQ(kTestVal, retval);
|
||||||
EXPECT_EQ(kTestVal, test_obj->GetValue());
|
EXPECT_EQ(kTestVal, test_obj->GetValue());
|
||||||
|
|
||||||
const int kTestVal2 = 30;
|
const int kTestVal2 = 30;
|
||||||
CefRefPtr<CefTranslatorTestObject> test_obj2 = obj->GetObject(kTestVal2);
|
CefRefPtr<CefTranslatorTestRefPtrLibrary> test_obj2 =
|
||||||
|
obj->GetRefPtrLibrary(kTestVal2);
|
||||||
EXPECT_EQ(kTestVal2, test_obj2->GetValue());
|
EXPECT_EQ(kTestVal2, test_obj2->GetValue());
|
||||||
int retval2 = obj->SetObject(test_obj2);
|
int retval2 = obj->SetRefPtrLibrary(test_obj2);
|
||||||
EXPECT_EQ(kTestVal2, retval2);
|
EXPECT_EQ(kTestVal2, retval2);
|
||||||
EXPECT_EQ(kTestVal2, test_obj2->GetValue());
|
EXPECT_EQ(kTestVal2, test_obj2->GetValue());
|
||||||
|
|
||||||
@ -193,39 +195,41 @@ TEST(TranslatorTest, Object) {
|
|||||||
EXPECT_TRUE(test_obj2->HasOneRef());
|
EXPECT_TRUE(test_obj2->HasOneRef());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test getting/setting inherited library-side object types.
|
// Test getting/setting inherited library-side RefPtr types.
|
||||||
TEST(TranslatorTest, ObjectInherit) {
|
TEST(TranslatorTest, RefPtrLibraryInherit) {
|
||||||
CefRefPtr<CefTranslatorTest> obj = CefTranslatorTest::Create();
|
CefRefPtr<CefTranslatorTest> obj = CefTranslatorTest::Create();
|
||||||
|
|
||||||
const int kTestVal = 12;
|
const int kTestVal = 12;
|
||||||
const int kTestVal2 = 40;
|
const int kTestVal2 = 40;
|
||||||
CefRefPtr<CefTranslatorTestObjectChild> test_obj =
|
CefRefPtr<CefTranslatorTestRefPtrLibraryChild> test_obj =
|
||||||
CefTranslatorTestObjectChild::Create(kTestVal, kTestVal2);
|
CefTranslatorTestRefPtrLibraryChild::Create(kTestVal, kTestVal2);
|
||||||
EXPECT_EQ(kTestVal, test_obj->GetValue());
|
EXPECT_EQ(kTestVal, test_obj->GetValue());
|
||||||
EXPECT_EQ(kTestVal2, test_obj->GetOtherValue());
|
EXPECT_EQ(kTestVal2, test_obj->GetOtherValue());
|
||||||
int retval = obj->SetObject(test_obj);
|
int retval = obj->SetRefPtrLibrary(test_obj);
|
||||||
EXPECT_EQ(kTestVal, retval);
|
EXPECT_EQ(kTestVal, retval);
|
||||||
EXPECT_EQ(kTestVal, test_obj->GetValue());
|
EXPECT_EQ(kTestVal, test_obj->GetValue());
|
||||||
EXPECT_EQ(kTestVal2, test_obj->GetOtherValue());
|
EXPECT_EQ(kTestVal2, test_obj->GetOtherValue());
|
||||||
|
|
||||||
EXPECT_EQ(kTestVal, obj->SetChildObject(test_obj));
|
EXPECT_EQ(kTestVal, obj->SetChildRefPtrLibrary(test_obj));
|
||||||
EXPECT_EQ(kTestVal, obj->SetChildObjectAndReturnParent(test_obj)->GetValue());
|
EXPECT_EQ(kTestVal,
|
||||||
|
obj->SetChildRefPtrLibraryAndReturnParent(test_obj)->GetValue());
|
||||||
|
|
||||||
const int kTestVal3 = 100;
|
const int kTestVal3 = 100;
|
||||||
CefRefPtr<CefTranslatorTestObjectChildChild> test_obj2 =
|
CefRefPtr<CefTranslatorTestRefPtrLibraryChildChild> test_obj2 =
|
||||||
CefTranslatorTestObjectChildChild::Create(kTestVal, kTestVal2, kTestVal3);
|
CefTranslatorTestRefPtrLibraryChildChild::Create(kTestVal, kTestVal2,
|
||||||
|
kTestVal3);
|
||||||
EXPECT_EQ(kTestVal, test_obj2->GetValue());
|
EXPECT_EQ(kTestVal, test_obj2->GetValue());
|
||||||
EXPECT_EQ(kTestVal2, test_obj2->GetOtherValue());
|
EXPECT_EQ(kTestVal2, test_obj2->GetOtherValue());
|
||||||
EXPECT_EQ(kTestVal3, test_obj2->GetOtherOtherValue());
|
EXPECT_EQ(kTestVal3, test_obj2->GetOtherOtherValue());
|
||||||
int retval2 = obj->SetObject(test_obj2);
|
int retval2 = obj->SetRefPtrLibrary(test_obj2);
|
||||||
EXPECT_EQ(kTestVal, retval2);
|
EXPECT_EQ(kTestVal, retval2);
|
||||||
EXPECT_EQ(kTestVal, test_obj2->GetValue());
|
EXPECT_EQ(kTestVal, test_obj2->GetValue());
|
||||||
EXPECT_EQ(kTestVal2, test_obj2->GetOtherValue());
|
EXPECT_EQ(kTestVal2, test_obj2->GetOtherValue());
|
||||||
EXPECT_EQ(kTestVal3, test_obj2->GetOtherOtherValue());
|
EXPECT_EQ(kTestVal3, test_obj2->GetOtherOtherValue());
|
||||||
|
|
||||||
EXPECT_EQ(kTestVal, obj->SetChildObject(test_obj2));
|
EXPECT_EQ(kTestVal, obj->SetChildRefPtrLibrary(test_obj2));
|
||||||
EXPECT_EQ(kTestVal,
|
EXPECT_EQ(kTestVal,
|
||||||
obj->SetChildObjectAndReturnParent(test_obj2)->GetValue());
|
obj->SetChildRefPtrLibraryAndReturnParent(test_obj2)->GetValue());
|
||||||
|
|
||||||
// Only one reference to the object should exist.
|
// Only one reference to the object should exist.
|
||||||
EXPECT_TRUE(obj->HasOneRef());
|
EXPECT_TRUE(obj->HasOneRef());
|
||||||
@ -233,25 +237,25 @@ TEST(TranslatorTest, ObjectInherit) {
|
|||||||
EXPECT_TRUE(test_obj2->HasOneRef());
|
EXPECT_TRUE(test_obj2->HasOneRef());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test getting/setting library-side object list types.
|
// Test getting/setting library-side RefPtr list types.
|
||||||
TEST(TranslatorTest, ObjectList) {
|
TEST(TranslatorTest, RefPtrLibraryList) {
|
||||||
CefRefPtr<CefTranslatorTest> obj = CefTranslatorTest::Create();
|
CefRefPtr<CefTranslatorTest> obj = CefTranslatorTest::Create();
|
||||||
|
|
||||||
const int kVal1 = 34;
|
const int kVal1 = 34;
|
||||||
const int kVal2 = 10;
|
const int kVal2 = 10;
|
||||||
|
|
||||||
CefRefPtr<CefTranslatorTestObject> val1 =
|
CefRefPtr<CefTranslatorTestRefPtrLibrary> val1 =
|
||||||
CefTranslatorTestObject::Create(kVal1);
|
CefTranslatorTestRefPtrLibrary::Create(kVal1);
|
||||||
CefRefPtr<CefTranslatorTestObject> val2 =
|
CefRefPtr<CefTranslatorTestRefPtrLibrary> val2 =
|
||||||
CefTranslatorTestObjectChild::Create(kVal2, 0);
|
CefTranslatorTestRefPtrLibraryChild::Create(kVal2, 0);
|
||||||
|
|
||||||
std::vector<CefRefPtr<CefTranslatorTestObject> > list;
|
std::vector<CefRefPtr<CefTranslatorTestRefPtrLibrary> > list;
|
||||||
list.push_back(val1);
|
list.push_back(val1);
|
||||||
list.push_back(val2);
|
list.push_back(val2);
|
||||||
EXPECT_TRUE(obj->SetObjectList(list, kVal1, kVal2));
|
EXPECT_TRUE(obj->SetRefPtrLibraryList(list, kVal1, kVal2));
|
||||||
|
|
||||||
list.clear();
|
list.clear();
|
||||||
EXPECT_TRUE(obj->GetObjectListByRef(list, kVal1, kVal2));
|
EXPECT_TRUE(obj->GetRefPtrLibraryListByRef(list, kVal1, kVal2));
|
||||||
EXPECT_EQ(2U, list.size());
|
EXPECT_EQ(2U, list.size());
|
||||||
EXPECT_EQ(kVal1, list[0]->GetValue());
|
EXPECT_EQ(kVal1, list[0]->GetValue());
|
||||||
EXPECT_EQ(kVal2, list[1]->GetValue());
|
EXPECT_EQ(kVal2, list[1]->GetValue());
|
||||||
@ -266,9 +270,9 @@ TEST(TranslatorTest, ObjectList) {
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
class TranslatorTestHandler : public CefTranslatorTestHandler {
|
class TranslatorTestRefPtrClient : public CefTranslatorTestRefPtrClient {
|
||||||
public:
|
public:
|
||||||
explicit TranslatorTestHandler(const int val)
|
explicit TranslatorTestRefPtrClient(const int val)
|
||||||
: val_(val) {
|
: val_(val) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -279,13 +283,14 @@ class TranslatorTestHandler : public CefTranslatorTestHandler {
|
|||||||
private:
|
private:
|
||||||
const int val_;
|
const int val_;
|
||||||
|
|
||||||
IMPLEMENT_REFCOUNTING(TranslatorTestHandler);
|
IMPLEMENT_REFCOUNTING(TranslatorTestRefPtrClient);
|
||||||
DISALLOW_COPY_AND_ASSIGN(TranslatorTestHandler);
|
DISALLOW_COPY_AND_ASSIGN(TranslatorTestRefPtrClient);
|
||||||
};
|
};
|
||||||
|
|
||||||
class TranslatorTestHandlerChild : public CefTranslatorTestHandlerChild {
|
class TranslatorTestRefPtrClientChild :
|
||||||
|
public CefTranslatorTestRefPtrClientChild {
|
||||||
public:
|
public:
|
||||||
TranslatorTestHandlerChild(const int val,
|
TranslatorTestRefPtrClientChild(const int val,
|
||||||
const int other_val)
|
const int other_val)
|
||||||
: val_(val),
|
: val_(val),
|
||||||
other_val_(other_val) {
|
other_val_(other_val) {
|
||||||
@ -303,24 +308,24 @@ class TranslatorTestHandlerChild : public CefTranslatorTestHandlerChild {
|
|||||||
const int val_;
|
const int val_;
|
||||||
const int other_val_;
|
const int other_val_;
|
||||||
|
|
||||||
IMPLEMENT_REFCOUNTING(TranslatorTestHandlerChild);
|
IMPLEMENT_REFCOUNTING(TranslatorTestRefPtrClientChild);
|
||||||
DISALLOW_COPY_AND_ASSIGN(TranslatorTestHandlerChild);
|
DISALLOW_COPY_AND_ASSIGN(TranslatorTestRefPtrClientChild);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
// Test getting/setting client-side handler types.
|
// Test getting/setting client-side RefPtr types.
|
||||||
TEST(TranslatorTest, Handler) {
|
TEST(TranslatorTest, RefPtrClient) {
|
||||||
CefRefPtr<CefTranslatorTest> obj = CefTranslatorTest::Create();
|
CefRefPtr<CefTranslatorTest> obj = CefTranslatorTest::Create();
|
||||||
|
|
||||||
const int kTestVal = 12;
|
const int kTestVal = 12;
|
||||||
|
|
||||||
CefRefPtr<TranslatorTestHandler> test_obj =
|
CefRefPtr<TranslatorTestRefPtrClient> test_obj =
|
||||||
new TranslatorTestHandler(kTestVal);
|
new TranslatorTestRefPtrClient(kTestVal);
|
||||||
EXPECT_EQ(kTestVal, test_obj->GetValue());
|
EXPECT_EQ(kTestVal, test_obj->GetValue());
|
||||||
EXPECT_EQ(kTestVal, obj->SetHandler(test_obj.get()));
|
EXPECT_EQ(kTestVal, obj->SetRefPtrClient(test_obj.get()));
|
||||||
CefRefPtr<CefTranslatorTestHandler> handler =
|
CefRefPtr<CefTranslatorTestRefPtrClient> handler =
|
||||||
obj->SetHandlerAndReturn(test_obj.get());
|
obj->SetRefPtrClientAndReturn(test_obj.get());
|
||||||
EXPECT_EQ(test_obj.get(), handler.get());
|
EXPECT_EQ(test_obj.get(), handler.get());
|
||||||
EXPECT_EQ(kTestVal, handler->GetValue());
|
EXPECT_EQ(kTestVal, handler->GetValue());
|
||||||
handler = NULL;
|
handler = NULL;
|
||||||
@ -330,25 +335,25 @@ TEST(TranslatorTest, Handler) {
|
|||||||
EXPECT_TRUE(test_obj->HasOneRef());
|
EXPECT_TRUE(test_obj->HasOneRef());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test getting/setting inherited client-side handler types.
|
// Test getting/setting inherited client-side RefPtr types.
|
||||||
TEST(TranslatorTest, HandlerInherit) {
|
TEST(TranslatorTest, RefPtrClientInherit) {
|
||||||
CefRefPtr<CefTranslatorTest> obj = CefTranslatorTest::Create();
|
CefRefPtr<CefTranslatorTest> obj = CefTranslatorTest::Create();
|
||||||
|
|
||||||
const int kTestVal = 12;
|
const int kTestVal = 12;
|
||||||
const int kTestVal2 = 86;
|
const int kTestVal2 = 86;
|
||||||
|
|
||||||
CefRefPtr<TranslatorTestHandlerChild> test_obj =
|
CefRefPtr<TranslatorTestRefPtrClientChild> test_obj =
|
||||||
new TranslatorTestHandlerChild(kTestVal, kTestVal2);
|
new TranslatorTestRefPtrClientChild(kTestVal, kTestVal2);
|
||||||
EXPECT_EQ(kTestVal, test_obj->GetValue());
|
EXPECT_EQ(kTestVal, test_obj->GetValue());
|
||||||
EXPECT_EQ(kTestVal2, test_obj->GetOtherValue());
|
EXPECT_EQ(kTestVal2, test_obj->GetOtherValue());
|
||||||
int retval = obj->SetHandler(test_obj);
|
int retval = obj->SetRefPtrClient(test_obj);
|
||||||
EXPECT_EQ(kTestVal, retval);
|
EXPECT_EQ(kTestVal, retval);
|
||||||
EXPECT_EQ(kTestVal, test_obj->GetValue());
|
EXPECT_EQ(kTestVal, test_obj->GetValue());
|
||||||
EXPECT_EQ(kTestVal2, test_obj->GetOtherValue());
|
EXPECT_EQ(kTestVal2, test_obj->GetOtherValue());
|
||||||
|
|
||||||
EXPECT_EQ(kTestVal, obj->SetChildHandler(test_obj));
|
EXPECT_EQ(kTestVal, obj->SetChildRefPtrClient(test_obj));
|
||||||
CefRefPtr<CefTranslatorTestHandler> handler =
|
CefRefPtr<CefTranslatorTestRefPtrClient> handler =
|
||||||
obj->SetChildHandlerAndReturnParent(test_obj);
|
obj->SetChildRefPtrClientAndReturnParent(test_obj);
|
||||||
EXPECT_EQ(kTestVal, handler->GetValue());
|
EXPECT_EQ(kTestVal, handler->GetValue());
|
||||||
EXPECT_EQ(test_obj.get(), handler.get());
|
EXPECT_EQ(test_obj.get(), handler.get());
|
||||||
handler = NULL;
|
handler = NULL;
|
||||||
@ -358,24 +363,25 @@ TEST(TranslatorTest, HandlerInherit) {
|
|||||||
EXPECT_TRUE(test_obj->HasOneRef());
|
EXPECT_TRUE(test_obj->HasOneRef());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test getting/setting client-side object list types.
|
// Test getting/setting client-side RefPtr list types.
|
||||||
TEST(TranslatorTest, HandlerList) {
|
TEST(TranslatorTest, RefPtrClientList) {
|
||||||
CefRefPtr<CefTranslatorTest> obj = CefTranslatorTest::Create();
|
CefRefPtr<CefTranslatorTest> obj = CefTranslatorTest::Create();
|
||||||
|
|
||||||
const int kVal1 = 34;
|
const int kVal1 = 34;
|
||||||
const int kVal2 = 10;
|
const int kVal2 = 10;
|
||||||
|
|
||||||
CefRefPtr<CefTranslatorTestHandler> val1 = new TranslatorTestHandler(kVal1);
|
CefRefPtr<CefTranslatorTestRefPtrClient> val1 =
|
||||||
CefRefPtr<CefTranslatorTestHandler> val2 =
|
new TranslatorTestRefPtrClient(kVal1);
|
||||||
new TranslatorTestHandlerChild(kVal2, 0);
|
CefRefPtr<CefTranslatorTestRefPtrClient> val2 =
|
||||||
|
new TranslatorTestRefPtrClientChild(kVal2, 0);
|
||||||
|
|
||||||
std::vector<CefRefPtr<CefTranslatorTestHandler> > list;
|
std::vector<CefRefPtr<CefTranslatorTestRefPtrClient> > list;
|
||||||
list.push_back(val1);
|
list.push_back(val1);
|
||||||
list.push_back(val2);
|
list.push_back(val2);
|
||||||
EXPECT_TRUE(obj->SetHandlerList(list, kVal1, kVal2));
|
EXPECT_TRUE(obj->SetRefPtrClientList(list, kVal1, kVal2));
|
||||||
|
|
||||||
list.clear();
|
list.clear();
|
||||||
EXPECT_TRUE(obj->GetHandlerListByRef(list, val1, val2));
|
EXPECT_TRUE(obj->GetRefPtrClientListByRef(list, val1, val2));
|
||||||
EXPECT_EQ(2U, list.size());
|
EXPECT_EQ(2U, list.size());
|
||||||
EXPECT_EQ(kVal1, list[0]->GetValue());
|
EXPECT_EQ(kVal1, list[0]->GetValue());
|
||||||
EXPECT_EQ(val1.get(), list[0].get());
|
EXPECT_EQ(val1.get(), list[0].get());
|
||||||
@ -389,3 +395,374 @@ TEST(TranslatorTest, HandlerList) {
|
|||||||
EXPECT_TRUE(val1->HasOneRef());
|
EXPECT_TRUE(val1->HasOneRef());
|
||||||
EXPECT_TRUE(val2->HasOneRef());
|
EXPECT_TRUE(val2->HasOneRef());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Test getting/setting library-side OwnPtr types.
|
||||||
|
TEST(TranslatorTest, OwnPtrLibrary) {
|
||||||
|
CefRefPtr<CefTranslatorTest> obj = CefTranslatorTest::Create();
|
||||||
|
|
||||||
|
const int kTestVal = 12;
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibrary> test_obj =
|
||||||
|
CefTranslatorTestScopedLibrary::Create(kTestVal);
|
||||||
|
EXPECT_TRUE(test_obj.get());
|
||||||
|
EXPECT_EQ(kTestVal, test_obj->GetValue());
|
||||||
|
int retval = obj->SetOwnPtrLibrary(test_obj.Pass());
|
||||||
|
EXPECT_EQ(kTestVal, retval);
|
||||||
|
EXPECT_FALSE(test_obj.get());
|
||||||
|
|
||||||
|
const int kTestVal2 = 30;
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibrary> test_obj2 =
|
||||||
|
obj->GetOwnPtrLibrary(kTestVal2);
|
||||||
|
EXPECT_TRUE(test_obj2.get());
|
||||||
|
EXPECT_EQ(kTestVal2, test_obj2->GetValue());
|
||||||
|
int retval2 = obj->SetOwnPtrLibrary(test_obj2.Pass());
|
||||||
|
EXPECT_EQ(kTestVal2, retval2);
|
||||||
|
EXPECT_FALSE(test_obj2.get());
|
||||||
|
|
||||||
|
// Only one reference to the object should exist.
|
||||||
|
EXPECT_TRUE(obj->HasOneRef());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test getting/setting inherited library-side OwnPtr types.
|
||||||
|
TEST(TranslatorTest, OwnPtrLibraryInherit) {
|
||||||
|
CefRefPtr<CefTranslatorTest> obj = CefTranslatorTest::Create();
|
||||||
|
|
||||||
|
const int kTestVal = 12;
|
||||||
|
const int kTestVal2 = 40;
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibraryChild> test_obj =
|
||||||
|
CefTranslatorTestScopedLibraryChild::Create(kTestVal, kTestVal2);
|
||||||
|
EXPECT_TRUE(test_obj.get());
|
||||||
|
EXPECT_EQ(kTestVal, test_obj->GetValue());
|
||||||
|
EXPECT_EQ(kTestVal2, test_obj->GetOtherValue());
|
||||||
|
int retval = obj->SetOwnPtrLibrary(
|
||||||
|
test_obj.PassAs<CefTranslatorTestScopedLibrary>());
|
||||||
|
EXPECT_EQ(kTestVal, retval);
|
||||||
|
EXPECT_FALSE(test_obj.get());
|
||||||
|
|
||||||
|
test_obj = CefTranslatorTestScopedLibraryChild::Create(kTestVal, kTestVal2);
|
||||||
|
EXPECT_TRUE(test_obj.get());
|
||||||
|
EXPECT_EQ(kTestVal, obj->SetChildOwnPtrLibrary(test_obj.Pass()));
|
||||||
|
EXPECT_FALSE(test_obj.get());
|
||||||
|
|
||||||
|
test_obj = CefTranslatorTestScopedLibraryChild::Create(kTestVal, kTestVal2);
|
||||||
|
EXPECT_TRUE(test_obj.get());
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibrary> test_obj_parent =
|
||||||
|
obj->SetChildOwnPtrLibraryAndReturnParent(test_obj.Pass());
|
||||||
|
EXPECT_FALSE(test_obj.get());
|
||||||
|
EXPECT_TRUE(test_obj_parent.get());
|
||||||
|
EXPECT_EQ(kTestVal, test_obj_parent->GetValue());
|
||||||
|
test_obj_parent.reset(NULL);
|
||||||
|
|
||||||
|
const int kTestVal3 = 100;
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibraryChildChild> test_obj2 =
|
||||||
|
CefTranslatorTestScopedLibraryChildChild::Create(kTestVal, kTestVal2,
|
||||||
|
kTestVal3);
|
||||||
|
EXPECT_EQ(kTestVal, test_obj2->GetValue());
|
||||||
|
EXPECT_EQ(kTestVal2, test_obj2->GetOtherValue());
|
||||||
|
EXPECT_EQ(kTestVal3, test_obj2->GetOtherOtherValue());
|
||||||
|
int retval2 = obj->SetOwnPtrLibrary(
|
||||||
|
test_obj2.PassAs<CefTranslatorTestScopedLibrary>());
|
||||||
|
EXPECT_EQ(kTestVal, retval2);
|
||||||
|
EXPECT_FALSE(test_obj2.get());
|
||||||
|
|
||||||
|
test_obj2 = CefTranslatorTestScopedLibraryChildChild::Create(
|
||||||
|
kTestVal, kTestVal2, kTestVal3);
|
||||||
|
EXPECT_EQ(kTestVal, obj->SetChildOwnPtrLibrary(
|
||||||
|
test_obj2.PassAs<CefTranslatorTestScopedLibraryChild>()));
|
||||||
|
EXPECT_FALSE(test_obj2.get());
|
||||||
|
|
||||||
|
test_obj2 = CefTranslatorTestScopedLibraryChildChild::Create(
|
||||||
|
kTestVal, kTestVal2, kTestVal3);
|
||||||
|
test_obj_parent = obj->SetChildOwnPtrLibraryAndReturnParent(
|
||||||
|
test_obj2.PassAs<CefTranslatorTestScopedLibraryChild>());
|
||||||
|
EXPECT_FALSE(test_obj2.get());
|
||||||
|
EXPECT_TRUE(test_obj_parent.get());
|
||||||
|
EXPECT_EQ(kTestVal, test_obj_parent->GetValue());
|
||||||
|
test_obj_parent.reset(NULL);
|
||||||
|
|
||||||
|
// Only one reference to the object should exist.
|
||||||
|
EXPECT_TRUE(obj->HasOneRef());
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
class TranslatorTestScopedClient : public CefTranslatorTestScopedClient {
|
||||||
|
public:
|
||||||
|
TranslatorTestScopedClient(const int val,
|
||||||
|
TrackCallback* got_delete)
|
||||||
|
: val_(val),
|
||||||
|
got_delete_(got_delete) {
|
||||||
|
}
|
||||||
|
~TranslatorTestScopedClient() override {
|
||||||
|
got_delete_->yes();
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual int GetValue() override {
|
||||||
|
return val_;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
const int val_;
|
||||||
|
TrackCallback* got_delete_;
|
||||||
|
|
||||||
|
DISALLOW_COPY_AND_ASSIGN(TranslatorTestScopedClient);
|
||||||
|
};
|
||||||
|
|
||||||
|
class TranslatorTestScopedClientChild :
|
||||||
|
public CefTranslatorTestScopedClientChild {
|
||||||
|
public:
|
||||||
|
TranslatorTestScopedClientChild(const int val,
|
||||||
|
const int other_val,
|
||||||
|
TrackCallback* got_delete)
|
||||||
|
: val_(val),
|
||||||
|
other_val_(other_val),
|
||||||
|
got_delete_(got_delete) {
|
||||||
|
}
|
||||||
|
~TranslatorTestScopedClientChild() override {
|
||||||
|
got_delete_->yes();
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual int GetValue() override {
|
||||||
|
return val_;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual int GetOtherValue() override {
|
||||||
|
return other_val_;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
const int val_;
|
||||||
|
const int other_val_;
|
||||||
|
TrackCallback* got_delete_;
|
||||||
|
|
||||||
|
DISALLOW_COPY_AND_ASSIGN(TranslatorTestScopedClientChild);
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
// Test getting/setting client-side OwnPtr types.
|
||||||
|
TEST(TranslatorTest, OwnPtrClient) {
|
||||||
|
CefRefPtr<CefTranslatorTest> obj = CefTranslatorTest::Create();
|
||||||
|
|
||||||
|
const int kTestVal = 12;
|
||||||
|
TrackCallback got_delete;
|
||||||
|
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClient> test_obj(
|
||||||
|
new TranslatorTestScopedClient(kTestVal, &got_delete));
|
||||||
|
EXPECT_EQ(kTestVal, test_obj->GetValue());
|
||||||
|
EXPECT_EQ(kTestVal, obj->SetOwnPtrClient(test_obj.Pass()));
|
||||||
|
EXPECT_FALSE(test_obj.get());
|
||||||
|
EXPECT_TRUE(got_delete);
|
||||||
|
|
||||||
|
got_delete.reset();
|
||||||
|
test_obj.reset(new TranslatorTestScopedClient(kTestVal, &got_delete));
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClient> handler =
|
||||||
|
obj->SetOwnPtrClientAndReturn(test_obj.Pass());
|
||||||
|
EXPECT_FALSE(test_obj.get());
|
||||||
|
EXPECT_TRUE(handler.get());
|
||||||
|
EXPECT_FALSE(got_delete);
|
||||||
|
EXPECT_EQ(kTestVal, handler->GetValue());
|
||||||
|
handler.reset(NULL);
|
||||||
|
EXPECT_TRUE(got_delete);
|
||||||
|
|
||||||
|
// Only one reference to the object should exist.
|
||||||
|
EXPECT_TRUE(obj->HasOneRef());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test getting/setting inherited client-side OwnPtr types.
|
||||||
|
TEST(TranslatorTest, OwnPtrClientInherit) {
|
||||||
|
CefRefPtr<CefTranslatorTest> obj = CefTranslatorTest::Create();
|
||||||
|
|
||||||
|
const int kTestVal = 12;
|
||||||
|
const int kTestVal2 = 86;
|
||||||
|
TrackCallback got_delete;
|
||||||
|
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClientChild> test_obj(
|
||||||
|
new TranslatorTestScopedClientChild(kTestVal, kTestVal2, &got_delete));
|
||||||
|
EXPECT_EQ(kTestVal, test_obj->GetValue());
|
||||||
|
EXPECT_EQ(kTestVal2, test_obj->GetOtherValue());
|
||||||
|
EXPECT_EQ(kTestVal, obj->SetOwnPtrClient(
|
||||||
|
test_obj.PassAs<CefTranslatorTestScopedClient>()));
|
||||||
|
EXPECT_FALSE(test_obj.get());
|
||||||
|
EXPECT_TRUE(got_delete);
|
||||||
|
|
||||||
|
got_delete.reset();
|
||||||
|
test_obj.reset(
|
||||||
|
new TranslatorTestScopedClientChild(kTestVal, kTestVal2, &got_delete));
|
||||||
|
EXPECT_EQ(kTestVal, obj->SetChildOwnPtrClient(test_obj.Pass()));
|
||||||
|
EXPECT_FALSE(test_obj.get());
|
||||||
|
EXPECT_TRUE(got_delete);
|
||||||
|
|
||||||
|
got_delete.reset();
|
||||||
|
test_obj.reset(
|
||||||
|
new TranslatorTestScopedClientChild(kTestVal, kTestVal2, &got_delete));
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClient> handler(
|
||||||
|
obj->SetChildOwnPtrClientAndReturnParent(test_obj.Pass()));
|
||||||
|
EXPECT_EQ(kTestVal, handler->GetValue());
|
||||||
|
EXPECT_FALSE(test_obj.get());
|
||||||
|
EXPECT_FALSE(got_delete);
|
||||||
|
handler.reset(NULL);
|
||||||
|
EXPECT_TRUE(got_delete);
|
||||||
|
|
||||||
|
// Only one reference to the object should exist.
|
||||||
|
EXPECT_TRUE(obj->HasOneRef());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test getting/setting library-side RawPtr types.
|
||||||
|
TEST(TranslatorTest, RawPtrLibrary) {
|
||||||
|
CefRefPtr<CefTranslatorTest> obj = CefTranslatorTest::Create();
|
||||||
|
|
||||||
|
const int kTestVal = 12;
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibrary> test_obj(
|
||||||
|
CefTranslatorTestScopedLibrary::Create(kTestVal));
|
||||||
|
EXPECT_EQ(kTestVal, test_obj->GetValue());
|
||||||
|
int retval = obj->SetRawPtrLibrary(test_obj.get());
|
||||||
|
EXPECT_EQ(kTestVal, retval);
|
||||||
|
EXPECT_EQ(kTestVal, test_obj->GetValue());
|
||||||
|
|
||||||
|
const int kTestVal2 = 30;
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibrary> test_obj2(
|
||||||
|
obj->GetOwnPtrLibrary(kTestVal2));
|
||||||
|
EXPECT_EQ(kTestVal2, test_obj2->GetValue());
|
||||||
|
int retval2 = obj->SetRawPtrLibrary(test_obj2.get());
|
||||||
|
EXPECT_EQ(kTestVal2, retval2);
|
||||||
|
EXPECT_EQ(kTestVal2, test_obj2->GetValue());
|
||||||
|
|
||||||
|
// Only one reference to the object should exist.
|
||||||
|
EXPECT_TRUE(obj->HasOneRef());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test getting/setting inherited library-side RawPtr types.
|
||||||
|
TEST(TranslatorTest, RawPtrLibraryInherit) {
|
||||||
|
CefRefPtr<CefTranslatorTest> obj = CefTranslatorTest::Create();
|
||||||
|
|
||||||
|
const int kTestVal = 12;
|
||||||
|
const int kTestVal2 = 40;
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibraryChild> test_obj(
|
||||||
|
CefTranslatorTestScopedLibraryChild::Create(kTestVal, kTestVal2));
|
||||||
|
EXPECT_EQ(kTestVal, test_obj->GetValue());
|
||||||
|
EXPECT_EQ(kTestVal2, test_obj->GetOtherValue());
|
||||||
|
int retval = obj->SetRawPtrLibrary(test_obj.get());
|
||||||
|
EXPECT_EQ(kTestVal, retval);
|
||||||
|
EXPECT_EQ(kTestVal, test_obj->GetValue());
|
||||||
|
EXPECT_EQ(kTestVal2, test_obj->GetOtherValue());
|
||||||
|
|
||||||
|
EXPECT_EQ(kTestVal, obj->SetChildRawPtrLibrary(test_obj.get()));
|
||||||
|
|
||||||
|
const int kTestVal3 = 100;
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibraryChildChild> test_obj2(
|
||||||
|
CefTranslatorTestScopedLibraryChildChild::Create(kTestVal, kTestVal2,
|
||||||
|
kTestVal3));
|
||||||
|
EXPECT_EQ(kTestVal, test_obj2->GetValue());
|
||||||
|
EXPECT_EQ(kTestVal2, test_obj2->GetOtherValue());
|
||||||
|
EXPECT_EQ(kTestVal3, test_obj2->GetOtherOtherValue());
|
||||||
|
int retval2 = obj->SetRawPtrLibrary(test_obj2.get());
|
||||||
|
EXPECT_EQ(kTestVal, retval2);
|
||||||
|
EXPECT_EQ(kTestVal, test_obj2->GetValue());
|
||||||
|
EXPECT_EQ(kTestVal2, test_obj2->GetOtherValue());
|
||||||
|
EXPECT_EQ(kTestVal3, test_obj2->GetOtherOtherValue());
|
||||||
|
|
||||||
|
EXPECT_EQ(kTestVal, obj->SetChildRawPtrLibrary(test_obj2.get()));
|
||||||
|
|
||||||
|
// Only one reference to the object should exist.
|
||||||
|
EXPECT_TRUE(obj->HasOneRef());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test getting/setting library-side RawPtr list types.
|
||||||
|
TEST(TranslatorTest, RawPtrLibraryList) {
|
||||||
|
CefRefPtr<CefTranslatorTest> obj = CefTranslatorTest::Create();
|
||||||
|
|
||||||
|
const int kVal1 = 34;
|
||||||
|
const int kVal2 = 10;
|
||||||
|
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibrary> val1(
|
||||||
|
CefTranslatorTestScopedLibrary::Create(kVal1));
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedLibraryChild> val2(
|
||||||
|
CefTranslatorTestScopedLibraryChild::Create(kVal2, 0));
|
||||||
|
|
||||||
|
std::vector<CefRawPtr<CefTranslatorTestScopedLibrary> > list;
|
||||||
|
list.push_back(val1.get());
|
||||||
|
list.push_back(val2.get());
|
||||||
|
EXPECT_TRUE(obj->SetRawPtrLibraryList(list, kVal1, kVal2));
|
||||||
|
list.clear();
|
||||||
|
|
||||||
|
// Only one reference to the object should exist.
|
||||||
|
EXPECT_TRUE(obj->HasOneRef());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test getting/setting client-side RawPtr types.
|
||||||
|
TEST(TranslatorTest, RawPtrClient) {
|
||||||
|
CefRefPtr<CefTranslatorTest> obj = CefTranslatorTest::Create();
|
||||||
|
|
||||||
|
const int kTestVal = 12;
|
||||||
|
TrackCallback got_delete;
|
||||||
|
|
||||||
|
CefOwnPtr<TranslatorTestScopedClient> test_obj(
|
||||||
|
new TranslatorTestScopedClient(kTestVal, &got_delete));
|
||||||
|
EXPECT_EQ(kTestVal, test_obj->GetValue());
|
||||||
|
EXPECT_EQ(kTestVal, obj->SetRawPtrClient(test_obj.get()));
|
||||||
|
EXPECT_FALSE(got_delete);
|
||||||
|
test_obj.reset(NULL);
|
||||||
|
EXPECT_TRUE(got_delete);
|
||||||
|
|
||||||
|
// Only one reference to the object should exist.
|
||||||
|
EXPECT_TRUE(obj->HasOneRef());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test getting/setting inherited client-side RawPtr types.
|
||||||
|
TEST(TranslatorTest, RawPtrClientInherit) {
|
||||||
|
CefRefPtr<CefTranslatorTest> obj = CefTranslatorTest::Create();
|
||||||
|
|
||||||
|
const int kTestVal = 12;
|
||||||
|
const int kTestVal2 = 86;
|
||||||
|
TrackCallback got_delete;
|
||||||
|
|
||||||
|
CefOwnPtr<TranslatorTestScopedClientChild> test_obj(
|
||||||
|
new TranslatorTestScopedClientChild(kTestVal, kTestVal2, &got_delete));
|
||||||
|
EXPECT_EQ(kTestVal, test_obj->GetValue());
|
||||||
|
EXPECT_EQ(kTestVal2, test_obj->GetOtherValue());
|
||||||
|
int retval = obj->SetRawPtrClient(test_obj.get());
|
||||||
|
EXPECT_EQ(kTestVal, retval);
|
||||||
|
EXPECT_EQ(kTestVal, test_obj->GetValue());
|
||||||
|
EXPECT_EQ(kTestVal2, test_obj->GetOtherValue());
|
||||||
|
EXPECT_FALSE(got_delete);
|
||||||
|
|
||||||
|
EXPECT_EQ(kTestVal, obj->SetChildRawPtrClient(test_obj.get()));
|
||||||
|
EXPECT_FALSE(got_delete);
|
||||||
|
test_obj.reset(NULL);
|
||||||
|
EXPECT_TRUE(got_delete);
|
||||||
|
|
||||||
|
// Only one reference to the object should exist.
|
||||||
|
EXPECT_TRUE(obj->HasOneRef());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test getting/setting client-side RawPtr list types.
|
||||||
|
TEST(TranslatorTest, RawPtrClientList) {
|
||||||
|
CefRefPtr<CefTranslatorTest> obj = CefTranslatorTest::Create();
|
||||||
|
|
||||||
|
const int kVal1 = 34;
|
||||||
|
const int kVal2 = 10;
|
||||||
|
TrackCallback got_delete1, got_delete2;
|
||||||
|
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClient> val1(
|
||||||
|
new TranslatorTestScopedClient(kVal1, &got_delete1));
|
||||||
|
CefOwnPtr<CefTranslatorTestScopedClient> val2(
|
||||||
|
new TranslatorTestScopedClientChild(kVal2, 0, &got_delete2));
|
||||||
|
|
||||||
|
std::vector<CefRawPtr<CefTranslatorTestScopedClient> > list;
|
||||||
|
list.push_back(val1.get());
|
||||||
|
list.push_back(val2.get());
|
||||||
|
EXPECT_TRUE(obj->SetRawPtrClientList(list, kVal1, kVal2));
|
||||||
|
list.clear();
|
||||||
|
|
||||||
|
EXPECT_FALSE(got_delete1);
|
||||||
|
val1.reset(NULL);
|
||||||
|
EXPECT_TRUE(got_delete1);
|
||||||
|
|
||||||
|
EXPECT_FALSE(got_delete2);
|
||||||
|
val2.reset(NULL);
|
||||||
|
EXPECT_TRUE(got_delete2);
|
||||||
|
|
||||||
|
// Only one reference to the object should exist.
|
||||||
|
EXPECT_TRUE(obj->HasOneRef());
|
||||||
|
}
|
||||||
|
@ -1422,7 +1422,7 @@ void CreateURLRequestRendererTests(ClientAppRenderer::DelegateSet& delegates) {
|
|||||||
// Entry point for registering custom schemes.
|
// Entry point for registering custom schemes.
|
||||||
// Called from client_app_delegates.cc.
|
// Called from client_app_delegates.cc.
|
||||||
void RegisterURLRequestCustomSchemes(
|
void RegisterURLRequestCustomSchemes(
|
||||||
CefRefPtr<CefSchemeRegistrar> registrar,
|
CefRawPtr<CefSchemeRegistrar> registrar,
|
||||||
std::vector<CefString>& cookiable_schemes) {
|
std::vector<CefString>& cookiable_schemes) {
|
||||||
registrar->AddCustomScheme(kRequestScheme, true, false, false, false, true);
|
registrar->AddCustomScheme(kRequestScheme, true, false, false, false, true);
|
||||||
cookiable_schemes.push_back(kRequestScheme);
|
cookiable_schemes.push_back(kRequestScheme);
|
||||||
|
@ -42,7 +42,7 @@ ClientApp::ProcessType ClientApp::GetProcessType(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ClientApp::OnRegisterCustomSchemes(
|
void ClientApp::OnRegisterCustomSchemes(
|
||||||
CefRefPtr<CefSchemeRegistrar> registrar) {
|
CefRawPtr<CefSchemeRegistrar> registrar) {
|
||||||
RegisterCustomSchemes(registrar, cookieable_schemes_);
|
RegisterCustomSchemes(registrar, cookieable_schemes_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,12 +34,12 @@ class ClientApp : public CefApp {
|
|||||||
private:
|
private:
|
||||||
// Registers custom schemes. Implemented by cefclient in
|
// Registers custom schemes. Implemented by cefclient in
|
||||||
// client_app_delegates_common.cc
|
// client_app_delegates_common.cc
|
||||||
static void RegisterCustomSchemes(CefRefPtr<CefSchemeRegistrar> registrar,
|
static void RegisterCustomSchemes(CefRawPtr<CefSchemeRegistrar> registrar,
|
||||||
std::vector<CefString>& cookiable_schemes);
|
std::vector<CefString>& cookiable_schemes);
|
||||||
|
|
||||||
// CefApp methods.
|
// CefApp methods.
|
||||||
void OnRegisterCustomSchemes(
|
void OnRegisterCustomSchemes(
|
||||||
CefRefPtr<CefSchemeRegistrar> registrar) OVERRIDE;
|
CefRawPtr<CefSchemeRegistrar> registrar) OVERRIDE;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ClientApp);
|
DISALLOW_COPY_AND_ASSIGN(ClientApp);
|
||||||
};
|
};
|
||||||
|
@ -94,6 +94,12 @@ def wrap_code(code, indent = ' ', maxchars = 80, splitchars = '(=,'):
|
|||||||
|
|
||||||
return output
|
return output
|
||||||
|
|
||||||
|
def is_base_class(clsname):
|
||||||
|
""" Returns true if |clsname| is a known base (root) class in the object
|
||||||
|
hierarchy.
|
||||||
|
"""
|
||||||
|
return clsname == 'CefBase' or clsname == 'CefBaseScoped'
|
||||||
|
|
||||||
def get_capi_file_name(cppname):
|
def get_capi_file_name(cppname):
|
||||||
""" Convert a C++ header file name to a C API header file name. """
|
""" Convert a C++ header file name to a C API header file name. """
|
||||||
return cppname[:-2]+'_capi.h'
|
return cppname[:-2]+'_capi.h'
|
||||||
@ -302,7 +308,7 @@ def format_translation_includes(header, body):
|
|||||||
list = sorted(set(p.findall(body)))
|
list = sorted(set(p.findall(body)))
|
||||||
for item in list:
|
for item in list:
|
||||||
directory = ''
|
directory = ''
|
||||||
if item != 'CefBase':
|
if not is_base_class(item):
|
||||||
cls = header.get_class(item)
|
cls = header.get_class(item)
|
||||||
dir = cls.get_file_directory()
|
dir = cls.get_file_directory()
|
||||||
if not dir is None:
|
if not dir is None:
|
||||||
@ -315,7 +321,7 @@ def format_translation_includes(header, body):
|
|||||||
list = sorted(set(p.findall(body)))
|
list = sorted(set(p.findall(body)))
|
||||||
for item in list:
|
for item in list:
|
||||||
directory = ''
|
directory = ''
|
||||||
if item != 'CefBase':
|
if not is_base_class(item):
|
||||||
cls = header.get_class(item)
|
cls = header.get_class(item)
|
||||||
dir = cls.get_file_directory()
|
dir = cls.get_file_directory()
|
||||||
if not dir is None:
|
if not dir is None:
|
||||||
@ -383,9 +389,9 @@ _cre_cfnameorpath = '([A-Za-z0-9_\/]{1,})'
|
|||||||
# regex for matching function return values
|
# regex for matching function return values
|
||||||
_cre_retval = '([A-Za-z0-9_<>:,\*\&]{1,})'
|
_cre_retval = '([A-Za-z0-9_<>:,\*\&]{1,})'
|
||||||
# regex for matching typedef value and name combination
|
# regex for matching typedef value and name combination
|
||||||
_cre_typedef = '([A-Za-z0-9_<>:,\*\& ]{1,})'
|
_cre_typedef = '([A-Za-z0-9_<>:,\*\&\s]{1,})'
|
||||||
# regex for matching function return value and name combination
|
# regex for matching function return value and name combination
|
||||||
_cre_func = '([A-Za-z][A-Za-z0-9_<>:,\*\& ]{1,})'
|
_cre_func = '([A-Za-z][A-Za-z0-9_<>:,\*\&\s]{1,})'
|
||||||
# regex for matching virtual function modifiers
|
# regex for matching virtual function modifiers
|
||||||
_cre_vfmod = '([A-Za-z0-9_]{0,})'
|
_cre_vfmod = '([A-Za-z0-9_]{0,})'
|
||||||
# regex for matching arbitrary whitespace
|
# regex for matching arbitrary whitespace
|
||||||
@ -554,8 +560,8 @@ class obj_header:
|
|||||||
pos = value.rfind(' ')
|
pos = value.rfind(' ')
|
||||||
if pos < 0:
|
if pos < 0:
|
||||||
raise Exception('Invalid typedef: '+value)
|
raise Exception('Invalid typedef: '+value)
|
||||||
alias = value[pos+1:]
|
alias = value[pos+1:].strip()
|
||||||
value = value[:pos]
|
value = value[:pos].strip()
|
||||||
self.typedefs.append(obj_typedef(self, filename, value, alias))
|
self.typedefs.append(obj_typedef(self, filename, value, alias))
|
||||||
|
|
||||||
# extract global functions
|
# extract global functions
|
||||||
@ -592,7 +598,7 @@ class obj_header:
|
|||||||
|
|
||||||
# build the class objects
|
# build the class objects
|
||||||
for attrib, name, parent_name, body in list:
|
for attrib, name, parent_name, body in list:
|
||||||
comment = get_comment(data, name+' : public')
|
comment = get_comment(data, name+' :')
|
||||||
validate_comment(filename, name, comment)
|
validate_comment(filename, name, comment)
|
||||||
self.classes.append(
|
self.classes.append(
|
||||||
obj_class(self, filename, attrib, name, parent_name, body,
|
obj_class(self, filename, attrib, name, parent_name, body,
|
||||||
@ -673,6 +679,20 @@ class obj_header:
|
|||||||
result.append(cls.get_name())
|
result.append(cls.get_name())
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
def get_base_class_name(self, classname):
|
||||||
|
""" Returns the base (root) class name for |classname|. """
|
||||||
|
cur_cls = self.get_class(classname)
|
||||||
|
while True:
|
||||||
|
parent_name = cur_cls.get_parent_name()
|
||||||
|
if is_base_class(parent_name):
|
||||||
|
return parent_name
|
||||||
|
else:
|
||||||
|
parent_cls = self.get_class(parent_name)
|
||||||
|
if parent_cls is None:
|
||||||
|
break
|
||||||
|
cur_cls = self.get_class(parent_name)
|
||||||
|
return None
|
||||||
|
|
||||||
def get_types(self, list):
|
def get_types(self, list):
|
||||||
""" Return a dictionary mapping data types to analyzed values. """
|
""" Return a dictionary mapping data types to analyzed values. """
|
||||||
for cls in self.typedefs:
|
for cls in self.typedefs:
|
||||||
@ -695,7 +715,7 @@ class obj_header:
|
|||||||
|
|
||||||
def get_defined_structs(self):
|
def get_defined_structs(self):
|
||||||
""" Return a list of already defined structure names. """
|
""" Return a list of already defined structure names. """
|
||||||
return ['cef_print_info_t', 'cef_window_info_t', 'cef_base_t']
|
return ['cef_print_info_t', 'cef_window_info_t', 'cef_base_t', 'cef_base_scoped_t']
|
||||||
|
|
||||||
def get_capi_translations(self):
|
def get_capi_translations(self):
|
||||||
""" Return a dictionary that maps C++ terminology to C API terminology.
|
""" Return a dictionary that maps C++ terminology to C API terminology.
|
||||||
@ -760,8 +780,8 @@ class obj_class:
|
|||||||
pos = value.rfind(' ')
|
pos = value.rfind(' ')
|
||||||
if pos < 0:
|
if pos < 0:
|
||||||
raise Exception('Invalid typedef: '+value)
|
raise Exception('Invalid typedef: '+value)
|
||||||
alias = value[pos+1:]
|
alias = value[pos+1:].strip()
|
||||||
value = value[:pos]
|
value = value[:pos].strip()
|
||||||
self.typedefs.append(obj_typedef(self, filename, value, alias))
|
self.typedefs.append(obj_typedef(self, filename, value, alias))
|
||||||
|
|
||||||
# extract static functions
|
# extract static functions
|
||||||
@ -856,16 +876,16 @@ class obj_class:
|
|||||||
def has_parent(self, parent_name):
|
def has_parent(self, parent_name):
|
||||||
""" Returns true if this class has the specified class anywhere in its
|
""" Returns true if this class has the specified class anywhere in its
|
||||||
inheritance hierarchy. """
|
inheritance hierarchy. """
|
||||||
# Every class has CefBase as the top-most parent.
|
# Every class has a known base class as the top-most parent.
|
||||||
if parent_name == 'CefBase' or parent_name == self.parent_name:
|
if is_base_class(parent_name) or parent_name == self.parent_name:
|
||||||
return True
|
return True
|
||||||
if self.parent_name == 'CefBase':
|
if is_base_class(self.parent_name):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
cur_cls = self.parent.get_class(self.parent_name)
|
cur_cls = self.parent.get_class(self.parent_name)
|
||||||
while True:
|
while True:
|
||||||
cur_parent_name = cur_cls.get_parent_name()
|
cur_parent_name = cur_cls.get_parent_name()
|
||||||
if cur_parent_name == 'CefBase':
|
if is_base_class(cur_parent_name):
|
||||||
break
|
break
|
||||||
elif cur_parent_name == parent_name:
|
elif cur_parent_name == parent_name:
|
||||||
return True
|
return True
|
||||||
@ -1214,7 +1234,7 @@ class obj_function:
|
|||||||
this_is_library_side = True
|
this_is_library_side = True
|
||||||
header = self.parent
|
header = self.parent
|
||||||
|
|
||||||
if other_class_name == 'CefBase':
|
if is_base_class(other_class_name):
|
||||||
other_is_library_side = False
|
other_is_library_side = False
|
||||||
else:
|
else:
|
||||||
other_class = header.get_class(other_class_name)
|
other_class = header.get_class(other_class_name)
|
||||||
@ -1386,17 +1406,17 @@ class obj_argument:
|
|||||||
return 'string_byref_const'
|
return 'string_byref_const'
|
||||||
return 'string_byref'
|
return 'string_byref'
|
||||||
|
|
||||||
# refptr type
|
# *ptr type
|
||||||
if self.type.is_result_refptr():
|
if self.type.is_result_ptr():
|
||||||
same_side = self.parent.is_same_side(self.type.get_refptr_type())
|
prefix = self.type.get_result_ptr_type_prefix()
|
||||||
|
same_side = self.parent.is_same_side(self.type.get_ptr_type())
|
||||||
if self.type.is_byref():
|
if self.type.is_byref():
|
||||||
if same_side:
|
if same_side:
|
||||||
return 'refptr_same_byref'
|
return prefix + 'ptr_same_byref'
|
||||||
return 'refptr_diff_byref'
|
return prefix + 'ptr_diff_byref'
|
||||||
if same_side:
|
if same_side:
|
||||||
return 'refptr_same'
|
return prefix + 'ptr_same'
|
||||||
return 'refptr_diff'
|
return prefix + 'ptr_diff'
|
||||||
|
|
||||||
|
|
||||||
if self.type.is_result_vector():
|
if self.type.is_result_vector():
|
||||||
# all vector types must be passed by reference
|
# all vector types must be passed by reference
|
||||||
@ -1421,17 +1441,17 @@ class obj_argument:
|
|||||||
return 'bool_vec_byref_const'
|
return 'bool_vec_byref_const'
|
||||||
return 'bool_vec_byref'
|
return 'bool_vec_byref'
|
||||||
|
|
||||||
if self.type.is_result_vector_refptr():
|
if self.type.is_result_vector_ptr():
|
||||||
# refptr vector types
|
# *ptr vector types
|
||||||
same_side = self.parent.is_same_side(self.type.get_refptr_type())
|
prefix = self.type.get_result_vector_ptr_type_prefix()
|
||||||
|
same_side = self.parent.is_same_side(self.type.get_ptr_type())
|
||||||
if self.type.is_const():
|
if self.type.is_const():
|
||||||
if same_side:
|
if same_side:
|
||||||
return 'refptr_vec_same_byref_const'
|
return prefix + 'ptr_vec_same_byref_const'
|
||||||
return 'refptr_vec_diff_byref_const'
|
return prefix + 'ptr_vec_diff_byref_const'
|
||||||
if same_side:
|
if same_side:
|
||||||
return 'refptr_vec_same_byref'
|
return prefix + 'ptr_vec_same_byref'
|
||||||
return 'refptr_vec_diff_byref'
|
return prefix + 'ptr_vec_diff_byref'
|
||||||
|
|
||||||
|
|
||||||
# string single map type
|
# string single map type
|
||||||
if self.type.is_result_map_single():
|
if self.type.is_result_map_single():
|
||||||
@ -1476,11 +1496,12 @@ class obj_argument:
|
|||||||
if self.type.is_result_string():
|
if self.type.is_result_string():
|
||||||
return 'string'
|
return 'string'
|
||||||
|
|
||||||
if self.type.is_result_refptr():
|
if self.type.is_result_ptr():
|
||||||
if self.parent.is_same_side(self.type.get_refptr_type()):
|
prefix = self.type.get_result_ptr_type_prefix()
|
||||||
return 'refptr_same'
|
if self.parent.is_same_side(self.type.get_ptr_type()):
|
||||||
|
return prefix + 'ptr_same'
|
||||||
else:
|
else:
|
||||||
return 'refptr_diff'
|
return prefix + 'ptr_diff'
|
||||||
|
|
||||||
return 'invalid'
|
return 'invalid'
|
||||||
|
|
||||||
@ -1509,8 +1530,14 @@ class obj_argument:
|
|||||||
if for_capi:
|
if for_capi:
|
||||||
return 'NULL'
|
return 'NULL'
|
||||||
return 'CefString()'
|
return 'CefString()'
|
||||||
elif type == 'refptr_same' or type == 'refptr_diff':
|
elif type == 'refptr_same' or type == 'refptr_diff' or \
|
||||||
|
type == 'rawptr_same' or type == 'rawptr_diff':
|
||||||
return 'NULL'
|
return 'NULL'
|
||||||
|
elif type == 'ownptr_same' or type == 'ownptr_diff':
|
||||||
|
if for_capi:
|
||||||
|
return 'NULL'
|
||||||
|
else:
|
||||||
|
return 'CefOwnPtr<'+self.type.get_ptr_type()+'>()'
|
||||||
|
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
@ -1522,7 +1549,7 @@ class obj_analysis:
|
|||||||
self.result_type = 'unknown'
|
self.result_type = 'unknown'
|
||||||
self.result_value = None
|
self.result_value = None
|
||||||
self.result_default = None
|
self.result_default = None
|
||||||
self.refptr_type = None
|
self.ptr_type = None
|
||||||
|
|
||||||
# parse the argument string
|
# parse the argument string
|
||||||
partlist = string.split(string.strip(value))
|
partlist = string.split(string.strip(value))
|
||||||
@ -1626,8 +1653,8 @@ class obj_analysis:
|
|||||||
if not basic is None:
|
if not basic is None:
|
||||||
self.result_type = basic['result_type']
|
self.result_type = basic['result_type']
|
||||||
self.result_value = basic['result_value']
|
self.result_value = basic['result_value']
|
||||||
if 'refptr_type' in basic:
|
if 'ptr_type' in basic:
|
||||||
self.refptr_type = basic['refptr_type']
|
self.ptr_type = basic['ptr_type']
|
||||||
if 'result_default' in basic:
|
if 'result_default' in basic:
|
||||||
self.result_default = basic['result_default']
|
self.result_default = basic['result_default']
|
||||||
return True
|
return True
|
||||||
@ -1664,7 +1691,27 @@ class obj_analysis:
|
|||||||
return {
|
return {
|
||||||
'result_type' : 'refptr',
|
'result_type' : 'refptr',
|
||||||
'result_value' : get_capi_name(list[0], True)+'*',
|
'result_value' : get_capi_name(list[0], True)+'*',
|
||||||
'refptr_type' : list[0]
|
'ptr_type' : list[0]
|
||||||
|
}
|
||||||
|
|
||||||
|
# check for CEF owned pointers
|
||||||
|
p = re.compile('^CefOwnPtr<(.*?)>$', re.DOTALL)
|
||||||
|
list = p.findall(value)
|
||||||
|
if len(list) == 1:
|
||||||
|
return {
|
||||||
|
'result_type' : 'ownptr',
|
||||||
|
'result_value' : get_capi_name(list[0], True)+'*',
|
||||||
|
'ptr_type' : list[0]
|
||||||
|
}
|
||||||
|
|
||||||
|
# check for CEF raw pointers
|
||||||
|
p = re.compile('^CefRawPtr<(.*?)>$', re.DOTALL)
|
||||||
|
list = p.findall(value)
|
||||||
|
if len(list) == 1:
|
||||||
|
return {
|
||||||
|
'result_type' : 'rawptr',
|
||||||
|
'result_value' : get_capi_name(list[0], True)+'*',
|
||||||
|
'ptr_type' : list[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
# check for CEF structure types
|
# check for CEF structure types
|
||||||
@ -1695,13 +1742,13 @@ class obj_analysis:
|
|||||||
""" Return the C++ type. """
|
""" Return the C++ type. """
|
||||||
return self.type
|
return self.type
|
||||||
|
|
||||||
def get_refptr_type(self):
|
def get_ptr_type(self):
|
||||||
""" Return the C++ class type referenced by a CefRefPtr. """
|
""" Return the C++ class type referenced by a CefRefPtr. """
|
||||||
if self.is_result_vector() and self.is_result_vector_refptr():
|
if self.is_result_vector() and self.is_result_vector_ptr():
|
||||||
# return the vector RefPtr type
|
# return the vector RefPtr type
|
||||||
return self.result_value[0]['refptr_type']
|
return self.result_value[0]['ptr_type']
|
||||||
# return the basic RefPtr type
|
# return the basic RefPtr type
|
||||||
return self.refptr_type
|
return self.ptr_type
|
||||||
|
|
||||||
def get_vector_type(self):
|
def get_vector_type(self):
|
||||||
""" Return the C++ class type referenced by a std::vector. """
|
""" Return the C++ class type referenced by a std::vector. """
|
||||||
@ -1743,16 +1790,17 @@ class obj_analysis:
|
|||||||
""" Return the default value fo the basic type. """
|
""" Return the default value fo the basic type. """
|
||||||
return self.result_default
|
return self.result_default
|
||||||
|
|
||||||
def is_result_refptr(self):
|
def is_result_ptr(self):
|
||||||
""" Returns true if this is a reference pointer type. """
|
""" Returns true if this is a *Ptr type. """
|
||||||
return (self.result_type == 'refptr')
|
return self.is_result_refptr() or self.is_result_ownptr() or \
|
||||||
|
self.is_result_rawptr()
|
||||||
|
|
||||||
def get_result_refptr_type_root(self):
|
def get_result_ptr_type_root(self):
|
||||||
""" Return the refptr type structure name. """
|
""" Return the *Ptr type structure name. """
|
||||||
return self.result_value[:-1]
|
return self.result_value[:-1]
|
||||||
|
|
||||||
def get_result_refptr_type(self, defined_structs = []):
|
def get_result_ptr_type(self, defined_structs = []):
|
||||||
""" Return the refptr type. """
|
""" Return the *Ptr type. """
|
||||||
result = ''
|
result = ''
|
||||||
if not self.result_value[:-1] in defined_structs:
|
if not self.result_value[:-1] in defined_structs:
|
||||||
result += 'struct _'
|
result += 'struct _'
|
||||||
@ -1761,6 +1809,28 @@ class obj_analysis:
|
|||||||
result += '*'
|
result += '*'
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
def get_result_ptr_type_prefix(self):
|
||||||
|
""" Returns the *Ptr type prefix. """
|
||||||
|
if self.is_result_refptr():
|
||||||
|
return 'ref'
|
||||||
|
if self.is_result_ownptr():
|
||||||
|
return 'own'
|
||||||
|
if self.is_result_rawptr():
|
||||||
|
return 'raw'
|
||||||
|
raise Exception('Not a pointer type')
|
||||||
|
|
||||||
|
def is_result_refptr(self):
|
||||||
|
""" Returns true if this is a RefPtr type. """
|
||||||
|
return (self.result_type == 'refptr')
|
||||||
|
|
||||||
|
def is_result_ownptr(self):
|
||||||
|
""" Returns true if this is a OwnPtr type. """
|
||||||
|
return (self.result_type == 'ownptr')
|
||||||
|
|
||||||
|
def is_result_rawptr(self):
|
||||||
|
""" Returns true if this is a RawPtr type. """
|
||||||
|
return (self.result_type == 'rawptr')
|
||||||
|
|
||||||
def is_result_struct(self):
|
def is_result_struct(self):
|
||||||
""" Returns true if this is a structure type. """
|
""" Returns true if this is a structure type. """
|
||||||
return (self.result_type == 'structure')
|
return (self.result_type == 'structure')
|
||||||
@ -1816,10 +1886,34 @@ class obj_analysis:
|
|||||||
""" Returns true if this is a string vector. """
|
""" Returns true if this is a string vector. """
|
||||||
return self.result_value[0]['result_type'] == 'simple'
|
return self.result_value[0]['result_type'] == 'simple'
|
||||||
|
|
||||||
|
def is_result_vector_ptr(self):
|
||||||
|
""" Returns true if this is a *Ptr vector. """
|
||||||
|
return self.is_result_vector_refptr() or \
|
||||||
|
self.is_result_vector_ownptr() or \
|
||||||
|
self.is_result_vector_rawptr()
|
||||||
|
|
||||||
|
def get_result_vector_ptr_type_prefix(self):
|
||||||
|
""" Returns the *Ptr type prefix. """
|
||||||
|
if self.is_result_vector_refptr():
|
||||||
|
return 'ref'
|
||||||
|
if self.is_result_vector_ownptr():
|
||||||
|
return 'own'
|
||||||
|
if self.is_result_vector_rawptr():
|
||||||
|
return 'raw'
|
||||||
|
raise Exception('Not a pointer type')
|
||||||
|
|
||||||
def is_result_vector_refptr(self):
|
def is_result_vector_refptr(self):
|
||||||
""" Returns true if this is a string vector. """
|
""" Returns true if this is a RefPtr vector. """
|
||||||
return self.result_value[0]['result_type'] == 'refptr'
|
return self.result_value[0]['result_type'] == 'refptr'
|
||||||
|
|
||||||
|
def is_result_vector_ownptr(self):
|
||||||
|
""" Returns true if this is a OwnPtr vector. """
|
||||||
|
return self.result_value[0]['result_type'] == 'ownptr'
|
||||||
|
|
||||||
|
def is_result_vector_rawptr(self):
|
||||||
|
""" Returns true if this is a RawPtr vector. """
|
||||||
|
return self.result_value[0]['result_type'] == 'rawptr'
|
||||||
|
|
||||||
def get_result_vector_type_root(self):
|
def get_result_vector_type_root(self):
|
||||||
""" Return the vector structure or basic type name. """
|
""" Return the vector structure or basic type name. """
|
||||||
return self.result_value[0]['result_value']
|
return self.result_value[0]['result_value']
|
||||||
@ -1844,7 +1938,7 @@ class obj_analysis:
|
|||||||
str += ' const'
|
str += ' const'
|
||||||
str += '*'
|
str += '*'
|
||||||
result['value'] = str
|
result['value'] = str
|
||||||
elif type == 'refptr':
|
elif type == 'refptr' or type == 'ownptr' or type == 'rawptr':
|
||||||
str = ''
|
str = ''
|
||||||
if not value[:-1] in defined_structs:
|
if not value[:-1] in defined_structs:
|
||||||
str += 'struct _'
|
str += 'struct _'
|
||||||
@ -1897,8 +1991,8 @@ class obj_analysis:
|
|||||||
format = 'single'
|
format = 'single'
|
||||||
if self.is_result_simple():
|
if self.is_result_simple():
|
||||||
result += self.get_result_simple_type()
|
result += self.get_result_simple_type()
|
||||||
elif self.is_result_refptr():
|
elif self.is_result_ptr():
|
||||||
result += self.get_result_refptr_type(defined_structs)
|
result += self.get_result_ptr_type(defined_structs)
|
||||||
elif self.is_result_struct():
|
elif self.is_result_struct():
|
||||||
result += self.get_result_struct_type(defined_structs)
|
result += self.get_result_struct_type(defined_structs)
|
||||||
elif self.is_result_string():
|
elif self.is_result_string():
|
||||||
|
@ -51,10 +51,17 @@ def make_cpptoc_header(header, clsname):
|
|||||||
result += '#include "include/'+dcls.get_file_name()+'"\n' \
|
result += '#include "include/'+dcls.get_file_name()+'"\n' \
|
||||||
'#include "include/capi/'+dcls.get_capi_file_name()+'"\n'
|
'#include "include/capi/'+dcls.get_capi_file_name()+'"\n'
|
||||||
|
|
||||||
result += """#include "libcef_dll/cpptoc/cpptoc.h"
|
base_class_name = header.get_base_class_name(clsname)
|
||||||
|
base_scoped = True if base_class_name == 'CefBaseScoped' else False
|
||||||
|
if base_scoped:
|
||||||
|
template_file = 'cpptoc_scoped.h'
|
||||||
|
template_class = 'CefCppToCScoped'
|
||||||
|
else:
|
||||||
|
template_file = 'cpptoc.h'
|
||||||
|
template_class = 'CefCppToC'
|
||||||
|
|
||||||
// Wrap a C++ class with a C structure.
|
result += '#include "libcef_dll/cpptoc/' + template_file + '"'
|
||||||
"""
|
result += '\n\n// Wrap a C++ class with a C structure.\n'
|
||||||
|
|
||||||
if dllside:
|
if dllside:
|
||||||
result += '// This class may be instantiated and accessed DLL-side only.\n'
|
result += '// This class may be instantiated and accessed DLL-side only.\n'
|
||||||
@ -62,7 +69,7 @@ def make_cpptoc_header(header, clsname):
|
|||||||
result += '// This class may be instantiated and accessed wrapper-side only.\n'
|
result += '// This class may be instantiated and accessed wrapper-side only.\n'
|
||||||
|
|
||||||
result += 'class '+clsname+'CppToC\n'+ \
|
result += 'class '+clsname+'CppToC\n'+ \
|
||||||
' : public CefCppToC<'+clsname+'CppToC, '+clsname+', '+capiname+'> {\n'+ \
|
' : public ' + template_class + '<'+clsname+'CppToC, '+clsname+', '+capiname+'> {\n'+ \
|
||||||
' public:\n'+ \
|
' public:\n'+ \
|
||||||
' '+clsname+'CppToC();\n'+ \
|
' '+clsname+'CppToC();\n'+ \
|
||||||
'};\n\n'
|
'};\n\n'
|
||||||
|
@ -94,6 +94,10 @@ def make_cpptoc_function_impl_new(cls, name, func, defined_names):
|
|||||||
arg_type == 'string_byref_const' or arg_type == 'string_byref' or \
|
arg_type == 'string_byref_const' or arg_type == 'string_byref' or \
|
||||||
arg_type == 'refptr_same' or arg_type == 'refptr_same_byref' or \
|
arg_type == 'refptr_same' or arg_type == 'refptr_same_byref' or \
|
||||||
arg_type == 'refptr_diff' or arg_type == 'refptr_diff_byref' or \
|
arg_type == 'refptr_diff' or arg_type == 'refptr_diff_byref' or \
|
||||||
|
arg_type == 'ownptr_same' or arg_type == 'ownptr_same_byref' or \
|
||||||
|
arg_type == 'ownptr_diff' or arg_type == 'ownptr_diff_byref' or \
|
||||||
|
arg_type == 'rawptr_same' or arg_type == 'rawptr_same_byref' or \
|
||||||
|
arg_type == 'rawptr_diff' or arg_type == 'rawptr_diff_byref' or \
|
||||||
arg_type == 'string_vec_byref' or arg_type == 'string_vec_byref_const' or \
|
arg_type == 'string_vec_byref' or arg_type == 'string_vec_byref_const' or \
|
||||||
arg_type == 'string_map_single_byref' or arg_type == 'string_map_single_byref_const' or \
|
arg_type == 'string_map_single_byref' or arg_type == 'string_map_single_byref_const' or \
|
||||||
arg_type == 'string_map_multi_byref' or arg_type == 'string_map_multi_byref_const':
|
arg_type == 'string_map_multi_byref' or arg_type == 'string_map_multi_byref_const':
|
||||||
@ -102,13 +106,17 @@ def make_cpptoc_function_impl_new(cls, name, func, defined_names):
|
|||||||
'\n if (!'+arg_name+')'\
|
'\n if (!'+arg_name+')'\
|
||||||
'\n return'+retval_default+';'
|
'\n return'+retval_default+';'
|
||||||
elif arg_type == 'simple_vec_byref' or arg_type == 'bool_vec_byref' or \
|
elif arg_type == 'simple_vec_byref' or arg_type == 'bool_vec_byref' or \
|
||||||
arg_type == 'refptr_vec_same_byref' or arg_type == 'refptr_vec_diff_byref':
|
arg_type == 'refptr_vec_same_byref' or arg_type == 'refptr_vec_diff_byref' or \
|
||||||
|
arg_type == 'ownptr_vec_same_byref' or arg_type == 'ownptr_vec_diff_byref' or \
|
||||||
|
arg_type == 'rawptr_vec_same_byref' or arg_type == 'rawptr_vec_diff_byref':
|
||||||
result += comment+\
|
result += comment+\
|
||||||
'\n DCHECK('+arg_name+'Count && (*'+arg_name+'Count == 0 || '+arg_name+'));'\
|
'\n DCHECK('+arg_name+'Count && (*'+arg_name+'Count == 0 || '+arg_name+'));'\
|
||||||
'\n if (!'+arg_name+'Count || (*'+arg_name+'Count > 0 && !'+arg_name+'))'\
|
'\n if (!'+arg_name+'Count || (*'+arg_name+'Count > 0 && !'+arg_name+'))'\
|
||||||
'\n return'+retval_default+';'
|
'\n return'+retval_default+';'
|
||||||
elif arg_type == 'simple_vec_byref_const' or arg_type == 'bool_vec_byref_const' or \
|
elif arg_type == 'simple_vec_byref_const' or arg_type == 'bool_vec_byref_const' or \
|
||||||
arg_type == 'refptr_vec_same_byref_const' or arg_type == 'refptr_vec_diff_byref_const':
|
arg_type == 'refptr_vec_same_byref_const' or arg_type == 'refptr_vec_diff_byref_const' or \
|
||||||
|
arg_type == 'ownptr_vec_same_byref_const' or arg_type == 'ownptr_vec_diff_byref_const' or \
|
||||||
|
arg_type == 'rawptr_vec_same_byref_const' or arg_type == 'rawptr_vec_diff_byref_const':
|
||||||
result += comment+\
|
result += comment+\
|
||||||
'\n DCHECK('+arg_name+'Count == 0 || '+arg_name+');'\
|
'\n DCHECK('+arg_name+'Count == 0 || '+arg_name+');'\
|
||||||
'\n if ('+arg_name+'Count > 0 && !'+arg_name+')'\
|
'\n if ('+arg_name+'Count > 0 && !'+arg_name+')'\
|
||||||
@ -184,22 +192,36 @@ def make_cpptoc_function_impl_new(cls, name, func, defined_names):
|
|||||||
'\n CefString '+arg_name+'Str('+arg_name+');'
|
'\n CefString '+arg_name+'Str('+arg_name+');'
|
||||||
params.append(arg_name+'Str')
|
params.append(arg_name+'Str')
|
||||||
elif arg_type == 'refptr_same' or arg_type == 'refptr_diff':
|
elif arg_type == 'refptr_same' or arg_type == 'refptr_diff':
|
||||||
refptr_class = arg.get_type().get_refptr_type()
|
ptr_class = arg.get_type().get_ptr_type()
|
||||||
if arg_type == 'refptr_same':
|
if arg_type == 'refptr_same':
|
||||||
params.append(refptr_class+'CppToC::Unwrap('+arg_name+')')
|
params.append(ptr_class+'CppToC::Unwrap('+arg_name+')')
|
||||||
else:
|
else:
|
||||||
params.append(refptr_class+'CToCpp::Wrap('+arg_name+')')
|
params.append(ptr_class+'CToCpp::Wrap('+arg_name+')')
|
||||||
elif arg_type == 'refptr_same_byref' or arg_type == 'refptr_diff_byref':
|
elif arg_type == 'ownptr_same' or arg_type == 'rawptr_same':
|
||||||
refptr_class = arg.get_type().get_refptr_type()
|
ptr_class = arg.get_type().get_ptr_type()
|
||||||
if arg_type == 'refptr_same_byref':
|
if arg_type == 'ownptr_same':
|
||||||
assign = refptr_class+'CppToC::Unwrap(*'+arg_name+')'
|
params.append(ptr_class+'CppToC::UnwrapOwn('+arg_name+')')
|
||||||
else:
|
else:
|
||||||
assign = refptr_class+'CToCpp::Wrap(*'+arg_name+')'
|
params.append(ptr_class+'CppToC::UnwrapRaw('+arg_name+')')
|
||||||
|
elif arg_type == 'ownptr_diff' or arg_type == 'rawptr_diff':
|
||||||
|
ptr_class = arg.get_type().get_ptr_type()
|
||||||
result += comment+\
|
result += comment+\
|
||||||
'\n CefRefPtr<'+refptr_class+'> '+arg_name+'Ptr;'\
|
'\n CefOwnPtr<'+ptr_class+'> '+arg_name+'Ptr('+ptr_class+'CToCpp::Wrap('+arg_name+'));'
|
||||||
|
if arg_type == 'ownptr_diff':
|
||||||
|
params.append('OWN_PASS('+arg_name+'Ptr)')
|
||||||
|
else:
|
||||||
|
params.append(arg_name+'Ptr.get()')
|
||||||
|
elif arg_type == 'refptr_same_byref' or arg_type == 'refptr_diff_byref':
|
||||||
|
ptr_class = arg.get_type().get_ptr_type()
|
||||||
|
if arg_type == 'refptr_same_byref':
|
||||||
|
assign = ptr_class+'CppToC::Unwrap(*'+arg_name+')'
|
||||||
|
else:
|
||||||
|
assign = ptr_class+'CToCpp::Wrap(*'+arg_name+')'
|
||||||
|
result += comment+\
|
||||||
|
'\n CefRefPtr<'+ptr_class+'> '+arg_name+'Ptr;'\
|
||||||
'\n if ('+arg_name+' && *'+arg_name+')'\
|
'\n if ('+arg_name+' && *'+arg_name+')'\
|
||||||
'\n '+arg_name+'Ptr = '+assign+';'\
|
'\n '+arg_name+'Ptr = '+assign+';'\
|
||||||
'\n '+refptr_class+'* '+arg_name+'Orig = '+arg_name+'Ptr.get();'
|
'\n '+ptr_class+'* '+arg_name+'Orig = '+arg_name+'Ptr.get();'
|
||||||
params.append(arg_name+'Ptr')
|
params.append(arg_name+'Ptr')
|
||||||
elif arg_type == 'string_vec_byref' or arg_type == 'string_vec_byref_const':
|
elif arg_type == 'string_vec_byref' or arg_type == 'string_vec_byref_const':
|
||||||
result += comment+\
|
result += comment+\
|
||||||
@ -224,11 +246,11 @@ def make_cpptoc_function_impl_new(cls, name, func, defined_names):
|
|||||||
elif arg_type == 'bool_vec_byref':
|
elif arg_type == 'bool_vec_byref':
|
||||||
assign = arg_name+'[i]?true:false'
|
assign = arg_name+'[i]?true:false'
|
||||||
elif arg_type == 'refptr_vec_same_byref':
|
elif arg_type == 'refptr_vec_same_byref':
|
||||||
refptr_class = arg.get_type().get_refptr_type()
|
ptr_class = arg.get_type().get_ptr_type()
|
||||||
assign = refptr_class+'CppToC::Unwrap('+arg_name+'[i])'
|
assign = ptr_class+'CppToC::Unwrap('+arg_name+'[i])'
|
||||||
elif arg_type == 'refptr_vec_diff_byref':
|
elif arg_type == 'refptr_vec_diff_byref':
|
||||||
refptr_class = arg.get_type().get_refptr_type()
|
ptr_class = arg.get_type().get_ptr_type()
|
||||||
assign = refptr_class+'CToCpp::Wrap('+arg_name+'[i])'
|
assign = ptr_class+'CToCpp::Wrap('+arg_name+'[i])'
|
||||||
result += comment+\
|
result += comment+\
|
||||||
'\n std::vector<'+vec_type+' > '+arg_name+'List;'\
|
'\n std::vector<'+vec_type+' > '+arg_name+'List;'\
|
||||||
'\n if ('+arg_name+'Count && *'+arg_name+'Count > 0 && '+arg_name+') {'\
|
'\n if ('+arg_name+'Count && *'+arg_name+'Count > 0 && '+arg_name+') {'\
|
||||||
@ -238,18 +260,23 @@ def make_cpptoc_function_impl_new(cls, name, func, defined_names):
|
|||||||
'\n }'
|
'\n }'
|
||||||
params.append(arg_name+'List')
|
params.append(arg_name+'List')
|
||||||
elif arg_type == 'simple_vec_byref_const' or arg_type == 'bool_vec_byref_const' or \
|
elif arg_type == 'simple_vec_byref_const' or arg_type == 'bool_vec_byref_const' or \
|
||||||
arg_type == 'refptr_vec_same_byref_const' or arg_type == 'refptr_vec_diff_byref_const':
|
arg_type == 'refptr_vec_same_byref_const' or arg_type == 'refptr_vec_diff_byref_const' or \
|
||||||
|
arg_type == 'rawptr_vec_same_byref_const' or arg_type == 'rawptr_vec_diff_byref_const':
|
||||||
vec_type = arg.get_type().get_vector_type()
|
vec_type = arg.get_type().get_vector_type()
|
||||||
if arg_type == 'simple_vec_byref_const':
|
if arg_type == 'simple_vec_byref_const':
|
||||||
assign = arg_name+'[i]'
|
assign = arg_name+'[i]'
|
||||||
elif arg_type == 'bool_vec_byref_const':
|
elif arg_type == 'bool_vec_byref_const':
|
||||||
assign = arg_name+'[i]?true:false'
|
assign = arg_name+'[i]?true:false'
|
||||||
elif arg_type == 'refptr_vec_same_byref_const':
|
else:
|
||||||
refptr_class = arg.get_type().get_refptr_type()
|
ptr_class = arg.get_type().get_ptr_type()
|
||||||
assign = refptr_class+'CppToC::Unwrap('+arg_name+'[i])'
|
if arg_type == 'refptr_vec_same_byref_const':
|
||||||
elif arg_type == 'refptr_vec_diff_byref_const':
|
assign = ptr_class+'CppToC::Unwrap('+arg_name+'[i])'
|
||||||
refptr_class = arg.get_type().get_refptr_type()
|
elif arg_type == 'refptr_vec_diff_byref_const':
|
||||||
assign = refptr_class+'CToCpp::Wrap('+arg_name+'[i])'
|
assign = ptr_class+'CToCpp::Wrap('+arg_name+'[i])'
|
||||||
|
elif arg_type == 'rawptr_vec_same_byref_const':
|
||||||
|
assign = ptr_class+'CppToC::UnwrapRaw('+arg_name+'[i])'
|
||||||
|
elif arg_type == 'rawptr_vec_diff_byref_const':
|
||||||
|
assign = ptr_class+'CToCpp::Wrap('+arg_name+'[i]).release()'
|
||||||
result += comment+\
|
result += comment+\
|
||||||
'\n std::vector<'+vec_type+' > '+arg_name+'List;'\
|
'\n std::vector<'+vec_type+' > '+arg_name+'List;'\
|
||||||
'\n if ('+arg_name+'Count > 0) {'\
|
'\n if ('+arg_name+'Count > 0) {'\
|
||||||
@ -259,6 +286,8 @@ def make_cpptoc_function_impl_new(cls, name, func, defined_names):
|
|||||||
'\n }'\
|
'\n }'\
|
||||||
'\n }'
|
'\n }'
|
||||||
params.append(arg_name+'List')
|
params.append(arg_name+'List')
|
||||||
|
else:
|
||||||
|
raise Exception('Unsupported argument type %s for parameter %s in %s' % (arg_type, arg_name, name))
|
||||||
|
|
||||||
if len(result) != result_len:
|
if len(result) != result_len:
|
||||||
result += '\n'
|
result += '\n'
|
||||||
@ -315,11 +344,11 @@ def make_cpptoc_function_impl_new(cls, name, func, defined_names):
|
|||||||
'\n if ('+arg_name+')'\
|
'\n if ('+arg_name+')'\
|
||||||
'\n '+arg_name+'Obj.DetachTo(*'+arg_name+');'
|
'\n '+arg_name+'Obj.DetachTo(*'+arg_name+');'
|
||||||
elif arg_type == 'refptr_same_byref' or arg_type == 'refptr_diff_byref':
|
elif arg_type == 'refptr_same_byref' or arg_type == 'refptr_diff_byref':
|
||||||
refptr_class = arg.get_type().get_refptr_type()
|
ptr_class = arg.get_type().get_ptr_type()
|
||||||
if arg_type == 'refptr_same_byref':
|
if arg_type == 'refptr_same_byref':
|
||||||
assign = refptr_class+'CppToC::Wrap('+arg_name+'Ptr)'
|
assign = ptr_class+'CppToC::Wrap('+arg_name+'Ptr)'
|
||||||
else:
|
else:
|
||||||
assign = refptr_class+'CToCpp::Unwrap('+arg_name+'Ptr)'
|
assign = ptr_class+'CToCpp::Unwrap('+arg_name+'Ptr)'
|
||||||
result += comment+\
|
result += comment+\
|
||||||
'\n if ('+arg_name+') {'\
|
'\n if ('+arg_name+') {'\
|
||||||
'\n if ('+arg_name+'Ptr.get()) {'\
|
'\n if ('+arg_name+'Ptr.get()) {'\
|
||||||
@ -347,11 +376,11 @@ def make_cpptoc_function_impl_new(cls, name, func, defined_names):
|
|||||||
if arg_type == 'simple_vec_byref' or arg_type == 'bool_vec_byref':
|
if arg_type == 'simple_vec_byref' or arg_type == 'bool_vec_byref':
|
||||||
assign = arg_name+'List[i]'
|
assign = arg_name+'List[i]'
|
||||||
elif arg_type == 'refptr_vec_same_byref':
|
elif arg_type == 'refptr_vec_same_byref':
|
||||||
refptr_class = arg.get_type().get_refptr_type()
|
ptr_class = arg.get_type().get_ptr_type()
|
||||||
assign = refptr_class+'CppToC::Wrap('+arg_name+'List[i])'
|
assign = ptr_class+'CppToC::Wrap('+arg_name+'List[i])'
|
||||||
elif arg_type == 'refptr_vec_diff_byref':
|
elif arg_type == 'refptr_vec_diff_byref':
|
||||||
refptr_class = arg.get_type().get_refptr_type()
|
ptr_class = arg.get_type().get_ptr_type()
|
||||||
assign = refptr_class+'CToCpp::Unwrap('+arg_name+'List[i])'
|
assign = ptr_class+'CToCpp::Unwrap('+arg_name+'List[i])'
|
||||||
result += comment+\
|
result += comment+\
|
||||||
'\n if ('+arg_name+'Count && '+arg_name+') {'\
|
'\n if ('+arg_name+'Count && '+arg_name+') {'\
|
||||||
'\n *'+arg_name+'Count = std::min('+arg_name+'List.size(), *'+arg_name+'Count);'\
|
'\n *'+arg_name+'Count = std::min('+arg_name+'List.size(), *'+arg_name+'Count);'\
|
||||||
@ -361,6 +390,13 @@ def make_cpptoc_function_impl_new(cls, name, func, defined_names):
|
|||||||
'\n }'\
|
'\n }'\
|
||||||
'\n }'\
|
'\n }'\
|
||||||
'\n }'
|
'\n }'
|
||||||
|
elif arg_type == 'rawptr_vec_diff_byref_const':
|
||||||
|
result += comment+\
|
||||||
|
'\n if ('+arg_name+'Count > 0) {'\
|
||||||
|
'\n for (size_t i = 0; i < '+arg_name+'Count; ++i) {'\
|
||||||
|
'\n delete '+arg_name+'List[i];'\
|
||||||
|
'\n }'\
|
||||||
|
'\n }'
|
||||||
|
|
||||||
if len(result) != result_len:
|
if len(result) != result_len:
|
||||||
result += '\n'
|
result += '\n'
|
||||||
@ -401,11 +437,19 @@ def make_cpptoc_function_impl_new(cls, name, func, defined_names):
|
|||||||
elif retval_type == 'string':
|
elif retval_type == 'string':
|
||||||
result += '\n return _retval.DetachToUserFree();'
|
result += '\n return _retval.DetachToUserFree();'
|
||||||
elif retval_type == 'refptr_same':
|
elif retval_type == 'refptr_same':
|
||||||
refptr_class = retval.get_type().get_refptr_type()
|
ptr_class = retval.get_type().get_ptr_type()
|
||||||
result += '\n return '+refptr_class+'CppToC::Wrap(_retval);'
|
result += '\n return '+ptr_class+'CppToC::Wrap(_retval);'
|
||||||
elif retval_type == 'refptr_diff':
|
elif retval_type == 'refptr_diff':
|
||||||
refptr_class = retval.get_type().get_refptr_type()
|
ptr_class = retval.get_type().get_ptr_type()
|
||||||
result += '\n return '+refptr_class+'CToCpp::Unwrap(_retval);'
|
result += '\n return '+ptr_class+'CToCpp::Unwrap(_retval);'
|
||||||
|
elif retval_type == 'ownptr_same':
|
||||||
|
ptr_class = retval.get_type().get_ptr_type()
|
||||||
|
result += '\n return '+ptr_class+'CppToC::WrapOwn(OWN_PASS(_retval));'
|
||||||
|
elif retval_type == 'ownptr_diff':
|
||||||
|
ptr_class = retval.get_type().get_ptr_type()
|
||||||
|
result += '\n return '+ptr_class+'CToCpp::UnwrapOwn(OWN_PASS(_retval));'
|
||||||
|
else:
|
||||||
|
raise Exception('Unsupported return type %s in %s' % (retval_type, name))
|
||||||
|
|
||||||
if len(result) != result_len:
|
if len(result) != result_len:
|
||||||
result += '\n'
|
result += '\n'
|
||||||
@ -437,7 +481,7 @@ def make_cpptoc_virtual_function_impl(header, cls, existing, prefixname, defined
|
|||||||
cur_cls = cls
|
cur_cls = cls
|
||||||
while True:
|
while True:
|
||||||
parent_name = cur_cls.get_parent_name()
|
parent_name = cur_cls.get_parent_name()
|
||||||
if parent_name == 'CefBase':
|
if is_base_class(parent_name):
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
parent_cls = header.get_class(parent_name, defined_names)
|
parent_cls = header.get_class(parent_name, defined_names)
|
||||||
@ -463,7 +507,7 @@ def make_cpptoc_virtual_function_assignment(header, cls, prefixname, defined_nam
|
|||||||
while True:
|
while True:
|
||||||
parent_name = cur_cls.get_parent_name()
|
parent_name = cur_cls.get_parent_name()
|
||||||
offset += 'base.'
|
offset += 'base.'
|
||||||
if parent_name == 'CefBase':
|
if is_base_class(parent_name):
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
parent_cls = header.get_class(parent_name, defined_names)
|
parent_cls = header.get_class(parent_name, defined_names)
|
||||||
@ -474,25 +518,37 @@ def make_cpptoc_virtual_function_assignment(header, cls, prefixname, defined_nam
|
|||||||
|
|
||||||
return impl
|
return impl
|
||||||
|
|
||||||
def make_cpptoc_unwrap_derived(header, cls):
|
def make_cpptoc_unwrap_derived(header, cls, base_scoped):
|
||||||
# identify all classes that derive from cls
|
# identify all classes that derive from cls
|
||||||
derived_classes = []
|
derived_classes = []
|
||||||
clsname = cls.get_name()
|
cur_clsname = cls.get_name()
|
||||||
allclasses = header.get_classes()
|
allclasses = header.get_classes()
|
||||||
for cur_cls in allclasses:
|
for cur_cls in allclasses:
|
||||||
if cur_cls.get_name() == clsname:
|
if cur_cls.get_name() == cur_clsname:
|
||||||
continue
|
continue
|
||||||
if cur_cls.has_parent(clsname):
|
if cur_cls.has_parent(cur_clsname):
|
||||||
derived_classes.append(cur_cls.get_name())
|
derived_classes.append(cur_cls.get_name())
|
||||||
|
|
||||||
derived_classes = sorted(derived_classes)
|
derived_classes = sorted(derived_classes)
|
||||||
|
|
||||||
impl = ''
|
if base_scoped:
|
||||||
for clsname in derived_classes:
|
impl = ['', '']
|
||||||
impl += ' if (type == '+get_wrapper_type_enum(clsname)+') {\n'+\
|
for clsname in derived_classes:
|
||||||
' return '+clsname+'CppToC::Unwrap(reinterpret_cast<'+\
|
impl[0] += ' if (type == '+get_wrapper_type_enum(clsname)+') {\n'+\
|
||||||
get_capi_name(clsname, True)+'*>(s));\n'+\
|
' return OWN_RETURN_AS('+clsname+'CppToC::UnwrapOwn(reinterpret_cast<'+\
|
||||||
' }\n'
|
get_capi_name(clsname, True)+'*>(s)), '+cur_clsname+');\n'+\
|
||||||
|
' }\n'
|
||||||
|
impl[1] += ' if (type == '+get_wrapper_type_enum(clsname)+') {\n'+\
|
||||||
|
' return '+clsname+'CppToC::UnwrapRaw(reinterpret_cast<'+\
|
||||||
|
get_capi_name(clsname, True)+'*>(s));\n'+\
|
||||||
|
' }\n'
|
||||||
|
else:
|
||||||
|
impl = ''
|
||||||
|
for clsname in derived_classes:
|
||||||
|
impl += ' if (type == '+get_wrapper_type_enum(clsname)+') {\n'+\
|
||||||
|
' return '+clsname+'CppToC::Unwrap(reinterpret_cast<'+\
|
||||||
|
get_capi_name(clsname, True)+'*>(s));\n'+\
|
||||||
|
' }\n'
|
||||||
return impl
|
return impl
|
||||||
|
|
||||||
def make_cpptoc_class_impl(header, clsname, impl):
|
def make_cpptoc_class_impl(header, clsname, impl):
|
||||||
@ -510,6 +566,13 @@ def make_cpptoc_class_impl(header, clsname, impl):
|
|||||||
# retrieve the existing virtual function implementations
|
# retrieve the existing virtual function implementations
|
||||||
existing = get_function_impls(impl, 'CEF_CALLBACK')
|
existing = get_function_impls(impl, 'CEF_CALLBACK')
|
||||||
|
|
||||||
|
base_class_name = header.get_base_class_name(clsname)
|
||||||
|
base_scoped = True if base_class_name == 'CefBaseScoped' else False
|
||||||
|
if base_scoped:
|
||||||
|
template_class = 'CefCppToCScoped'
|
||||||
|
else:
|
||||||
|
template_class = 'CefCppToC'
|
||||||
|
|
||||||
# generate virtual functions
|
# generate virtual functions
|
||||||
virtualimpl = make_cpptoc_virtual_function_impl(header, cls, existing, prefixname, defined_names)
|
virtualimpl = make_cpptoc_virtual_function_impl(header, cls, existing, prefixname, defined_names)
|
||||||
if len(virtualimpl) > 0:
|
if len(virtualimpl) > 0:
|
||||||
@ -529,31 +592,43 @@ def make_cpptoc_class_impl(header, clsname, impl):
|
|||||||
resultingimpl = staticimpl + virtualimpl
|
resultingimpl = staticimpl + virtualimpl
|
||||||
|
|
||||||
# any derived classes can be unwrapped
|
# any derived classes can be unwrapped
|
||||||
unwrapderived = make_cpptoc_unwrap_derived(header, cls)
|
unwrapderived = make_cpptoc_unwrap_derived(header, cls, base_scoped)
|
||||||
|
|
||||||
# determine what includes are required by identifying what translation
|
# determine what includes are required by identifying what translation
|
||||||
# classes are being used
|
# classes are being used
|
||||||
includes = format_translation_includes(header, resultingimpl + unwrapderived)
|
includes = format_translation_includes(header, resultingimpl + (unwrapderived[0] if base_scoped else unwrapderived))
|
||||||
|
|
||||||
# build the final output
|
# build the final output
|
||||||
result = get_copyright()
|
result = get_copyright()
|
||||||
|
|
||||||
result += includes+'\n'+resultingimpl+'\n'
|
result += includes+'\n'+resultingimpl+'\n'
|
||||||
|
|
||||||
parent_sig = 'CefCppToC<'+clsname+'CppToC, '+clsname+', '+capiname+'>'
|
parent_sig = template_class+'<'+clsname+'CppToC, '+clsname+', '+capiname+'>'
|
||||||
|
|
||||||
const = '// CONSTRUCTOR - Do not edit by hand.\n\n'+ \
|
const = '// CONSTRUCTOR - Do not edit by hand.\n\n'+ \
|
||||||
clsname+'CppToC::'+clsname+'CppToC() {\n'
|
clsname+'CppToC::'+clsname+'CppToC() {\n'
|
||||||
|
|
||||||
const += make_cpptoc_virtual_function_assignment(header, cls, prefixname, defined_names)
|
const += make_cpptoc_virtual_function_assignment(header, cls, prefixname, defined_names)
|
||||||
|
const += '}\n\n'
|
||||||
|
|
||||||
const += '}\n\n'+ \
|
if base_scoped:
|
||||||
'template<> CefRefPtr<'+clsname+'> '+parent_sig+'::UnwrapDerived(CefWrapperType type, '+capiname+'* s) {\n' + \
|
const += 'template<> CefOwnPtr<'+clsname+'> '+parent_sig+'::UnwrapDerivedOwn(CefWrapperType type, '+capiname+'* s) {\n' + \
|
||||||
unwrapderived + \
|
unwrapderived[0] + \
|
||||||
' NOTREACHED() << "Unexpected class type: " << type;\n'+ \
|
' NOTREACHED() << "Unexpected class type: " << type;\n'+ \
|
||||||
' return NULL;\n'+ \
|
' return CefOwnPtr<'+clsname+'>();\n'+ \
|
||||||
'}\n\n'+ \
|
'}\n\n' + \
|
||||||
'#if DCHECK_IS_ON()\n'+ \
|
'template<> CefRawPtr<'+clsname+'> '+parent_sig+'::UnwrapDerivedRaw(CefWrapperType type, '+capiname+'* s) {\n' + \
|
||||||
|
unwrapderived[1] + \
|
||||||
|
' NOTREACHED() << "Unexpected class type: " << type;\n'+ \
|
||||||
|
' return NULL;\n'+ \
|
||||||
|
'}\n\n'
|
||||||
|
else:
|
||||||
|
const += 'template<> CefRefPtr<'+clsname+'> '+parent_sig+'::UnwrapDerived(CefWrapperType type, '+capiname+'* s) {\n' + \
|
||||||
|
unwrapderived + \
|
||||||
|
' NOTREACHED() << "Unexpected class type: " << type;\n'+ \
|
||||||
|
' return NULL;\n'+ \
|
||||||
|
'}\n\n'
|
||||||
|
|
||||||
|
const += '#if DCHECK_IS_ON()\n'+ \
|
||||||
'template<> base::AtomicRefCount '+parent_sig+'::DebugObjCt = 0;\n'+ \
|
'template<> base::AtomicRefCount '+parent_sig+'::DebugObjCt = 0;\n'+ \
|
||||||
'#endif\n\n'+ \
|
'#endif\n\n'+ \
|
||||||
'template<> CefWrapperType '+parent_sig+'::kWrapperType = '+get_wrapper_type_enum(clsname)+';'
|
'template<> CefWrapperType '+parent_sig+'::kWrapperType = '+get_wrapper_type_enum(clsname)+';'
|
||||||
|
@ -23,7 +23,7 @@ def make_function_body(header, cls):
|
|||||||
cur_cls = cls
|
cur_cls = cls
|
||||||
while True:
|
while True:
|
||||||
parent_name = cur_cls.get_parent_name()
|
parent_name = cur_cls.get_parent_name()
|
||||||
if parent_name == 'CefBase':
|
if is_base_class(parent_name):
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
parent_cls = header.get_class(parent_name)
|
parent_cls = header.get_class(parent_name)
|
||||||
@ -92,10 +92,17 @@ def make_ctocpp_header(header, clsname):
|
|||||||
result += '#include "include/'+dcls.get_file_name()+'"\n' \
|
result += '#include "include/'+dcls.get_file_name()+'"\n' \
|
||||||
'#include "include/capi/'+dcls.get_capi_file_name()+'"\n'
|
'#include "include/capi/'+dcls.get_capi_file_name()+'"\n'
|
||||||
|
|
||||||
result += """#include "libcef_dll/ctocpp/ctocpp.h"
|
base_class_name = header.get_base_class_name(clsname)
|
||||||
|
base_scoped = True if base_class_name == 'CefBaseScoped' else False
|
||||||
|
if base_scoped:
|
||||||
|
template_file = 'ctocpp_scoped.h'
|
||||||
|
template_class = 'CefCToCppScoped'
|
||||||
|
else:
|
||||||
|
template_file = 'ctocpp.h'
|
||||||
|
template_class = 'CefCToCpp'
|
||||||
|
|
||||||
// Wrap a C structure with a C++ class.
|
result += '#include "libcef_dll/ctocpp/' + template_file + '"'
|
||||||
"""
|
result += '\n\n// Wrap a C structure with a C++ class.\n'
|
||||||
|
|
||||||
if clientside:
|
if clientside:
|
||||||
result += '// This class may be instantiated and accessed DLL-side only.\n'
|
result += '// This class may be instantiated and accessed DLL-side only.\n'
|
||||||
@ -103,7 +110,7 @@ def make_ctocpp_header(header, clsname):
|
|||||||
result += '// This class may be instantiated and accessed wrapper-side only.\n'
|
result += '// This class may be instantiated and accessed wrapper-side only.\n'
|
||||||
|
|
||||||
result += 'class '+clsname+'CToCpp\n'+ \
|
result += 'class '+clsname+'CToCpp\n'+ \
|
||||||
' : public CefCToCpp<'+clsname+'CToCpp, '+clsname+', '+capiname+'> {\n'+ \
|
' : public ' + template_class + '<'+clsname+'CToCpp, '+clsname+', '+capiname+'> {\n'+ \
|
||||||
' public:\n'+ \
|
' public:\n'+ \
|
||||||
' '+clsname+'CToCpp();\n\n'
|
' '+clsname+'CToCpp();\n\n'
|
||||||
|
|
||||||
|
@ -117,11 +117,17 @@ def make_ctocpp_function_impl_new(clsname, name, func):
|
|||||||
'\n DCHECK('+arg_name+');'\
|
'\n DCHECK('+arg_name+');'\
|
||||||
'\n if (!'+arg_name+')'\
|
'\n if (!'+arg_name+')'\
|
||||||
'\n return'+retval_default+';'
|
'\n return'+retval_default+';'
|
||||||
elif arg_type == 'refptr_same' or arg_type == 'refptr_diff':
|
elif arg_type == 'refptr_same' or arg_type == 'refptr_diff' or \
|
||||||
|
arg_type == 'ownptr_same' or arg_type == 'ownptr_diff':
|
||||||
result += comment+\
|
result += comment+\
|
||||||
'\n DCHECK('+arg_name+'.get());'\
|
'\n DCHECK('+arg_name+'.get());'\
|
||||||
'\n if (!'+arg_name+'.get())'\
|
'\n if (!'+arg_name+'.get())'\
|
||||||
'\n return'+retval_default+';'
|
'\n return'+retval_default+';'
|
||||||
|
elif arg_type == 'rawptr_same' or arg_type == 'rawptr_diff':
|
||||||
|
result += comment+\
|
||||||
|
'\n DCHECK('+arg_name+');'\
|
||||||
|
'\n if (!'+arg_name+')'\
|
||||||
|
'\n return'+retval_default+';'
|
||||||
elif arg_type == 'string_byref_const':
|
elif arg_type == 'string_byref_const':
|
||||||
result += comment+\
|
result += comment+\
|
||||||
'\n DCHECK(!'+arg_name+'.empty());'\
|
'\n DCHECK(!'+arg_name+'.empty());'\
|
||||||
@ -181,23 +187,37 @@ def make_ctocpp_function_impl_new(clsname, name, func):
|
|||||||
elif arg_type == 'string_byref':
|
elif arg_type == 'string_byref':
|
||||||
params.append(arg_name+'.GetWritableStruct()')
|
params.append(arg_name+'.GetWritableStruct()')
|
||||||
elif arg_type == 'refptr_same':
|
elif arg_type == 'refptr_same':
|
||||||
refptr_class = arg.get_type().get_refptr_type()
|
ptr_class = arg.get_type().get_ptr_type()
|
||||||
params.append(refptr_class+'CToCpp::Unwrap('+arg_name+')')
|
params.append(ptr_class+'CToCpp::Unwrap('+arg_name+')')
|
||||||
|
elif arg_type == 'ownptr_same':
|
||||||
|
ptr_class = arg.get_type().get_ptr_type()
|
||||||
|
params.append(ptr_class+'CToCpp::UnwrapOwn(OWN_PASS('+arg_name+'))')
|
||||||
|
elif arg_type == 'rawptr_same':
|
||||||
|
ptr_class = arg.get_type().get_ptr_type()
|
||||||
|
params.append(ptr_class+'CToCpp::UnwrapRaw('+arg_name+')')
|
||||||
elif arg_type == 'refptr_diff':
|
elif arg_type == 'refptr_diff':
|
||||||
refptr_class = arg.get_type().get_refptr_type()
|
ptr_class = arg.get_type().get_ptr_type()
|
||||||
params.append(refptr_class+'CppToC::Wrap('+arg_name+')')
|
params.append(ptr_class+'CppToC::Wrap('+arg_name+')')
|
||||||
elif arg_type == 'refptr_same_byref' or arg_type == 'refptr_diff_byref':
|
elif arg_type == 'ownptr_diff':
|
||||||
refptr_class = arg.get_type().get_refptr_type()
|
ptr_class = arg.get_type().get_ptr_type()
|
||||||
refptr_struct = arg.get_type().get_result_refptr_type_root()
|
params.append(ptr_class+'CppToC::WrapOwn(OWN_PASS('+arg_name+'))')
|
||||||
if arg_type == 'refptr_same_byref':
|
elif arg_type == 'rawptr_diff':
|
||||||
assign = refptr_class+'CToCpp::Unwrap('+arg_name+')'
|
ptr_class = arg.get_type().get_ptr_type()
|
||||||
else:
|
|
||||||
assign = refptr_class+'CppToC::Wrap('+arg_name+')'
|
|
||||||
result += comment+\
|
result += comment+\
|
||||||
'\n '+refptr_struct+'* '+arg_name+'Struct = NULL;'\
|
'\n CefOwnPtr<'+ptr_class+'CppToC> '+arg_name+'Ptr('+ptr_class+'CppToC::WrapRaw('+arg_name+'));'
|
||||||
|
params.append(arg_name+'Ptr->GetStruct()')
|
||||||
|
elif arg_type == 'refptr_same_byref' or arg_type == 'refptr_diff_byref':
|
||||||
|
ptr_class = arg.get_type().get_ptr_type()
|
||||||
|
ptr_struct = arg.get_type().get_result_ptr_type_root()
|
||||||
|
if arg_type == 'refptr_same_byref':
|
||||||
|
assign = ptr_class+'CToCpp::Unwrap('+arg_name+')'
|
||||||
|
else:
|
||||||
|
assign = ptr_class+'CppToC::Wrap('+arg_name+')'
|
||||||
|
result += comment+\
|
||||||
|
'\n '+ptr_struct+'* '+arg_name+'Struct = NULL;'\
|
||||||
'\n if ('+arg_name+'.get())'\
|
'\n if ('+arg_name+'.get())'\
|
||||||
'\n '+arg_name+'Struct = '+assign+';'\
|
'\n '+arg_name+'Struct = '+assign+';'\
|
||||||
'\n '+refptr_struct+'* '+arg_name+'Orig = '+arg_name+'Struct;'
|
'\n '+ptr_struct+'* '+arg_name+'Orig = '+arg_name+'Struct;'
|
||||||
params.append('&'+arg_name+'Struct')
|
params.append('&'+arg_name+'Struct')
|
||||||
elif arg_type == 'string_vec_byref' or arg_type == 'string_vec_byref_const':
|
elif arg_type == 'string_vec_byref' or arg_type == 'string_vec_byref_const':
|
||||||
result += comment+\
|
result += comment+\
|
||||||
@ -225,11 +245,11 @@ def make_ctocpp_function_impl_new(clsname, name, func):
|
|||||||
count_func = arg.get_attrib_count_func()
|
count_func = arg.get_attrib_count_func()
|
||||||
vec_type = arg.get_type().get_result_vector_type_root()
|
vec_type = arg.get_type().get_result_vector_type_root()
|
||||||
if arg_type == 'refptr_vec_same_byref':
|
if arg_type == 'refptr_vec_same_byref':
|
||||||
refptr_class = arg.get_type().get_refptr_type()
|
ptr_class = arg.get_type().get_ptr_type()
|
||||||
assign = refptr_class+'CToCpp::Unwrap('+arg_name+'[i])'
|
assign = ptr_class+'CToCpp::Unwrap('+arg_name+'[i])'
|
||||||
elif arg_type == 'refptr_vec_diff_byref':
|
elif arg_type == 'refptr_vec_diff_byref':
|
||||||
refptr_class = arg.get_type().get_refptr_type()
|
ptr_class = arg.get_type().get_ptr_type()
|
||||||
assign = refptr_class+'CppToC::Wrap('+arg_name+'[i])'
|
assign = ptr_class+'CppToC::Wrap('+arg_name+'[i])'
|
||||||
else:
|
else:
|
||||||
assign = arg_name+'[i]'
|
assign = arg_name+'[i]'
|
||||||
result += comment+\
|
result += comment+\
|
||||||
@ -251,17 +271,22 @@ def make_ctocpp_function_impl_new(clsname, name, func):
|
|||||||
params.append('&'+arg_name+'Count')
|
params.append('&'+arg_name+'Count')
|
||||||
params.append(arg_name+'List')
|
params.append(arg_name+'List')
|
||||||
elif arg_type == 'simple_vec_byref_const' or arg_type == 'bool_vec_byref_const' or \
|
elif arg_type == 'simple_vec_byref_const' or arg_type == 'bool_vec_byref_const' or \
|
||||||
arg_type == 'refptr_vec_same_byref_const' or arg_type == 'refptr_vec_diff_byref_const':
|
arg_type == 'refptr_vec_same_byref_const' or arg_type == 'refptr_vec_diff_byref_const' or \
|
||||||
|
arg_type == 'rawptr_vec_same_byref_const' or arg_type == 'rawptr_vec_diff_byref_const':
|
||||||
count_func = arg.get_attrib_count_func()
|
count_func = arg.get_attrib_count_func()
|
||||||
vec_type = arg.get_type().get_result_vector_type_root()
|
vec_type = arg.get_type().get_result_vector_type_root()
|
||||||
if arg_type == 'refptr_vec_same_byref_const':
|
if arg_type == 'simple_vec_byref_const' or arg_type == 'bool_vec_byref_const':
|
||||||
refptr_class = arg.get_type().get_refptr_type()
|
|
||||||
assign = refptr_class+'CToCpp::Unwrap('+arg_name+'[i])'
|
|
||||||
elif arg_type == 'refptr_vec_diff_byref_const':
|
|
||||||
refptr_class = arg.get_type().get_refptr_type()
|
|
||||||
assign = refptr_class+'CppToC::Wrap('+arg_name+'[i])'
|
|
||||||
else:
|
|
||||||
assign = arg_name+'[i]'
|
assign = arg_name+'[i]'
|
||||||
|
else:
|
||||||
|
ptr_class = arg.get_type().get_ptr_type()
|
||||||
|
if arg_type == 'refptr_vec_same_byref_const':
|
||||||
|
assign = ptr_class+'CToCpp::Unwrap('+arg_name+'[i])'
|
||||||
|
elif arg_type == 'refptr_vec_diff_byref_const':
|
||||||
|
assign = ptr_class+'CppToC::Wrap('+arg_name+'[i])'
|
||||||
|
elif arg_type == 'rawptr_vec_same_byref_const':
|
||||||
|
assign = ptr_class+'CToCpp::UnwrapRaw('+arg_name+'[i])'
|
||||||
|
elif arg_type == 'rawptr_vec_diff_byref_const':
|
||||||
|
assign = ptr_class+'CppToC::WrapRaw('+arg_name+'[i]).release()->GetStruct()'
|
||||||
result += comment+\
|
result += comment+\
|
||||||
'\n const size_t '+arg_name+'Count = '+arg_name+'.size();'\
|
'\n const size_t '+arg_name+'Count = '+arg_name+'.size();'\
|
||||||
'\n '+vec_type+'* '+arg_name+'List = NULL;'\
|
'\n '+vec_type+'* '+arg_name+'List = NULL;'\
|
||||||
@ -276,6 +301,8 @@ def make_ctocpp_function_impl_new(clsname, name, func):
|
|||||||
'\n }'
|
'\n }'
|
||||||
params.append(arg_name+'Count')
|
params.append(arg_name+'Count')
|
||||||
params.append(arg_name+'List')
|
params.append(arg_name+'List')
|
||||||
|
else:
|
||||||
|
raise Exception('Unsupported argument type %s for parameter %s in %s' % (arg_type, arg_name, name))
|
||||||
|
|
||||||
if len(result) != result_len:
|
if len(result) != result_len:
|
||||||
result += '\n'
|
result += '\n'
|
||||||
@ -290,9 +317,12 @@ def make_ctocpp_function_impl_new(clsname, name, func):
|
|||||||
result += retval.get_type().get_result_simple_type_root()
|
result += retval.get_type().get_result_simple_type_root()
|
||||||
elif retval_type == 'string':
|
elif retval_type == 'string':
|
||||||
result += 'cef_string_userfree_t'
|
result += 'cef_string_userfree_t'
|
||||||
elif retval_type == 'refptr_same' or retval_type == 'refptr_diff':
|
elif retval_type == 'refptr_same' or retval_type == 'refptr_diff' or \
|
||||||
refptr_struct = retval.get_type().get_result_refptr_type_root()
|
retval_type == 'ownptr_same' or retval_type == 'ownptr_diff':
|
||||||
result += refptr_struct+'*'
|
ptr_struct = retval.get_type().get_result_ptr_type_root()
|
||||||
|
result += ptr_struct+'*'
|
||||||
|
else:
|
||||||
|
raise Exception('Unsupported return type %s in %s' % (retval_type, name))
|
||||||
|
|
||||||
result += ' _retval = '
|
result += ' _retval = '
|
||||||
|
|
||||||
@ -324,12 +354,12 @@ def make_ctocpp_function_impl_new(clsname, name, func):
|
|||||||
'\n if ('+arg_name+')'\
|
'\n if ('+arg_name+')'\
|
||||||
'\n *'+arg_name+' = '+arg_name+'Int?true:false;'
|
'\n *'+arg_name+' = '+arg_name+'Int?true:false;'
|
||||||
elif arg_type == 'refptr_same_byref' or arg_type == 'refptr_diff_byref':
|
elif arg_type == 'refptr_same_byref' or arg_type == 'refptr_diff_byref':
|
||||||
refptr_class = arg.get_type().get_refptr_type()
|
ptr_class = arg.get_type().get_ptr_type()
|
||||||
refptr_struct = arg.get_type().get_result_refptr_type_root()
|
ptr_struct = arg.get_type().get_result_ptr_type_root()
|
||||||
if arg_type == 'refptr_same_byref':
|
if arg_type == 'refptr_same_byref':
|
||||||
assign = refptr_class+'CToCpp::Wrap('+arg_name+'Struct)'
|
assign = ptr_class+'CToCpp::Wrap('+arg_name+'Struct)'
|
||||||
else:
|
else:
|
||||||
assign = refptr_class+'CppToC::Unwrap('+arg_name+'Struct)'
|
assign = ptr_class+'CppToC::Unwrap('+arg_name+'Struct)'
|
||||||
result += comment+\
|
result += comment+\
|
||||||
'\n if ('+arg_name+'Struct) {'\
|
'\n if ('+arg_name+'Struct) {'\
|
||||||
'\n if ('+arg_name+'Struct != '+arg_name+'Orig) {'\
|
'\n if ('+arg_name+'Struct != '+arg_name+'Orig) {'\
|
||||||
@ -376,11 +406,11 @@ def make_ctocpp_function_impl_new(clsname, name, func):
|
|||||||
count_func = arg.get_attrib_count_func()
|
count_func = arg.get_attrib_count_func()
|
||||||
vec_type = arg.get_type().get_result_vector_type_root()
|
vec_type = arg.get_type().get_result_vector_type_root()
|
||||||
if arg_type == 'refptr_vec_same_byref':
|
if arg_type == 'refptr_vec_same_byref':
|
||||||
refptr_class = arg.get_type().get_refptr_type()
|
ptr_class = arg.get_type().get_ptr_type()
|
||||||
assign = refptr_class+'CToCpp::Wrap('+arg_name+'List[i])'
|
assign = ptr_class+'CToCpp::Wrap('+arg_name+'List[i])'
|
||||||
elif arg_type == 'refptr_vec_diff_byref':
|
elif arg_type == 'refptr_vec_diff_byref':
|
||||||
refptr_class = arg.get_type().get_refptr_type()
|
ptr_class = arg.get_type().get_ptr_type()
|
||||||
assign = refptr_class+'CppToC::Unwrap('+arg_name+'List[i])'
|
assign = ptr_class+'CppToC::Unwrap('+arg_name+'List[i])'
|
||||||
elif arg_type == 'bool_vec_byref':
|
elif arg_type == 'bool_vec_byref':
|
||||||
assign = arg_name+'List[i]?true:false'
|
assign = arg_name+'List[i]?true:false'
|
||||||
else:
|
else:
|
||||||
@ -394,9 +424,16 @@ def make_ctocpp_function_impl_new(clsname, name, func):
|
|||||||
'\n delete [] '+arg_name+'List;'\
|
'\n delete [] '+arg_name+'List;'\
|
||||||
'\n }'
|
'\n }'
|
||||||
elif arg_type == 'simple_vec_byref_const' or arg_type == 'bool_vec_byref_const' or \
|
elif arg_type == 'simple_vec_byref_const' or arg_type == 'bool_vec_byref_const' or \
|
||||||
arg_type == 'refptr_vec_same_byref_const' or arg_type == 'refptr_vec_diff_byref_const':
|
arg_type == 'refptr_vec_same_byref_const' or arg_type == 'refptr_vec_diff_byref_const' or \
|
||||||
result += comment+\
|
arg_type == 'rawptr_vec_same_byref_const' or arg_type == 'rawptr_vec_diff_byref_const':
|
||||||
'\n if ('+arg_name+'List)'\
|
result += comment
|
||||||
|
if arg_type == 'rawptr_vec_diff_byref_const':
|
||||||
|
result += '\n if ('+arg_name+'Count > 0) {'\
|
||||||
|
'\n for (size_t i = 0; i < '+arg_name+'Count; ++i) {'\
|
||||||
|
'\n delete '+ptr_class+'CppToC::GetWrapper('+arg_name+'List[i]);'\
|
||||||
|
'\n }'\
|
||||||
|
'\n }'
|
||||||
|
result += '\n if ('+arg_name+'List)'\
|
||||||
'\n delete [] '+arg_name+'List;'
|
'\n delete [] '+arg_name+'List;'
|
||||||
|
|
||||||
if len(result) != result_len:
|
if len(result) != result_len:
|
||||||
@ -441,12 +478,17 @@ def make_ctocpp_function_impl_new(clsname, name, func):
|
|||||||
result += '\n CefString _retvalStr;'\
|
result += '\n CefString _retvalStr;'\
|
||||||
'\n _retvalStr.AttachToUserFree(_retval);'\
|
'\n _retvalStr.AttachToUserFree(_retval);'\
|
||||||
'\n return _retvalStr;'
|
'\n return _retvalStr;'
|
||||||
elif retval_type == 'refptr_same':
|
elif retval_type == 'refptr_same' or retval_type == 'ownptr_same':
|
||||||
refptr_class = retval.get_type().get_refptr_type()
|
ptr_class = retval.get_type().get_ptr_type()
|
||||||
result += '\n return '+refptr_class+'CToCpp::Wrap(_retval);'
|
result += '\n return '+ptr_class+'CToCpp::Wrap(_retval);'
|
||||||
elif retval_type == 'refptr_diff':
|
elif retval_type == 'refptr_diff':
|
||||||
refptr_class = retval.get_type().get_refptr_type()
|
ptr_class = retval.get_type().get_ptr_type()
|
||||||
result += '\n return '+refptr_class+'CppToC::Unwrap(_retval);'
|
result += '\n return '+ptr_class+'CppToC::Unwrap(_retval);'
|
||||||
|
elif retval_type == 'ownptr_diff':
|
||||||
|
ptr_class = retval.get_type().get_ptr_type()
|
||||||
|
result += '\n return '+ptr_class+'CppToC::UnwrapOwn(_retval);'
|
||||||
|
else:
|
||||||
|
raise Exception('Unsupported return type %s in %s' % (retval_type, name))
|
||||||
|
|
||||||
if len(result) != result_len:
|
if len(result) != result_len:
|
||||||
result += '\n'
|
result += '\n'
|
||||||
@ -475,7 +517,7 @@ def make_ctocpp_virtual_function_impl(header, cls, existing):
|
|||||||
cur_cls = cls
|
cur_cls = cls
|
||||||
while True:
|
while True:
|
||||||
parent_name = cur_cls.get_parent_name()
|
parent_name = cur_cls.get_parent_name()
|
||||||
if parent_name == 'CefBase':
|
if is_base_class(parent_name):
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
parent_cls = header.get_class(parent_name)
|
parent_cls = header.get_class(parent_name)
|
||||||
@ -486,7 +528,7 @@ def make_ctocpp_virtual_function_impl(header, cls, existing):
|
|||||||
|
|
||||||
return impl
|
return impl
|
||||||
|
|
||||||
def make_ctocpp_unwrap_derived(header, cls):
|
def make_ctocpp_unwrap_derived(header, cls, base_scoped):
|
||||||
# identify all classes that derive from cls
|
# identify all classes that derive from cls
|
||||||
derived_classes = []
|
derived_classes = []
|
||||||
clsname = cls.get_name()
|
clsname = cls.get_name()
|
||||||
@ -499,12 +541,24 @@ def make_ctocpp_unwrap_derived(header, cls):
|
|||||||
|
|
||||||
derived_classes = sorted(derived_classes)
|
derived_classes = sorted(derived_classes)
|
||||||
|
|
||||||
impl = ''
|
if base_scoped:
|
||||||
for clsname in derived_classes:
|
impl = ['', '']
|
||||||
impl += ' if (type == '+get_wrapper_type_enum(clsname)+') {\n'+\
|
for clsname in derived_classes:
|
||||||
' return reinterpret_cast<'+get_capi_name(cls.get_name(), True)+'*>('+\
|
impl[0] += ' if (type == '+get_wrapper_type_enum(clsname)+') {\n'+\
|
||||||
clsname+'CToCpp::Unwrap(reinterpret_cast<'+clsname+'*>(c)));\n'+\
|
' return reinterpret_cast<'+get_capi_name(cls.get_name(), True)+'*>('+\
|
||||||
' }\n'
|
clsname+'CToCpp::UnwrapOwn(CefOwnPtr<'+clsname+'>(reinterpret_cast<'+clsname+'*>(c.release()))));\n'+\
|
||||||
|
' }\n'
|
||||||
|
impl[1] += ' if (type == '+get_wrapper_type_enum(clsname)+') {\n'+\
|
||||||
|
' return reinterpret_cast<'+get_capi_name(cls.get_name(), True)+'*>('+\
|
||||||
|
clsname+'CToCpp::UnwrapRaw(CefRawPtr<'+clsname+'>(reinterpret_cast<'+clsname+'*>(c))));\n'+\
|
||||||
|
' }\n'
|
||||||
|
else:
|
||||||
|
impl = ''
|
||||||
|
for clsname in derived_classes:
|
||||||
|
impl += ' if (type == '+get_wrapper_type_enum(clsname)+') {\n'+\
|
||||||
|
' return reinterpret_cast<'+get_capi_name(cls.get_name(), True)+'*>('+\
|
||||||
|
clsname+'CToCpp::Unwrap(reinterpret_cast<'+clsname+'*>(c)));\n'+\
|
||||||
|
' }\n'
|
||||||
return impl
|
return impl
|
||||||
|
|
||||||
def make_ctocpp_class_impl(header, clsname, impl):
|
def make_ctocpp_class_impl(header, clsname, impl):
|
||||||
@ -517,6 +571,13 @@ def make_ctocpp_class_impl(header, clsname, impl):
|
|||||||
# retrieve the existing virtual function implementations
|
# retrieve the existing virtual function implementations
|
||||||
existing = get_function_impls(impl, clsname+'CToCpp::')
|
existing = get_function_impls(impl, clsname+'CToCpp::')
|
||||||
|
|
||||||
|
base_class_name = header.get_base_class_name(clsname)
|
||||||
|
base_scoped = True if base_class_name == 'CefBaseScoped' else False
|
||||||
|
if base_scoped:
|
||||||
|
template_class = 'CefCToCppScoped'
|
||||||
|
else:
|
||||||
|
template_class = 'CefCToCpp'
|
||||||
|
|
||||||
# generate virtual functions
|
# generate virtual functions
|
||||||
virtualimpl = make_ctocpp_virtual_function_impl(header, cls, existing)
|
virtualimpl = make_ctocpp_virtual_function_impl(header, cls, existing)
|
||||||
if len(virtualimpl) > 0:
|
if len(virtualimpl) > 0:
|
||||||
@ -533,28 +594,42 @@ def make_ctocpp_class_impl(header, clsname, impl):
|
|||||||
resultingimpl = staticimpl + virtualimpl
|
resultingimpl = staticimpl + virtualimpl
|
||||||
|
|
||||||
# any derived classes can be unwrapped
|
# any derived classes can be unwrapped
|
||||||
unwrapderived = make_ctocpp_unwrap_derived(header, cls)
|
unwrapderived = make_ctocpp_unwrap_derived(header, cls, base_scoped)
|
||||||
|
|
||||||
# determine what includes are required by identifying what translation
|
# determine what includes are required by identifying what translation
|
||||||
# classes are being used
|
# classes are being used
|
||||||
includes = format_translation_includes(header, resultingimpl + unwrapderived)
|
includes = format_translation_includes(header, resultingimpl + (unwrapderived[0] if base_scoped else unwrapderived))
|
||||||
|
|
||||||
# build the final output
|
# build the final output
|
||||||
result = get_copyright()
|
result = get_copyright()
|
||||||
|
|
||||||
result += includes+'\n'+resultingimpl+'\n'
|
result += includes+'\n'+resultingimpl+'\n'
|
||||||
|
|
||||||
parent_sig = 'CefCToCpp<'+clsname+'CToCpp, '+clsname+', '+capiname+'>'
|
parent_sig = template_class+'<'+clsname+'CToCpp, '+clsname+', '+capiname+'>'
|
||||||
|
|
||||||
const = '// CONSTRUCTOR - Do not edit by hand.\n\n'+ \
|
const = '// CONSTRUCTOR - Do not edit by hand.\n\n'+ \
|
||||||
clsname+'CToCpp::'+clsname+'CToCpp() {\n'+ \
|
clsname+'CToCpp::'+clsname+'CToCpp() {\n'+ \
|
||||||
'}\n\n'+ \
|
'}\n\n'
|
||||||
'template<> '+capiname+'* '+parent_sig+'::UnwrapDerived(CefWrapperType type, '+clsname+'* c) {\n'+ \
|
|
||||||
unwrapderived + \
|
if base_scoped:
|
||||||
' NOTREACHED() << "Unexpected class type: " << type;\n'+ \
|
const += 'template<> '+capiname+'* '+parent_sig+'::UnwrapDerivedOwn(CefWrapperType type, CefOwnPtr<'+clsname+'> c) {\n'+ \
|
||||||
' return NULL;\n'+ \
|
unwrapderived[0] + \
|
||||||
'}\n\n'+ \
|
' NOTREACHED() << "Unexpected class type: " << type;\n'+ \
|
||||||
'#if DCHECK_IS_ON()\n'+ \
|
' return NULL;\n'+ \
|
||||||
|
'}\n\n' + \
|
||||||
|
'template<> '+capiname+'* '+parent_sig+'::UnwrapDerivedRaw(CefWrapperType type, CefRawPtr<'+clsname+'> c) {\n'+ \
|
||||||
|
unwrapderived[1] + \
|
||||||
|
' NOTREACHED() << "Unexpected class type: " << type;\n'+ \
|
||||||
|
' return NULL;\n'+ \
|
||||||
|
'}\n\n'
|
||||||
|
else:
|
||||||
|
const += 'template<> '+capiname+'* '+parent_sig+'::UnwrapDerived(CefWrapperType type, '+clsname+'* c) {\n'+ \
|
||||||
|
unwrapderived + \
|
||||||
|
' NOTREACHED() << "Unexpected class type: " << type;\n'+ \
|
||||||
|
' return NULL;\n'+ \
|
||||||
|
'}\n\n'
|
||||||
|
|
||||||
|
const += '#if DCHECK_IS_ON()\n'+ \
|
||||||
'template<> base::AtomicRefCount '+parent_sig+'::DebugObjCt = 0;\n'+ \
|
'template<> base::AtomicRefCount '+parent_sig+'::DebugObjCt = 0;\n'+ \
|
||||||
'#endif\n\n'+ \
|
'#endif\n\n'+ \
|
||||||
'template<> CefWrapperType '+parent_sig+'::kWrapperType = '+get_wrapper_type_enum(clsname)+';'
|
'template<> CefWrapperType '+parent_sig+'::kWrapperType = '+get_wrapper_type_enum(clsname)+';'
|
||||||
|
Reference in New Issue
Block a user