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=d466cd3a17a35074eedcb222b9acd2063c297fe2$
13 //
14
15 #include "libcef_dll/ctocpp/v8interceptor_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 CefV8InterceptorCToCpp::Get(const CefString& name,
22 const CefRefPtr<CefV8Value> object,
23 CefRefPtr<CefV8Value>& retval,
24 CefString& exception) {
25 cef_v8interceptor_t* _struct = GetStruct();
26 if (CEF_MEMBER_MISSING(_struct, get_byname))
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 = _struct->get_byname(
48 _struct, name.GetStruct(), CefV8ValueCppToC::Wrap(object), &retvalStruct,
49 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")
Get(int index,const CefRefPtr<CefV8Value> object,CefRefPtr<CefV8Value> & retval,CefString & exception)65 bool CefV8InterceptorCToCpp::Get(int index,
66 const CefRefPtr<CefV8Value> object,
67 CefRefPtr<CefV8Value>& retval,
68 CefString& exception) {
69 cef_v8interceptor_t* _struct = GetStruct();
70 if (CEF_MEMBER_MISSING(_struct, get_byindex))
71 return false;
72
73 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
74
75 // Verify param: index; type: simple_byval
76 DCHECK_GE(index, 0);
77 if (index < 0)
78 return false;
79 // Verify param: object; type: refptr_diff
80 DCHECK(object.get());
81 if (!object.get())
82 return false;
83
84 // Translate param: retval; type: refptr_diff_byref
85 cef_v8value_t* retvalStruct = NULL;
86 if (retval.get())
87 retvalStruct = CefV8ValueCppToC::Wrap(retval);
88 cef_v8value_t* retvalOrig = retvalStruct;
89
90 // Execute
91 int _retval =
92 _struct->get_byindex(_struct, index, CefV8ValueCppToC::Wrap(object),
93 &retvalStruct, exception.GetWritableStruct());
94
95 // Restore param:retval; type: refptr_diff_byref
96 if (retvalStruct) {
97 if (retvalStruct != retvalOrig) {
98 retval = CefV8ValueCppToC::Unwrap(retvalStruct);
99 }
100 } else {
101 retval = nullptr;
102 }
103
104 // Return type: bool
105 return _retval ? true : false;
106 }
107
108 NO_SANITIZE("cfi-icall")
Set(const CefString & name,const CefRefPtr<CefV8Value> object,const CefRefPtr<CefV8Value> value,CefString & exception)109 bool CefV8InterceptorCToCpp::Set(const CefString& name,
110 const CefRefPtr<CefV8Value> object,
111 const CefRefPtr<CefV8Value> value,
112 CefString& exception) {
113 cef_v8interceptor_t* _struct = GetStruct();
114 if (CEF_MEMBER_MISSING(_struct, set_byname))
115 return false;
116
117 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
118
119 // Verify param: name; type: string_byref_const
120 DCHECK(!name.empty());
121 if (name.empty())
122 return false;
123 // Verify param: object; type: refptr_diff
124 DCHECK(object.get());
125 if (!object.get())
126 return false;
127 // Verify param: value; type: refptr_diff
128 DCHECK(value.get());
129 if (!value.get())
130 return false;
131
132 // Execute
133 int _retval = _struct->set_byname(
134 _struct, name.GetStruct(), CefV8ValueCppToC::Wrap(object),
135 CefV8ValueCppToC::Wrap(value), exception.GetWritableStruct());
136
137 // Return type: bool
138 return _retval ? true : false;
139 }
140
141 NO_SANITIZE("cfi-icall")
Set(int index,const CefRefPtr<CefV8Value> object,const CefRefPtr<CefV8Value> value,CefString & exception)142 bool CefV8InterceptorCToCpp::Set(int index,
143 const CefRefPtr<CefV8Value> object,
144 const CefRefPtr<CefV8Value> value,
145 CefString& exception) {
146 cef_v8interceptor_t* _struct = GetStruct();
147 if (CEF_MEMBER_MISSING(_struct, set_byindex))
148 return false;
149
150 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
151
152 // Verify param: index; type: simple_byval
153 DCHECK_GE(index, 0);
154 if (index < 0)
155 return false;
156 // Verify param: object; type: refptr_diff
157 DCHECK(object.get());
158 if (!object.get())
159 return false;
160 // Verify param: value; type: refptr_diff
161 DCHECK(value.get());
162 if (!value.get())
163 return false;
164
165 // Execute
166 int _retval = _struct->set_byindex(
167 _struct, index, CefV8ValueCppToC::Wrap(object),
168 CefV8ValueCppToC::Wrap(value), exception.GetWritableStruct());
169
170 // Return type: bool
171 return _retval ? true : false;
172 }
173
174 // CONSTRUCTOR - Do not edit by hand.
175
CefV8InterceptorCToCpp()176 CefV8InterceptorCToCpp::CefV8InterceptorCToCpp() {}
177
178 // DESTRUCTOR - Do not edit by hand.
179
~CefV8InterceptorCToCpp()180 CefV8InterceptorCToCpp::~CefV8InterceptorCToCpp() {}
181
182 template <>
183 cef_v8interceptor_t*
184 CefCToCppRefCounted<CefV8InterceptorCToCpp,
185 CefV8Interceptor,
UnwrapDerived(CefWrapperType type,CefV8Interceptor * c)186 cef_v8interceptor_t>::UnwrapDerived(CefWrapperType type,
187 CefV8Interceptor* c) {
188 NOTREACHED() << "Unexpected class type: " << type;
189 return nullptr;
190 }
191
192 template <>
193 CefWrapperType CefCToCppRefCounted<CefV8InterceptorCToCpp,
194 CefV8Interceptor,
195 cef_v8interceptor_t>::kWrapperType =
196 WT_V8INTERCEPTOR;
197