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