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=80a91b8a85dc537cb49cbd5eaea974f92fbf9cde$
13 //
14
15 #include "libcef_dll/ctocpp/binary_value_ctocpp.h"
16 #include "libcef_dll/shutdown_checker.h"
17
18 // STATIC METHODS - Body may be edited by hand.
19
20 NO_SANITIZE("cfi-icall")
Create(const void * data,size_t data_size)21 CefRefPtr<CefBinaryValue> CefBinaryValue::Create(const void* data,
22 size_t data_size) {
23 shutdown_checker::AssertNotShutdown();
24
25 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
26
27 // Verify param: data; type: simple_byaddr
28 DCHECK(data);
29 if (!data)
30 return nullptr;
31
32 // Execute
33 cef_binary_value_t* _retval = cef_binary_value_create(data, data_size);
34
35 // Return type: refptr_same
36 return CefBinaryValueCToCpp::Wrap(_retval);
37 }
38
39 // VIRTUAL METHODS - Body may be edited by hand.
40
IsValid()41 NO_SANITIZE("cfi-icall") bool CefBinaryValueCToCpp::IsValid() {
42 shutdown_checker::AssertNotShutdown();
43
44 cef_binary_value_t* _struct = GetStruct();
45 if (CEF_MEMBER_MISSING(_struct, is_valid))
46 return false;
47
48 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
49
50 // Execute
51 int _retval = _struct->is_valid(_struct);
52
53 // Return type: bool
54 return _retval ? true : false;
55 }
56
IsOwned()57 NO_SANITIZE("cfi-icall") bool CefBinaryValueCToCpp::IsOwned() {
58 shutdown_checker::AssertNotShutdown();
59
60 cef_binary_value_t* _struct = GetStruct();
61 if (CEF_MEMBER_MISSING(_struct, is_owned))
62 return false;
63
64 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
65
66 // Execute
67 int _retval = _struct->is_owned(_struct);
68
69 // Return type: bool
70 return _retval ? true : false;
71 }
72
73 NO_SANITIZE("cfi-icall")
IsSame(CefRefPtr<CefBinaryValue> that)74 bool CefBinaryValueCToCpp::IsSame(CefRefPtr<CefBinaryValue> that) {
75 shutdown_checker::AssertNotShutdown();
76
77 cef_binary_value_t* _struct = GetStruct();
78 if (CEF_MEMBER_MISSING(_struct, is_same))
79 return false;
80
81 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
82
83 // Verify param: that; type: refptr_same
84 DCHECK(that.get());
85 if (!that.get())
86 return false;
87
88 // Execute
89 int _retval = _struct->is_same(_struct, CefBinaryValueCToCpp::Unwrap(that));
90
91 // Return type: bool
92 return _retval ? true : false;
93 }
94
95 NO_SANITIZE("cfi-icall")
IsEqual(CefRefPtr<CefBinaryValue> that)96 bool CefBinaryValueCToCpp::IsEqual(CefRefPtr<CefBinaryValue> that) {
97 shutdown_checker::AssertNotShutdown();
98
99 cef_binary_value_t* _struct = GetStruct();
100 if (CEF_MEMBER_MISSING(_struct, is_equal))
101 return false;
102
103 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
104
105 // Verify param: that; type: refptr_same
106 DCHECK(that.get());
107 if (!that.get())
108 return false;
109
110 // Execute
111 int _retval = _struct->is_equal(_struct, CefBinaryValueCToCpp::Unwrap(that));
112
113 // Return type: bool
114 return _retval ? true : false;
115 }
116
117 NO_SANITIZE("cfi-icall")
Copy()118 CefRefPtr<CefBinaryValue> CefBinaryValueCToCpp::Copy() {
119 shutdown_checker::AssertNotShutdown();
120
121 cef_binary_value_t* _struct = GetStruct();
122 if (CEF_MEMBER_MISSING(_struct, copy))
123 return nullptr;
124
125 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
126
127 // Execute
128 cef_binary_value_t* _retval = _struct->copy(_struct);
129
130 // Return type: refptr_same
131 return CefBinaryValueCToCpp::Wrap(_retval);
132 }
133
GetSize()134 NO_SANITIZE("cfi-icall") size_t CefBinaryValueCToCpp::GetSize() {
135 shutdown_checker::AssertNotShutdown();
136
137 cef_binary_value_t* _struct = GetStruct();
138 if (CEF_MEMBER_MISSING(_struct, get_size))
139 return 0;
140
141 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
142
143 // Execute
144 size_t _retval = _struct->get_size(_struct);
145
146 // Return type: simple
147 return _retval;
148 }
149
150 NO_SANITIZE("cfi-icall")
GetData(void * buffer,size_t buffer_size,size_t data_offset)151 size_t CefBinaryValueCToCpp::GetData(void* buffer,
152 size_t buffer_size,
153 size_t data_offset) {
154 shutdown_checker::AssertNotShutdown();
155
156 cef_binary_value_t* _struct = GetStruct();
157 if (CEF_MEMBER_MISSING(_struct, get_data))
158 return 0;
159
160 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
161
162 // Verify param: buffer; type: simple_byaddr
163 DCHECK(buffer);
164 if (!buffer)
165 return 0;
166
167 // Execute
168 size_t _retval = _struct->get_data(_struct, buffer, buffer_size, data_offset);
169
170 // Return type: simple
171 return _retval;
172 }
173
174 // CONSTRUCTOR - Do not edit by hand.
175
CefBinaryValueCToCpp()176 CefBinaryValueCToCpp::CefBinaryValueCToCpp() {}
177
178 // DESTRUCTOR - Do not edit by hand.
179
~CefBinaryValueCToCpp()180 CefBinaryValueCToCpp::~CefBinaryValueCToCpp() {
181 shutdown_checker::AssertNotShutdown();
182 }
183
184 template <>
185 cef_binary_value_t*
186 CefCToCppRefCounted<CefBinaryValueCToCpp, CefBinaryValue, cef_binary_value_t>::
UnwrapDerived(CefWrapperType type,CefBinaryValue * c)187 UnwrapDerived(CefWrapperType type, CefBinaryValue* c) {
188 NOTREACHED() << "Unexpected class type: " << type;
189 return nullptr;
190 }
191
192 template <>
193 CefWrapperType CefCToCppRefCounted<CefBinaryValueCToCpp,
194 CefBinaryValue,
195 cef_binary_value_t>::kWrapperType =
196 WT_BINARY_VALUE;
197