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=9f75af2c3d5e4411027b6f26bcc0d31728baed34$
13 //
14
15 #include "libcef_dll/ctocpp/value_ctocpp.h"
16 #include "libcef_dll/ctocpp/binary_value_ctocpp.h"
17 #include "libcef_dll/ctocpp/dictionary_value_ctocpp.h"
18 #include "libcef_dll/ctocpp/list_value_ctocpp.h"
19 #include "libcef_dll/shutdown_checker.h"
20
21 // STATIC METHODS - Body may be edited by hand.
22
Create()23 NO_SANITIZE("cfi-icall") CefRefPtr<CefValue> CefValue::Create() {
24 shutdown_checker::AssertNotShutdown();
25
26 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
27
28 // Execute
29 cef_value_t* _retval = cef_value_create();
30
31 // Return type: refptr_same
32 return CefValueCToCpp::Wrap(_retval);
33 }
34
35 // VIRTUAL METHODS - Body may be edited by hand.
36
IsValid()37 NO_SANITIZE("cfi-icall") bool CefValueCToCpp::IsValid() {
38 shutdown_checker::AssertNotShutdown();
39
40 cef_value_t* _struct = GetStruct();
41 if (CEF_MEMBER_MISSING(_struct, is_valid))
42 return false;
43
44 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
45
46 // Execute
47 int _retval = _struct->is_valid(_struct);
48
49 // Return type: bool
50 return _retval ? true : false;
51 }
52
IsOwned()53 NO_SANITIZE("cfi-icall") bool CefValueCToCpp::IsOwned() {
54 shutdown_checker::AssertNotShutdown();
55
56 cef_value_t* _struct = GetStruct();
57 if (CEF_MEMBER_MISSING(_struct, is_owned))
58 return false;
59
60 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
61
62 // Execute
63 int _retval = _struct->is_owned(_struct);
64
65 // Return type: bool
66 return _retval ? true : false;
67 }
68
IsReadOnly()69 NO_SANITIZE("cfi-icall") bool CefValueCToCpp::IsReadOnly() {
70 shutdown_checker::AssertNotShutdown();
71
72 cef_value_t* _struct = GetStruct();
73 if (CEF_MEMBER_MISSING(_struct, is_read_only))
74 return false;
75
76 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
77
78 // Execute
79 int _retval = _struct->is_read_only(_struct);
80
81 // Return type: bool
82 return _retval ? true : false;
83 }
84
IsSame(CefRefPtr<CefValue> that)85 NO_SANITIZE("cfi-icall") bool CefValueCToCpp::IsSame(CefRefPtr<CefValue> that) {
86 shutdown_checker::AssertNotShutdown();
87
88 cef_value_t* _struct = GetStruct();
89 if (CEF_MEMBER_MISSING(_struct, is_same))
90 return false;
91
92 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
93
94 // Verify param: that; type: refptr_same
95 DCHECK(that.get());
96 if (!that.get())
97 return false;
98
99 // Execute
100 int _retval = _struct->is_same(_struct, CefValueCToCpp::Unwrap(that));
101
102 // Return type: bool
103 return _retval ? true : false;
104 }
105
106 NO_SANITIZE("cfi-icall")
IsEqual(CefRefPtr<CefValue> that)107 bool CefValueCToCpp::IsEqual(CefRefPtr<CefValue> that) {
108 shutdown_checker::AssertNotShutdown();
109
110 cef_value_t* _struct = GetStruct();
111 if (CEF_MEMBER_MISSING(_struct, is_equal))
112 return false;
113
114 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
115
116 // Verify param: that; type: refptr_same
117 DCHECK(that.get());
118 if (!that.get())
119 return false;
120
121 // Execute
122 int _retval = _struct->is_equal(_struct, CefValueCToCpp::Unwrap(that));
123
124 // Return type: bool
125 return _retval ? true : false;
126 }
127
Copy()128 NO_SANITIZE("cfi-icall") CefRefPtr<CefValue> CefValueCToCpp::Copy() {
129 shutdown_checker::AssertNotShutdown();
130
131 cef_value_t* _struct = GetStruct();
132 if (CEF_MEMBER_MISSING(_struct, copy))
133 return nullptr;
134
135 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
136
137 // Execute
138 cef_value_t* _retval = _struct->copy(_struct);
139
140 // Return type: refptr_same
141 return CefValueCToCpp::Wrap(_retval);
142 }
143
GetType()144 NO_SANITIZE("cfi-icall") CefValueType CefValueCToCpp::GetType() {
145 shutdown_checker::AssertNotShutdown();
146
147 cef_value_t* _struct = GetStruct();
148 if (CEF_MEMBER_MISSING(_struct, get_type))
149 return VTYPE_INVALID;
150
151 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
152
153 // Execute
154 cef_value_type_t _retval = _struct->get_type(_struct);
155
156 // Return type: simple
157 return _retval;
158 }
159
GetBool()160 NO_SANITIZE("cfi-icall") bool CefValueCToCpp::GetBool() {
161 shutdown_checker::AssertNotShutdown();
162
163 cef_value_t* _struct = GetStruct();
164 if (CEF_MEMBER_MISSING(_struct, get_bool))
165 return false;
166
167 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
168
169 // Execute
170 int _retval = _struct->get_bool(_struct);
171
172 // Return type: bool
173 return _retval ? true : false;
174 }
175
GetInt()176 NO_SANITIZE("cfi-icall") int CefValueCToCpp::GetInt() {
177 shutdown_checker::AssertNotShutdown();
178
179 cef_value_t* _struct = GetStruct();
180 if (CEF_MEMBER_MISSING(_struct, get_int))
181 return 0;
182
183 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
184
185 // Execute
186 int _retval = _struct->get_int(_struct);
187
188 // Return type: simple
189 return _retval;
190 }
191
GetDouble()192 NO_SANITIZE("cfi-icall") double CefValueCToCpp::GetDouble() {
193 shutdown_checker::AssertNotShutdown();
194
195 cef_value_t* _struct = GetStruct();
196 if (CEF_MEMBER_MISSING(_struct, get_double))
197 return 0;
198
199 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
200
201 // Execute
202 double _retval = _struct->get_double(_struct);
203
204 // Return type: simple
205 return _retval;
206 }
207
GetString()208 NO_SANITIZE("cfi-icall") CefString CefValueCToCpp::GetString() {
209 shutdown_checker::AssertNotShutdown();
210
211 cef_value_t* _struct = GetStruct();
212 if (CEF_MEMBER_MISSING(_struct, get_string))
213 return CefString();
214
215 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
216
217 // Execute
218 cef_string_userfree_t _retval = _struct->get_string(_struct);
219
220 // Return type: string
221 CefString _retvalStr;
222 _retvalStr.AttachToUserFree(_retval);
223 return _retvalStr;
224 }
225
GetBinary()226 NO_SANITIZE("cfi-icall") CefRefPtr<CefBinaryValue> CefValueCToCpp::GetBinary() {
227 shutdown_checker::AssertNotShutdown();
228
229 cef_value_t* _struct = GetStruct();
230 if (CEF_MEMBER_MISSING(_struct, get_binary))
231 return nullptr;
232
233 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
234
235 // Execute
236 cef_binary_value_t* _retval = _struct->get_binary(_struct);
237
238 // Return type: refptr_same
239 return CefBinaryValueCToCpp::Wrap(_retval);
240 }
241
242 NO_SANITIZE("cfi-icall")
GetDictionary()243 CefRefPtr<CefDictionaryValue> CefValueCToCpp::GetDictionary() {
244 shutdown_checker::AssertNotShutdown();
245
246 cef_value_t* _struct = GetStruct();
247 if (CEF_MEMBER_MISSING(_struct, get_dictionary))
248 return nullptr;
249
250 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
251
252 // Execute
253 cef_dictionary_value_t* _retval = _struct->get_dictionary(_struct);
254
255 // Return type: refptr_same
256 return CefDictionaryValueCToCpp::Wrap(_retval);
257 }
258
GetList()259 NO_SANITIZE("cfi-icall") CefRefPtr<CefListValue> CefValueCToCpp::GetList() {
260 shutdown_checker::AssertNotShutdown();
261
262 cef_value_t* _struct = GetStruct();
263 if (CEF_MEMBER_MISSING(_struct, get_list))
264 return nullptr;
265
266 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
267
268 // Execute
269 cef_list_value_t* _retval = _struct->get_list(_struct);
270
271 // Return type: refptr_same
272 return CefListValueCToCpp::Wrap(_retval);
273 }
274
SetNull()275 NO_SANITIZE("cfi-icall") bool CefValueCToCpp::SetNull() {
276 shutdown_checker::AssertNotShutdown();
277
278 cef_value_t* _struct = GetStruct();
279 if (CEF_MEMBER_MISSING(_struct, set_null))
280 return false;
281
282 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
283
284 // Execute
285 int _retval = _struct->set_null(_struct);
286
287 // Return type: bool
288 return _retval ? true : false;
289 }
290
SetBool(bool value)291 NO_SANITIZE("cfi-icall") bool CefValueCToCpp::SetBool(bool value) {
292 shutdown_checker::AssertNotShutdown();
293
294 cef_value_t* _struct = GetStruct();
295 if (CEF_MEMBER_MISSING(_struct, set_bool))
296 return false;
297
298 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
299
300 // Execute
301 int _retval = _struct->set_bool(_struct, value);
302
303 // Return type: bool
304 return _retval ? true : false;
305 }
306
SetInt(int value)307 NO_SANITIZE("cfi-icall") bool CefValueCToCpp::SetInt(int value) {
308 shutdown_checker::AssertNotShutdown();
309
310 cef_value_t* _struct = GetStruct();
311 if (CEF_MEMBER_MISSING(_struct, set_int))
312 return false;
313
314 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
315
316 // Execute
317 int _retval = _struct->set_int(_struct, value);
318
319 // Return type: bool
320 return _retval ? true : false;
321 }
322
SetDouble(double value)323 NO_SANITIZE("cfi-icall") bool CefValueCToCpp::SetDouble(double value) {
324 shutdown_checker::AssertNotShutdown();
325
326 cef_value_t* _struct = GetStruct();
327 if (CEF_MEMBER_MISSING(_struct, set_double))
328 return false;
329
330 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
331
332 // Execute
333 int _retval = _struct->set_double(_struct, value);
334
335 // Return type: bool
336 return _retval ? true : false;
337 }
338
339 NO_SANITIZE("cfi-icall")
SetString(const CefString & value)340 bool CefValueCToCpp::SetString(const CefString& value) {
341 shutdown_checker::AssertNotShutdown();
342
343 cef_value_t* _struct = GetStruct();
344 if (CEF_MEMBER_MISSING(_struct, set_string))
345 return false;
346
347 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
348
349 // Unverified params: value
350
351 // Execute
352 int _retval = _struct->set_string(_struct, value.GetStruct());
353
354 // Return type: bool
355 return _retval ? true : false;
356 }
357
358 NO_SANITIZE("cfi-icall")
SetBinary(CefRefPtr<CefBinaryValue> value)359 bool CefValueCToCpp::SetBinary(CefRefPtr<CefBinaryValue> value) {
360 shutdown_checker::AssertNotShutdown();
361
362 cef_value_t* _struct = GetStruct();
363 if (CEF_MEMBER_MISSING(_struct, set_binary))
364 return false;
365
366 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
367
368 // Verify param: value; type: refptr_same
369 DCHECK(value.get());
370 if (!value.get())
371 return false;
372
373 // Execute
374 int _retval =
375 _struct->set_binary(_struct, CefBinaryValueCToCpp::Unwrap(value));
376
377 // Return type: bool
378 return _retval ? true : false;
379 }
380
381 NO_SANITIZE("cfi-icall")
SetDictionary(CefRefPtr<CefDictionaryValue> value)382 bool CefValueCToCpp::SetDictionary(CefRefPtr<CefDictionaryValue> value) {
383 shutdown_checker::AssertNotShutdown();
384
385 cef_value_t* _struct = GetStruct();
386 if (CEF_MEMBER_MISSING(_struct, set_dictionary))
387 return false;
388
389 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
390
391 // Verify param: value; type: refptr_same
392 DCHECK(value.get());
393 if (!value.get())
394 return false;
395
396 // Execute
397 int _retval =
398 _struct->set_dictionary(_struct, CefDictionaryValueCToCpp::Unwrap(value));
399
400 // Return type: bool
401 return _retval ? true : false;
402 }
403
404 NO_SANITIZE("cfi-icall")
SetList(CefRefPtr<CefListValue> value)405 bool CefValueCToCpp::SetList(CefRefPtr<CefListValue> value) {
406 shutdown_checker::AssertNotShutdown();
407
408 cef_value_t* _struct = GetStruct();
409 if (CEF_MEMBER_MISSING(_struct, set_list))
410 return false;
411
412 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
413
414 // Verify param: value; type: refptr_same
415 DCHECK(value.get());
416 if (!value.get())
417 return false;
418
419 // Execute
420 int _retval = _struct->set_list(_struct, CefListValueCToCpp::Unwrap(value));
421
422 // Return type: bool
423 return _retval ? true : false;
424 }
425
426 // CONSTRUCTOR - Do not edit by hand.
427
CefValueCToCpp()428 CefValueCToCpp::CefValueCToCpp() {}
429
430 // DESTRUCTOR - Do not edit by hand.
431
~CefValueCToCpp()432 CefValueCToCpp::~CefValueCToCpp() {
433 shutdown_checker::AssertNotShutdown();
434 }
435
436 template <>
437 cef_value_t*
UnwrapDerived(CefWrapperType type,CefValue * c)438 CefCToCppRefCounted<CefValueCToCpp, CefValue, cef_value_t>::UnwrapDerived(
439 CefWrapperType type,
440 CefValue* c) {
441 NOTREACHED() << "Unexpected class type: " << type;
442 return nullptr;
443 }
444
445 template <>
446 CefWrapperType
447 CefCToCppRefCounted<CefValueCToCpp, CefValue, cef_value_t>::kWrapperType =
448 WT_VALUE;
449