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=7863f5701d466f8d5a5c91962e14b14b500315a3$
13 //
14
15 #include "libcef_dll/ctocpp/v8value_ctocpp.h"
16 #include "libcef_dll/cpptoc/base_ref_counted_cpptoc.h"
17 #include "libcef_dll/cpptoc/v8accessor_cpptoc.h"
18 #include "libcef_dll/cpptoc/v8array_buffer_release_callback_cpptoc.h"
19 #include "libcef_dll/cpptoc/v8handler_cpptoc.h"
20 #include "libcef_dll/cpptoc/v8interceptor_cpptoc.h"
21 #include "libcef_dll/ctocpp/v8context_ctocpp.h"
22 #include "libcef_dll/ctocpp/v8exception_ctocpp.h"
23 #include "libcef_dll/transfer_util.h"
24
25 // STATIC METHODS - Body may be edited by hand.
26
CreateUndefined()27 NO_SANITIZE("cfi-icall") CefRefPtr<CefV8Value> CefV8Value::CreateUndefined() {
28 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
29
30 // Execute
31 cef_v8value_t* _retval = cef_v8value_create_undefined();
32
33 // Return type: refptr_same
34 return CefV8ValueCToCpp::Wrap(_retval);
35 }
36
CreateNull()37 NO_SANITIZE("cfi-icall") CefRefPtr<CefV8Value> CefV8Value::CreateNull() {
38 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
39
40 // Execute
41 cef_v8value_t* _retval = cef_v8value_create_null();
42
43 // Return type: refptr_same
44 return CefV8ValueCToCpp::Wrap(_retval);
45 }
46
47 NO_SANITIZE("cfi-icall")
CreateBool(bool value)48 CefRefPtr<CefV8Value> CefV8Value::CreateBool(bool value) {
49 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
50
51 // Execute
52 cef_v8value_t* _retval = cef_v8value_create_bool(value);
53
54 // Return type: refptr_same
55 return CefV8ValueCToCpp::Wrap(_retval);
56 }
57
58 NO_SANITIZE("cfi-icall")
CreateInt(int32 value)59 CefRefPtr<CefV8Value> CefV8Value::CreateInt(int32 value) {
60 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
61
62 // Execute
63 cef_v8value_t* _retval = cef_v8value_create_int(value);
64
65 // Return type: refptr_same
66 return CefV8ValueCToCpp::Wrap(_retval);
67 }
68
69 NO_SANITIZE("cfi-icall")
CreateUInt(uint32 value)70 CefRefPtr<CefV8Value> CefV8Value::CreateUInt(uint32 value) {
71 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
72
73 // Execute
74 cef_v8value_t* _retval = cef_v8value_create_uint(value);
75
76 // Return type: refptr_same
77 return CefV8ValueCToCpp::Wrap(_retval);
78 }
79
80 NO_SANITIZE("cfi-icall")
CreateDouble(double value)81 CefRefPtr<CefV8Value> CefV8Value::CreateDouble(double value) {
82 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
83
84 // Execute
85 cef_v8value_t* _retval = cef_v8value_create_double(value);
86
87 // Return type: refptr_same
88 return CefV8ValueCToCpp::Wrap(_retval);
89 }
90
91 NO_SANITIZE("cfi-icall")
CreateDate(const CefTime & date)92 CefRefPtr<CefV8Value> CefV8Value::CreateDate(const CefTime& date) {
93 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
94
95 // Execute
96 cef_v8value_t* _retval = cef_v8value_create_date(&date);
97
98 // Return type: refptr_same
99 return CefV8ValueCToCpp::Wrap(_retval);
100 }
101
102 NO_SANITIZE("cfi-icall")
CreateString(const CefString & value)103 CefRefPtr<CefV8Value> CefV8Value::CreateString(const CefString& value) {
104 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
105
106 // Unverified params: value
107
108 // Execute
109 cef_v8value_t* _retval = cef_v8value_create_string(value.GetStruct());
110
111 // Return type: refptr_same
112 return CefV8ValueCToCpp::Wrap(_retval);
113 }
114
115 NO_SANITIZE("cfi-icall")
CreateObject(CefRefPtr<CefV8Accessor> accessor,CefRefPtr<CefV8Interceptor> interceptor)116 CefRefPtr<CefV8Value> CefV8Value::CreateObject(
117 CefRefPtr<CefV8Accessor> accessor,
118 CefRefPtr<CefV8Interceptor> interceptor) {
119 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
120
121 // Unverified params: accessor, interceptor
122
123 // Execute
124 cef_v8value_t* _retval =
125 cef_v8value_create_object(CefV8AccessorCppToC::Wrap(accessor),
126 CefV8InterceptorCppToC::Wrap(interceptor));
127
128 // Return type: refptr_same
129 return CefV8ValueCToCpp::Wrap(_retval);
130 }
131
132 NO_SANITIZE("cfi-icall")
CreateArray(int length)133 CefRefPtr<CefV8Value> CefV8Value::CreateArray(int length) {
134 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
135
136 // Execute
137 cef_v8value_t* _retval = cef_v8value_create_array(length);
138
139 // Return type: refptr_same
140 return CefV8ValueCToCpp::Wrap(_retval);
141 }
142
143 NO_SANITIZE("cfi-icall")
CreateArrayBuffer(void * buffer,size_t length,CefRefPtr<CefV8ArrayBufferReleaseCallback> release_callback)144 CefRefPtr<CefV8Value> CefV8Value::CreateArrayBuffer(
145 void* buffer,
146 size_t length,
147 CefRefPtr<CefV8ArrayBufferReleaseCallback> release_callback) {
148 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
149
150 // Verify param: buffer; type: simple_byaddr
151 DCHECK(buffer);
152 if (!buffer)
153 return nullptr;
154 // Verify param: release_callback; type: refptr_diff
155 DCHECK(release_callback.get());
156 if (!release_callback.get())
157 return nullptr;
158
159 // Execute
160 cef_v8value_t* _retval = cef_v8value_create_array_buffer(
161 buffer, length,
162 CefV8ArrayBufferReleaseCallbackCppToC::Wrap(release_callback));
163
164 // Return type: refptr_same
165 return CefV8ValueCToCpp::Wrap(_retval);
166 }
167
168 NO_SANITIZE("cfi-icall")
CreateFunction(const CefString & name,CefRefPtr<CefV8Handler> handler)169 CefRefPtr<CefV8Value> CefV8Value::CreateFunction(
170 const CefString& name,
171 CefRefPtr<CefV8Handler> handler) {
172 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
173
174 // Verify param: name; type: string_byref_const
175 DCHECK(!name.empty());
176 if (name.empty())
177 return nullptr;
178 // Verify param: handler; type: refptr_diff
179 DCHECK(handler.get());
180 if (!handler.get())
181 return nullptr;
182
183 // Execute
184 cef_v8value_t* _retval = cef_v8value_create_function(
185 name.GetStruct(), CefV8HandlerCppToC::Wrap(handler));
186
187 // Return type: refptr_same
188 return CefV8ValueCToCpp::Wrap(_retval);
189 }
190
191 // VIRTUAL METHODS - Body may be edited by hand.
192
IsValid()193 NO_SANITIZE("cfi-icall") bool CefV8ValueCToCpp::IsValid() {
194 cef_v8value_t* _struct = GetStruct();
195 if (CEF_MEMBER_MISSING(_struct, is_valid))
196 return false;
197
198 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
199
200 // Execute
201 int _retval = _struct->is_valid(_struct);
202
203 // Return type: bool
204 return _retval ? true : false;
205 }
206
IsUndefined()207 NO_SANITIZE("cfi-icall") bool CefV8ValueCToCpp::IsUndefined() {
208 cef_v8value_t* _struct = GetStruct();
209 if (CEF_MEMBER_MISSING(_struct, is_undefined))
210 return false;
211
212 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
213
214 // Execute
215 int _retval = _struct->is_undefined(_struct);
216
217 // Return type: bool
218 return _retval ? true : false;
219 }
220
IsNull()221 NO_SANITIZE("cfi-icall") bool CefV8ValueCToCpp::IsNull() {
222 cef_v8value_t* _struct = GetStruct();
223 if (CEF_MEMBER_MISSING(_struct, is_null))
224 return false;
225
226 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
227
228 // Execute
229 int _retval = _struct->is_null(_struct);
230
231 // Return type: bool
232 return _retval ? true : false;
233 }
234
IsBool()235 NO_SANITIZE("cfi-icall") bool CefV8ValueCToCpp::IsBool() {
236 cef_v8value_t* _struct = GetStruct();
237 if (CEF_MEMBER_MISSING(_struct, is_bool))
238 return false;
239
240 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
241
242 // Execute
243 int _retval = _struct->is_bool(_struct);
244
245 // Return type: bool
246 return _retval ? true : false;
247 }
248
IsInt()249 NO_SANITIZE("cfi-icall") bool CefV8ValueCToCpp::IsInt() {
250 cef_v8value_t* _struct = GetStruct();
251 if (CEF_MEMBER_MISSING(_struct, is_int))
252 return false;
253
254 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
255
256 // Execute
257 int _retval = _struct->is_int(_struct);
258
259 // Return type: bool
260 return _retval ? true : false;
261 }
262
IsUInt()263 NO_SANITIZE("cfi-icall") bool CefV8ValueCToCpp::IsUInt() {
264 cef_v8value_t* _struct = GetStruct();
265 if (CEF_MEMBER_MISSING(_struct, is_uint))
266 return false;
267
268 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
269
270 // Execute
271 int _retval = _struct->is_uint(_struct);
272
273 // Return type: bool
274 return _retval ? true : false;
275 }
276
IsDouble()277 NO_SANITIZE("cfi-icall") bool CefV8ValueCToCpp::IsDouble() {
278 cef_v8value_t* _struct = GetStruct();
279 if (CEF_MEMBER_MISSING(_struct, is_double))
280 return false;
281
282 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
283
284 // Execute
285 int _retval = _struct->is_double(_struct);
286
287 // Return type: bool
288 return _retval ? true : false;
289 }
290
IsDate()291 NO_SANITIZE("cfi-icall") bool CefV8ValueCToCpp::IsDate() {
292 cef_v8value_t* _struct = GetStruct();
293 if (CEF_MEMBER_MISSING(_struct, is_date))
294 return false;
295
296 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
297
298 // Execute
299 int _retval = _struct->is_date(_struct);
300
301 // Return type: bool
302 return _retval ? true : false;
303 }
304
IsString()305 NO_SANITIZE("cfi-icall") bool CefV8ValueCToCpp::IsString() {
306 cef_v8value_t* _struct = GetStruct();
307 if (CEF_MEMBER_MISSING(_struct, is_string))
308 return false;
309
310 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
311
312 // Execute
313 int _retval = _struct->is_string(_struct);
314
315 // Return type: bool
316 return _retval ? true : false;
317 }
318
IsObject()319 NO_SANITIZE("cfi-icall") bool CefV8ValueCToCpp::IsObject() {
320 cef_v8value_t* _struct = GetStruct();
321 if (CEF_MEMBER_MISSING(_struct, is_object))
322 return false;
323
324 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
325
326 // Execute
327 int _retval = _struct->is_object(_struct);
328
329 // Return type: bool
330 return _retval ? true : false;
331 }
332
IsArray()333 NO_SANITIZE("cfi-icall") bool CefV8ValueCToCpp::IsArray() {
334 cef_v8value_t* _struct = GetStruct();
335 if (CEF_MEMBER_MISSING(_struct, is_array))
336 return false;
337
338 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
339
340 // Execute
341 int _retval = _struct->is_array(_struct);
342
343 // Return type: bool
344 return _retval ? true : false;
345 }
346
IsArrayBuffer()347 NO_SANITIZE("cfi-icall") bool CefV8ValueCToCpp::IsArrayBuffer() {
348 cef_v8value_t* _struct = GetStruct();
349 if (CEF_MEMBER_MISSING(_struct, is_array_buffer))
350 return false;
351
352 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
353
354 // Execute
355 int _retval = _struct->is_array_buffer(_struct);
356
357 // Return type: bool
358 return _retval ? true : false;
359 }
360
IsFunction()361 NO_SANITIZE("cfi-icall") bool CefV8ValueCToCpp::IsFunction() {
362 cef_v8value_t* _struct = GetStruct();
363 if (CEF_MEMBER_MISSING(_struct, is_function))
364 return false;
365
366 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
367
368 // Execute
369 int _retval = _struct->is_function(_struct);
370
371 // Return type: bool
372 return _retval ? true : false;
373 }
374
375 NO_SANITIZE("cfi-icall")
IsSame(CefRefPtr<CefV8Value> that)376 bool CefV8ValueCToCpp::IsSame(CefRefPtr<CefV8Value> that) {
377 cef_v8value_t* _struct = GetStruct();
378 if (CEF_MEMBER_MISSING(_struct, is_same))
379 return false;
380
381 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
382
383 // Verify param: that; type: refptr_same
384 DCHECK(that.get());
385 if (!that.get())
386 return false;
387
388 // Execute
389 int _retval = _struct->is_same(_struct, CefV8ValueCToCpp::Unwrap(that));
390
391 // Return type: bool
392 return _retval ? true : false;
393 }
394
GetBoolValue()395 NO_SANITIZE("cfi-icall") bool CefV8ValueCToCpp::GetBoolValue() {
396 cef_v8value_t* _struct = GetStruct();
397 if (CEF_MEMBER_MISSING(_struct, get_bool_value))
398 return false;
399
400 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
401
402 // Execute
403 int _retval = _struct->get_bool_value(_struct);
404
405 // Return type: bool
406 return _retval ? true : false;
407 }
408
GetIntValue()409 NO_SANITIZE("cfi-icall") int32 CefV8ValueCToCpp::GetIntValue() {
410 cef_v8value_t* _struct = GetStruct();
411 if (CEF_MEMBER_MISSING(_struct, get_int_value))
412 return 0;
413
414 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
415
416 // Execute
417 int32 _retval = _struct->get_int_value(_struct);
418
419 // Return type: simple
420 return _retval;
421 }
422
GetUIntValue()423 NO_SANITIZE("cfi-icall") uint32 CefV8ValueCToCpp::GetUIntValue() {
424 cef_v8value_t* _struct = GetStruct();
425 if (CEF_MEMBER_MISSING(_struct, get_uint_value))
426 return 0;
427
428 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
429
430 // Execute
431 uint32 _retval = _struct->get_uint_value(_struct);
432
433 // Return type: simple
434 return _retval;
435 }
436
GetDoubleValue()437 NO_SANITIZE("cfi-icall") double CefV8ValueCToCpp::GetDoubleValue() {
438 cef_v8value_t* _struct = GetStruct();
439 if (CEF_MEMBER_MISSING(_struct, get_double_value))
440 return 0;
441
442 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
443
444 // Execute
445 double _retval = _struct->get_double_value(_struct);
446
447 // Return type: simple
448 return _retval;
449 }
450
GetDateValue()451 NO_SANITIZE("cfi-icall") CefTime CefV8ValueCToCpp::GetDateValue() {
452 cef_v8value_t* _struct = GetStruct();
453 if (CEF_MEMBER_MISSING(_struct, get_date_value))
454 return CefTime();
455
456 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
457
458 // Execute
459 cef_time_t _retval = _struct->get_date_value(_struct);
460
461 // Return type: simple
462 return _retval;
463 }
464
GetStringValue()465 NO_SANITIZE("cfi-icall") CefString CefV8ValueCToCpp::GetStringValue() {
466 cef_v8value_t* _struct = GetStruct();
467 if (CEF_MEMBER_MISSING(_struct, get_string_value))
468 return CefString();
469
470 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
471
472 // Execute
473 cef_string_userfree_t _retval = _struct->get_string_value(_struct);
474
475 // Return type: string
476 CefString _retvalStr;
477 _retvalStr.AttachToUserFree(_retval);
478 return _retvalStr;
479 }
480
IsUserCreated()481 NO_SANITIZE("cfi-icall") bool CefV8ValueCToCpp::IsUserCreated() {
482 cef_v8value_t* _struct = GetStruct();
483 if (CEF_MEMBER_MISSING(_struct, is_user_created))
484 return false;
485
486 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
487
488 // Execute
489 int _retval = _struct->is_user_created(_struct);
490
491 // Return type: bool
492 return _retval ? true : false;
493 }
494
HasException()495 NO_SANITIZE("cfi-icall") bool CefV8ValueCToCpp::HasException() {
496 cef_v8value_t* _struct = GetStruct();
497 if (CEF_MEMBER_MISSING(_struct, has_exception))
498 return false;
499
500 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
501
502 // Execute
503 int _retval = _struct->has_exception(_struct);
504
505 // Return type: bool
506 return _retval ? true : false;
507 }
508
509 NO_SANITIZE("cfi-icall")
GetException()510 CefRefPtr<CefV8Exception> CefV8ValueCToCpp::GetException() {
511 cef_v8value_t* _struct = GetStruct();
512 if (CEF_MEMBER_MISSING(_struct, get_exception))
513 return nullptr;
514
515 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
516
517 // Execute
518 cef_v8exception_t* _retval = _struct->get_exception(_struct);
519
520 // Return type: refptr_same
521 return CefV8ExceptionCToCpp::Wrap(_retval);
522 }
523
ClearException()524 NO_SANITIZE("cfi-icall") bool CefV8ValueCToCpp::ClearException() {
525 cef_v8value_t* _struct = GetStruct();
526 if (CEF_MEMBER_MISSING(_struct, clear_exception))
527 return false;
528
529 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
530
531 // Execute
532 int _retval = _struct->clear_exception(_struct);
533
534 // Return type: bool
535 return _retval ? true : false;
536 }
537
WillRethrowExceptions()538 NO_SANITIZE("cfi-icall") bool CefV8ValueCToCpp::WillRethrowExceptions() {
539 cef_v8value_t* _struct = GetStruct();
540 if (CEF_MEMBER_MISSING(_struct, will_rethrow_exceptions))
541 return false;
542
543 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
544
545 // Execute
546 int _retval = _struct->will_rethrow_exceptions(_struct);
547
548 // Return type: bool
549 return _retval ? true : false;
550 }
551
552 NO_SANITIZE("cfi-icall")
SetRethrowExceptions(bool rethrow)553 bool CefV8ValueCToCpp::SetRethrowExceptions(bool rethrow) {
554 cef_v8value_t* _struct = GetStruct();
555 if (CEF_MEMBER_MISSING(_struct, set_rethrow_exceptions))
556 return false;
557
558 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
559
560 // Execute
561 int _retval = _struct->set_rethrow_exceptions(_struct, rethrow);
562
563 // Return type: bool
564 return _retval ? true : false;
565 }
566
HasValue(const CefString & key)567 NO_SANITIZE("cfi-icall") bool CefV8ValueCToCpp::HasValue(const CefString& key) {
568 cef_v8value_t* _struct = GetStruct();
569 if (CEF_MEMBER_MISSING(_struct, has_value_bykey))
570 return false;
571
572 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
573
574 // Unverified params: key
575
576 // Execute
577 int _retval = _struct->has_value_bykey(_struct, key.GetStruct());
578
579 // Return type: bool
580 return _retval ? true : false;
581 }
582
HasValue(int index)583 NO_SANITIZE("cfi-icall") bool CefV8ValueCToCpp::HasValue(int index) {
584 cef_v8value_t* _struct = GetStruct();
585 if (CEF_MEMBER_MISSING(_struct, has_value_byindex))
586 return false;
587
588 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
589
590 // Verify param: index; type: simple_byval
591 DCHECK_GE(index, 0);
592 if (index < 0)
593 return false;
594
595 // Execute
596 int _retval = _struct->has_value_byindex(_struct, index);
597
598 // Return type: bool
599 return _retval ? true : false;
600 }
601
602 NO_SANITIZE("cfi-icall")
DeleteValue(const CefString & key)603 bool CefV8ValueCToCpp::DeleteValue(const CefString& key) {
604 cef_v8value_t* _struct = GetStruct();
605 if (CEF_MEMBER_MISSING(_struct, delete_value_bykey))
606 return false;
607
608 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
609
610 // Unverified params: key
611
612 // Execute
613 int _retval = _struct->delete_value_bykey(_struct, key.GetStruct());
614
615 // Return type: bool
616 return _retval ? true : false;
617 }
618
DeleteValue(int index)619 NO_SANITIZE("cfi-icall") bool CefV8ValueCToCpp::DeleteValue(int index) {
620 cef_v8value_t* _struct = GetStruct();
621 if (CEF_MEMBER_MISSING(_struct, delete_value_byindex))
622 return false;
623
624 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
625
626 // Verify param: index; type: simple_byval
627 DCHECK_GE(index, 0);
628 if (index < 0)
629 return false;
630
631 // Execute
632 int _retval = _struct->delete_value_byindex(_struct, index);
633
634 // Return type: bool
635 return _retval ? true : false;
636 }
637
638 NO_SANITIZE("cfi-icall")
GetValue(const CefString & key)639 CefRefPtr<CefV8Value> CefV8ValueCToCpp::GetValue(const CefString& key) {
640 cef_v8value_t* _struct = GetStruct();
641 if (CEF_MEMBER_MISSING(_struct, get_value_bykey))
642 return nullptr;
643
644 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
645
646 // Unverified params: key
647
648 // Execute
649 cef_v8value_t* _retval = _struct->get_value_bykey(_struct, key.GetStruct());
650
651 // Return type: refptr_same
652 return CefV8ValueCToCpp::Wrap(_retval);
653 }
654
655 NO_SANITIZE("cfi-icall")
GetValue(int index)656 CefRefPtr<CefV8Value> CefV8ValueCToCpp::GetValue(int index) {
657 cef_v8value_t* _struct = GetStruct();
658 if (CEF_MEMBER_MISSING(_struct, get_value_byindex))
659 return nullptr;
660
661 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
662
663 // Verify param: index; type: simple_byval
664 DCHECK_GE(index, 0);
665 if (index < 0)
666 return nullptr;
667
668 // Execute
669 cef_v8value_t* _retval = _struct->get_value_byindex(_struct, index);
670
671 // Return type: refptr_same
672 return CefV8ValueCToCpp::Wrap(_retval);
673 }
674
675 NO_SANITIZE("cfi-icall")
SetValue(const CefString & key,CefRefPtr<CefV8Value> value,PropertyAttribute attribute)676 bool CefV8ValueCToCpp::SetValue(const CefString& key,
677 CefRefPtr<CefV8Value> value,
678 PropertyAttribute attribute) {
679 cef_v8value_t* _struct = GetStruct();
680 if (CEF_MEMBER_MISSING(_struct, set_value_bykey))
681 return false;
682
683 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
684
685 // Verify param: value; type: refptr_same
686 DCHECK(value.get());
687 if (!value.get())
688 return false;
689 // Unverified params: key
690
691 // Execute
692 int _retval = _struct->set_value_bykey(
693 _struct, key.GetStruct(), CefV8ValueCToCpp::Unwrap(value), attribute);
694
695 // Return type: bool
696 return _retval ? true : false;
697 }
698
699 NO_SANITIZE("cfi-icall")
SetValue(int index,CefRefPtr<CefV8Value> value)700 bool CefV8ValueCToCpp::SetValue(int index, CefRefPtr<CefV8Value> value) {
701 cef_v8value_t* _struct = GetStruct();
702 if (CEF_MEMBER_MISSING(_struct, set_value_byindex))
703 return false;
704
705 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
706
707 // Verify param: index; type: simple_byval
708 DCHECK_GE(index, 0);
709 if (index < 0)
710 return false;
711 // Verify param: value; type: refptr_same
712 DCHECK(value.get());
713 if (!value.get())
714 return false;
715
716 // Execute
717 int _retval = _struct->set_value_byindex(_struct, index,
718 CefV8ValueCToCpp::Unwrap(value));
719
720 // Return type: bool
721 return _retval ? true : false;
722 }
723
724 NO_SANITIZE("cfi-icall")
SetValue(const CefString & key,AccessControl settings,PropertyAttribute attribute)725 bool CefV8ValueCToCpp::SetValue(const CefString& key,
726 AccessControl settings,
727 PropertyAttribute attribute) {
728 cef_v8value_t* _struct = GetStruct();
729 if (CEF_MEMBER_MISSING(_struct, set_value_byaccessor))
730 return false;
731
732 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
733
734 // Unverified params: key
735
736 // Execute
737 int _retval = _struct->set_value_byaccessor(_struct, key.GetStruct(),
738 settings, attribute);
739
740 // Return type: bool
741 return _retval ? true : false;
742 }
743
744 NO_SANITIZE("cfi-icall")
GetKeys(std::vector<CefString> & keys)745 bool CefV8ValueCToCpp::GetKeys(std::vector<CefString>& keys) {
746 cef_v8value_t* _struct = GetStruct();
747 if (CEF_MEMBER_MISSING(_struct, get_keys))
748 return false;
749
750 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
751
752 // Translate param: keys; type: string_vec_byref
753 cef_string_list_t keysList = cef_string_list_alloc();
754 DCHECK(keysList);
755 if (keysList)
756 transfer_string_list_contents(keys, keysList);
757
758 // Execute
759 int _retval = _struct->get_keys(_struct, keysList);
760
761 // Restore param:keys; type: string_vec_byref
762 if (keysList) {
763 keys.clear();
764 transfer_string_list_contents(keysList, keys);
765 cef_string_list_free(keysList);
766 }
767
768 // Return type: bool
769 return _retval ? true : false;
770 }
771
772 NO_SANITIZE("cfi-icall")
SetUserData(CefRefPtr<CefBaseRefCounted> user_data)773 bool CefV8ValueCToCpp::SetUserData(CefRefPtr<CefBaseRefCounted> user_data) {
774 cef_v8value_t* _struct = GetStruct();
775 if (CEF_MEMBER_MISSING(_struct, set_user_data))
776 return false;
777
778 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
779
780 // Unverified params: user_data
781
782 // Execute
783 int _retval =
784 _struct->set_user_data(_struct, CefBaseRefCountedCppToC::Wrap(user_data));
785
786 // Return type: bool
787 return _retval ? true : false;
788 }
789
790 NO_SANITIZE("cfi-icall")
GetUserData()791 CefRefPtr<CefBaseRefCounted> CefV8ValueCToCpp::GetUserData() {
792 cef_v8value_t* _struct = GetStruct();
793 if (CEF_MEMBER_MISSING(_struct, get_user_data))
794 return nullptr;
795
796 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
797
798 // Execute
799 cef_base_ref_counted_t* _retval = _struct->get_user_data(_struct);
800
801 // Return type: refptr_diff
802 return CefBaseRefCountedCppToC::Unwrap(_retval);
803 }
804
GetExternallyAllocatedMemory()805 NO_SANITIZE("cfi-icall") int CefV8ValueCToCpp::GetExternallyAllocatedMemory() {
806 cef_v8value_t* _struct = GetStruct();
807 if (CEF_MEMBER_MISSING(_struct, get_externally_allocated_memory))
808 return 0;
809
810 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
811
812 // Execute
813 int _retval = _struct->get_externally_allocated_memory(_struct);
814
815 // Return type: simple
816 return _retval;
817 }
818
819 NO_SANITIZE("cfi-icall")
AdjustExternallyAllocatedMemory(int change_in_bytes)820 int CefV8ValueCToCpp::AdjustExternallyAllocatedMemory(int change_in_bytes) {
821 cef_v8value_t* _struct = GetStruct();
822 if (CEF_MEMBER_MISSING(_struct, adjust_externally_allocated_memory))
823 return 0;
824
825 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
826
827 // Execute
828 int _retval =
829 _struct->adjust_externally_allocated_memory(_struct, change_in_bytes);
830
831 // Return type: simple
832 return _retval;
833 }
834
GetArrayLength()835 NO_SANITIZE("cfi-icall") int CefV8ValueCToCpp::GetArrayLength() {
836 cef_v8value_t* _struct = GetStruct();
837 if (CEF_MEMBER_MISSING(_struct, get_array_length))
838 return 0;
839
840 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
841
842 // Execute
843 int _retval = _struct->get_array_length(_struct);
844
845 // Return type: simple
846 return _retval;
847 }
848
849 NO_SANITIZE("cfi-icall")
850 CefRefPtr<CefV8ArrayBufferReleaseCallback>
GetArrayBufferReleaseCallback()851 CefV8ValueCToCpp::GetArrayBufferReleaseCallback() {
852 cef_v8value_t* _struct = GetStruct();
853 if (CEF_MEMBER_MISSING(_struct, get_array_buffer_release_callback))
854 return nullptr;
855
856 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
857
858 // Execute
859 cef_v8array_buffer_release_callback_t* _retval =
860 _struct->get_array_buffer_release_callback(_struct);
861
862 // Return type: refptr_diff
863 return CefV8ArrayBufferReleaseCallbackCppToC::Unwrap(_retval);
864 }
865
NeuterArrayBuffer()866 NO_SANITIZE("cfi-icall") bool CefV8ValueCToCpp::NeuterArrayBuffer() {
867 cef_v8value_t* _struct = GetStruct();
868 if (CEF_MEMBER_MISSING(_struct, neuter_array_buffer))
869 return false;
870
871 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
872
873 // Execute
874 int _retval = _struct->neuter_array_buffer(_struct);
875
876 // Return type: bool
877 return _retval ? true : false;
878 }
879
GetFunctionName()880 NO_SANITIZE("cfi-icall") CefString CefV8ValueCToCpp::GetFunctionName() {
881 cef_v8value_t* _struct = GetStruct();
882 if (CEF_MEMBER_MISSING(_struct, get_function_name))
883 return CefString();
884
885 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
886
887 // Execute
888 cef_string_userfree_t _retval = _struct->get_function_name(_struct);
889
890 // Return type: string
891 CefString _retvalStr;
892 _retvalStr.AttachToUserFree(_retval);
893 return _retvalStr;
894 }
895
896 NO_SANITIZE("cfi-icall")
GetFunctionHandler()897 CefRefPtr<CefV8Handler> CefV8ValueCToCpp::GetFunctionHandler() {
898 cef_v8value_t* _struct = GetStruct();
899 if (CEF_MEMBER_MISSING(_struct, get_function_handler))
900 return nullptr;
901
902 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
903
904 // Execute
905 cef_v8handler_t* _retval = _struct->get_function_handler(_struct);
906
907 // Return type: refptr_diff
908 return CefV8HandlerCppToC::Unwrap(_retval);
909 }
910
911 NO_SANITIZE("cfi-icall")
ExecuteFunction(CefRefPtr<CefV8Value> object,const CefV8ValueList & arguments)912 CefRefPtr<CefV8Value> CefV8ValueCToCpp::ExecuteFunction(
913 CefRefPtr<CefV8Value> object,
914 const CefV8ValueList& arguments) {
915 cef_v8value_t* _struct = GetStruct();
916 if (CEF_MEMBER_MISSING(_struct, execute_function))
917 return nullptr;
918
919 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
920
921 // Unverified params: object
922
923 // Translate param: arguments; type: refptr_vec_same_byref_const
924 const size_t argumentsCount = arguments.size();
925 cef_v8value_t** argumentsList = NULL;
926 if (argumentsCount > 0) {
927 argumentsList = new cef_v8value_t*[argumentsCount];
928 DCHECK(argumentsList);
929 if (argumentsList) {
930 for (size_t i = 0; i < argumentsCount; ++i) {
931 argumentsList[i] = CefV8ValueCToCpp::Unwrap(arguments[i]);
932 }
933 }
934 }
935
936 // Execute
937 cef_v8value_t* _retval = _struct->execute_function(
938 _struct, CefV8ValueCToCpp::Unwrap(object), argumentsCount, argumentsList);
939
940 // Restore param:arguments; type: refptr_vec_same_byref_const
941 if (argumentsList)
942 delete[] argumentsList;
943
944 // Return type: refptr_same
945 return CefV8ValueCToCpp::Wrap(_retval);
946 }
947
948 NO_SANITIZE("cfi-icall")
ExecuteFunctionWithContext(CefRefPtr<CefV8Context> context,CefRefPtr<CefV8Value> object,const CefV8ValueList & arguments)949 CefRefPtr<CefV8Value> CefV8ValueCToCpp::ExecuteFunctionWithContext(
950 CefRefPtr<CefV8Context> context,
951 CefRefPtr<CefV8Value> object,
952 const CefV8ValueList& arguments) {
953 cef_v8value_t* _struct = GetStruct();
954 if (CEF_MEMBER_MISSING(_struct, execute_function_with_context))
955 return nullptr;
956
957 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
958
959 // Verify param: context; type: refptr_same
960 DCHECK(context.get());
961 if (!context.get())
962 return nullptr;
963 // Unverified params: object
964
965 // Translate param: arguments; type: refptr_vec_same_byref_const
966 const size_t argumentsCount = arguments.size();
967 cef_v8value_t** argumentsList = NULL;
968 if (argumentsCount > 0) {
969 argumentsList = new cef_v8value_t*[argumentsCount];
970 DCHECK(argumentsList);
971 if (argumentsList) {
972 for (size_t i = 0; i < argumentsCount; ++i) {
973 argumentsList[i] = CefV8ValueCToCpp::Unwrap(arguments[i]);
974 }
975 }
976 }
977
978 // Execute
979 cef_v8value_t* _retval = _struct->execute_function_with_context(
980 _struct, CefV8ContextCToCpp::Unwrap(context),
981 CefV8ValueCToCpp::Unwrap(object), argumentsCount, argumentsList);
982
983 // Restore param:arguments; type: refptr_vec_same_byref_const
984 if (argumentsList)
985 delete[] argumentsList;
986
987 // Return type: refptr_same
988 return CefV8ValueCToCpp::Wrap(_retval);
989 }
990
991 // CONSTRUCTOR - Do not edit by hand.
992
CefV8ValueCToCpp()993 CefV8ValueCToCpp::CefV8ValueCToCpp() {}
994
995 // DESTRUCTOR - Do not edit by hand.
996
~CefV8ValueCToCpp()997 CefV8ValueCToCpp::~CefV8ValueCToCpp() {}
998
999 template <>
1000 cef_v8value_t*
UnwrapDerived(CefWrapperType type,CefV8Value * c)1001 CefCToCppRefCounted<CefV8ValueCToCpp, CefV8Value, cef_v8value_t>::UnwrapDerived(
1002 CefWrapperType type,
1003 CefV8Value* c) {
1004 NOTREACHED() << "Unexpected class type: " << type;
1005 return nullptr;
1006 }
1007
1008 template <>
1009 CefWrapperType CefCToCppRefCounted<CefV8ValueCToCpp,
1010 CefV8Value,
1011 cef_v8value_t>::kWrapperType = WT_V8VALUE;
1012