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=c2815712e9960e6850bb646ba0009fe42e8a2624$
13 //
14
15 #include "libcef_dll/ctocpp/v8accessor_ctocpp.h"
16 #include "libcef_dll/cpptoc/v8value_cpptoc.h"
17
18 // VIRTUAL METHODS - Body may be edited by hand.
19
20 NO_SANITIZE("cfi-icall")
Get(const CefString & name,const CefRefPtr<CefV8Value> object,CefRefPtr<CefV8Value> & retval,CefString & exception)21 bool CefV8AccessorCToCpp::Get(const CefString& name,
22 const CefRefPtr<CefV8Value> object,
23 CefRefPtr<CefV8Value>& retval,
24 CefString& exception) {
25 cef_v8accessor_t* _struct = GetStruct();
26 if (CEF_MEMBER_MISSING(_struct, get))
27 return false;
28
29 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
30
31 // Verify param: name; type: string_byref_const
32 DCHECK(!name.empty());
33 if (name.empty())
34 return false;
35 // Verify param: object; type: refptr_diff
36 DCHECK(object.get());
37 if (!object.get())
38 return false;
39
40 // Translate param: retval; type: refptr_diff_byref
41 cef_v8value_t* retvalStruct = NULL;
42 if (retval.get())
43 retvalStruct = CefV8ValueCppToC::Wrap(retval);
44 cef_v8value_t* retvalOrig = retvalStruct;
45
46 // Execute
47 int _retval =
48 _struct->get(_struct, name.GetStruct(), CefV8ValueCppToC::Wrap(object),
49 &retvalStruct, exception.GetWritableStruct());
50
51 // Restore param:retval; type: refptr_diff_byref
52 if (retvalStruct) {
53 if (retvalStruct != retvalOrig) {
54 retval = CefV8ValueCppToC::Unwrap(retvalStruct);
55 }
56 } else {
57 retval = nullptr;
58 }
59
60 // Return type: bool
61 return _retval ? true : false;
62 }
63
64 NO_SANITIZE("cfi-icall")
Set(const CefString & name,const CefRefPtr<CefV8Value> object,const CefRefPtr<CefV8Value> value,CefString & exception)65 bool CefV8AccessorCToCpp::Set(const CefString& name,
66 const CefRefPtr<CefV8Value> object,
67 const CefRefPtr<CefV8Value> value,
68 CefString& exception) {
69 cef_v8accessor_t* _struct = GetStruct();
70 if (CEF_MEMBER_MISSING(_struct, set))
71 return false;
72
73 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
74
75 // Verify param: name; type: string_byref_const
76 DCHECK(!name.empty());
77 if (name.empty())
78 return false;
79 // Verify param: object; type: refptr_diff
80 DCHECK(object.get());
81 if (!object.get())
82 return false;
83 // Verify param: value; type: refptr_diff
84 DCHECK(value.get());
85 if (!value.get())
86 return false;
87
88 // Execute
89 int _retval = _struct->set(
90 _struct, name.GetStruct(), CefV8ValueCppToC::Wrap(object),
91 CefV8ValueCppToC::Wrap(value), exception.GetWritableStruct());
92
93 // Return type: bool
94 return _retval ? true : false;
95 }
96
97 // CONSTRUCTOR - Do not edit by hand.
98
CefV8AccessorCToCpp()99 CefV8AccessorCToCpp::CefV8AccessorCToCpp() {}
100
101 // DESTRUCTOR - Do not edit by hand.
102
~CefV8AccessorCToCpp()103 CefV8AccessorCToCpp::~CefV8AccessorCToCpp() {}
104
105 template <>
106 cef_v8accessor_t*
107 CefCToCppRefCounted<CefV8AccessorCToCpp, CefV8Accessor, cef_v8accessor_t>::
UnwrapDerived(CefWrapperType type,CefV8Accessor * c)108 UnwrapDerived(CefWrapperType type, CefV8Accessor* c) {
109 NOTREACHED() << "Unexpected class type: " << type;
110 return nullptr;
111 }
112
113 template <>
114 CefWrapperType CefCToCppRefCounted<CefV8AccessorCToCpp,
115 CefV8Accessor,
116 cef_v8accessor_t>::kWrapperType =
117 WT_V8ACCESSOR;
118