1 // Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
2 // reserved. Use of this source code is governed by a BSD-style license that
3 // can be found in the LICENSE file.
4 //
5 // ---------------------------------------------------------------------------
6 //
7 // This file was generated by the CEF translator tool. If making changes by
8 // hand only do so within the body of existing method and function
9 // implementations. See the translator.README.txt file in the tools directory
10 // for more information.
11 //
12 // $hash=fd59a248f99060800fc3bab5c381784eb3309a57$
13 //
14
15 #include "libcef_dll/cpptoc/binary_value_cpptoc.h"
16 #include "libcef_dll/shutdown_checker.h"
17
18 // GLOBAL FUNCTIONS - Body may be edited by hand.
19
cef_binary_value_create(const void * data,size_t data_size)20 CEF_EXPORT cef_binary_value_t* cef_binary_value_create(const void* data,
21 size_t data_size) {
22 shutdown_checker::AssertNotShutdown();
23
24 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
25
26 // Verify param: data; type: simple_byaddr
27 DCHECK(data);
28 if (!data)
29 return NULL;
30
31 // Execute
32 CefRefPtr<CefBinaryValue> _retval = CefBinaryValue::Create(data, data_size);
33
34 // Return type: refptr_same
35 return CefBinaryValueCppToC::Wrap(_retval);
36 }
37
38 namespace {
39
40 // MEMBER FUNCTIONS - Body may be edited by hand.
41
binary_value_is_valid(struct _cef_binary_value_t * self)42 int CEF_CALLBACK binary_value_is_valid(struct _cef_binary_value_t* self) {
43 shutdown_checker::AssertNotShutdown();
44
45 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
46
47 DCHECK(self);
48 if (!self)
49 return 0;
50
51 // Execute
52 bool _retval = CefBinaryValueCppToC::Get(self)->IsValid();
53
54 // Return type: bool
55 return _retval;
56 }
57
binary_value_is_owned(struct _cef_binary_value_t * self)58 int CEF_CALLBACK binary_value_is_owned(struct _cef_binary_value_t* self) {
59 shutdown_checker::AssertNotShutdown();
60
61 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
62
63 DCHECK(self);
64 if (!self)
65 return 0;
66
67 // Execute
68 bool _retval = CefBinaryValueCppToC::Get(self)->IsOwned();
69
70 // Return type: bool
71 return _retval;
72 }
73
binary_value_is_same(struct _cef_binary_value_t * self,struct _cef_binary_value_t * that)74 int CEF_CALLBACK binary_value_is_same(struct _cef_binary_value_t* self,
75 struct _cef_binary_value_t* that) {
76 shutdown_checker::AssertNotShutdown();
77
78 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
79
80 DCHECK(self);
81 if (!self)
82 return 0;
83 // Verify param: that; type: refptr_same
84 DCHECK(that);
85 if (!that)
86 return 0;
87
88 // Execute
89 bool _retval = CefBinaryValueCppToC::Get(self)->IsSame(
90 CefBinaryValueCppToC::Unwrap(that));
91
92 // Return type: bool
93 return _retval;
94 }
95
binary_value_is_equal(struct _cef_binary_value_t * self,struct _cef_binary_value_t * that)96 int CEF_CALLBACK binary_value_is_equal(struct _cef_binary_value_t* self,
97 struct _cef_binary_value_t* that) {
98 shutdown_checker::AssertNotShutdown();
99
100 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
101
102 DCHECK(self);
103 if (!self)
104 return 0;
105 // Verify param: that; type: refptr_same
106 DCHECK(that);
107 if (!that)
108 return 0;
109
110 // Execute
111 bool _retval = CefBinaryValueCppToC::Get(self)->IsEqual(
112 CefBinaryValueCppToC::Unwrap(that));
113
114 // Return type: bool
115 return _retval;
116 }
117
118 struct _cef_binary_value_t* CEF_CALLBACK
binary_value_copy(struct _cef_binary_value_t * self)119 binary_value_copy(struct _cef_binary_value_t* self) {
120 shutdown_checker::AssertNotShutdown();
121
122 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
123
124 DCHECK(self);
125 if (!self)
126 return NULL;
127
128 // Execute
129 CefRefPtr<CefBinaryValue> _retval = CefBinaryValueCppToC::Get(self)->Copy();
130
131 // Return type: refptr_same
132 return CefBinaryValueCppToC::Wrap(_retval);
133 }
134
binary_value_get_size(struct _cef_binary_value_t * self)135 size_t CEF_CALLBACK binary_value_get_size(struct _cef_binary_value_t* self) {
136 shutdown_checker::AssertNotShutdown();
137
138 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
139
140 DCHECK(self);
141 if (!self)
142 return 0;
143
144 // Execute
145 size_t _retval = CefBinaryValueCppToC::Get(self)->GetSize();
146
147 // Return type: simple
148 return _retval;
149 }
150
binary_value_get_data(struct _cef_binary_value_t * self,void * buffer,size_t buffer_size,size_t data_offset)151 size_t CEF_CALLBACK binary_value_get_data(struct _cef_binary_value_t* self,
152 void* buffer,
153 size_t buffer_size,
154 size_t data_offset) {
155 shutdown_checker::AssertNotShutdown();
156
157 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
158
159 DCHECK(self);
160 if (!self)
161 return 0;
162 // Verify param: buffer; type: simple_byaddr
163 DCHECK(buffer);
164 if (!buffer)
165 return 0;
166
167 // Execute
168 size_t _retval = CefBinaryValueCppToC::Get(self)->GetData(buffer, buffer_size,
169 data_offset);
170
171 // Return type: simple
172 return _retval;
173 }
174
175 } // namespace
176
177 // CONSTRUCTOR - Do not edit by hand.
178
CefBinaryValueCppToC()179 CefBinaryValueCppToC::CefBinaryValueCppToC() {
180 GetStruct()->is_valid = binary_value_is_valid;
181 GetStruct()->is_owned = binary_value_is_owned;
182 GetStruct()->is_same = binary_value_is_same;
183 GetStruct()->is_equal = binary_value_is_equal;
184 GetStruct()->copy = binary_value_copy;
185 GetStruct()->get_size = binary_value_get_size;
186 GetStruct()->get_data = binary_value_get_data;
187 }
188
189 // DESTRUCTOR - Do not edit by hand.
190
~CefBinaryValueCppToC()191 CefBinaryValueCppToC::~CefBinaryValueCppToC() {
192 shutdown_checker::AssertNotShutdown();
193 }
194
195 template <>
196 CefRefPtr<CefBinaryValue>
197 CefCppToCRefCounted<CefBinaryValueCppToC, CefBinaryValue, cef_binary_value_t>::
UnwrapDerived(CefWrapperType type,cef_binary_value_t * s)198 UnwrapDerived(CefWrapperType type, cef_binary_value_t* s) {
199 NOTREACHED() << "Unexpected class type: " << type;
200 return nullptr;
201 }
202
203 template <>
204 CefWrapperType CefCppToCRefCounted<CefBinaryValueCppToC,
205 CefBinaryValue,
206 cef_binary_value_t>::kWrapperType =
207 WT_BINARY_VALUE;
208