• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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=05c6527a7cdeb9495bca9da965956fb3006a7bdd$
13 //
14 
15 #include "libcef_dll/ctocpp/download_item_ctocpp.h"
16 #include "libcef_dll/shutdown_checker.h"
17 
18 // VIRTUAL METHODS - Body may be edited by hand.
19 
IsValid()20 NO_SANITIZE("cfi-icall") bool CefDownloadItemCToCpp::IsValid() {
21   shutdown_checker::AssertNotShutdown();
22 
23   cef_download_item_t* _struct = GetStruct();
24   if (CEF_MEMBER_MISSING(_struct, is_valid))
25     return false;
26 
27   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
28 
29   // Execute
30   int _retval = _struct->is_valid(_struct);
31 
32   // Return type: bool
33   return _retval ? true : false;
34 }
35 
IsInProgress()36 NO_SANITIZE("cfi-icall") bool CefDownloadItemCToCpp::IsInProgress() {
37   shutdown_checker::AssertNotShutdown();
38 
39   cef_download_item_t* _struct = GetStruct();
40   if (CEF_MEMBER_MISSING(_struct, is_in_progress))
41     return false;
42 
43   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
44 
45   // Execute
46   int _retval = _struct->is_in_progress(_struct);
47 
48   // Return type: bool
49   return _retval ? true : false;
50 }
51 
IsComplete()52 NO_SANITIZE("cfi-icall") bool CefDownloadItemCToCpp::IsComplete() {
53   shutdown_checker::AssertNotShutdown();
54 
55   cef_download_item_t* _struct = GetStruct();
56   if (CEF_MEMBER_MISSING(_struct, is_complete))
57     return false;
58 
59   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
60 
61   // Execute
62   int _retval = _struct->is_complete(_struct);
63 
64   // Return type: bool
65   return _retval ? true : false;
66 }
67 
IsCanceled()68 NO_SANITIZE("cfi-icall") bool CefDownloadItemCToCpp::IsCanceled() {
69   shutdown_checker::AssertNotShutdown();
70 
71   cef_download_item_t* _struct = GetStruct();
72   if (CEF_MEMBER_MISSING(_struct, is_canceled))
73     return false;
74 
75   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
76 
77   // Execute
78   int _retval = _struct->is_canceled(_struct);
79 
80   // Return type: bool
81   return _retval ? true : false;
82 }
83 
GetCurrentSpeed()84 NO_SANITIZE("cfi-icall") int64 CefDownloadItemCToCpp::GetCurrentSpeed() {
85   shutdown_checker::AssertNotShutdown();
86 
87   cef_download_item_t* _struct = GetStruct();
88   if (CEF_MEMBER_MISSING(_struct, get_current_speed))
89     return 0;
90 
91   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
92 
93   // Execute
94   int64 _retval = _struct->get_current_speed(_struct);
95 
96   // Return type: simple
97   return _retval;
98 }
99 
GetPercentComplete()100 NO_SANITIZE("cfi-icall") int CefDownloadItemCToCpp::GetPercentComplete() {
101   shutdown_checker::AssertNotShutdown();
102 
103   cef_download_item_t* _struct = GetStruct();
104   if (CEF_MEMBER_MISSING(_struct, get_percent_complete))
105     return 0;
106 
107   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
108 
109   // Execute
110   int _retval = _struct->get_percent_complete(_struct);
111 
112   // Return type: simple
113   return _retval;
114 }
115 
GetTotalBytes()116 NO_SANITIZE("cfi-icall") int64 CefDownloadItemCToCpp::GetTotalBytes() {
117   shutdown_checker::AssertNotShutdown();
118 
119   cef_download_item_t* _struct = GetStruct();
120   if (CEF_MEMBER_MISSING(_struct, get_total_bytes))
121     return 0;
122 
123   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
124 
125   // Execute
126   int64 _retval = _struct->get_total_bytes(_struct);
127 
128   // Return type: simple
129   return _retval;
130 }
131 
GetReceivedBytes()132 NO_SANITIZE("cfi-icall") int64 CefDownloadItemCToCpp::GetReceivedBytes() {
133   shutdown_checker::AssertNotShutdown();
134 
135   cef_download_item_t* _struct = GetStruct();
136   if (CEF_MEMBER_MISSING(_struct, get_received_bytes))
137     return 0;
138 
139   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
140 
141   // Execute
142   int64 _retval = _struct->get_received_bytes(_struct);
143 
144   // Return type: simple
145   return _retval;
146 }
147 
GetStartTime()148 NO_SANITIZE("cfi-icall") CefTime CefDownloadItemCToCpp::GetStartTime() {
149   shutdown_checker::AssertNotShutdown();
150 
151   cef_download_item_t* _struct = GetStruct();
152   if (CEF_MEMBER_MISSING(_struct, get_start_time))
153     return CefTime();
154 
155   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
156 
157   // Execute
158   cef_time_t _retval = _struct->get_start_time(_struct);
159 
160   // Return type: simple
161   return _retval;
162 }
163 
GetEndTime()164 NO_SANITIZE("cfi-icall") CefTime CefDownloadItemCToCpp::GetEndTime() {
165   shutdown_checker::AssertNotShutdown();
166 
167   cef_download_item_t* _struct = GetStruct();
168   if (CEF_MEMBER_MISSING(_struct, get_end_time))
169     return CefTime();
170 
171   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
172 
173   // Execute
174   cef_time_t _retval = _struct->get_end_time(_struct);
175 
176   // Return type: simple
177   return _retval;
178 }
179 
GetFullPath()180 NO_SANITIZE("cfi-icall") CefString CefDownloadItemCToCpp::GetFullPath() {
181   shutdown_checker::AssertNotShutdown();
182 
183   cef_download_item_t* _struct = GetStruct();
184   if (CEF_MEMBER_MISSING(_struct, get_full_path))
185     return CefString();
186 
187   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
188 
189   // Execute
190   cef_string_userfree_t _retval = _struct->get_full_path(_struct);
191 
192   // Return type: string
193   CefString _retvalStr;
194   _retvalStr.AttachToUserFree(_retval);
195   return _retvalStr;
196 }
197 
GetId()198 NO_SANITIZE("cfi-icall") uint32 CefDownloadItemCToCpp::GetId() {
199   shutdown_checker::AssertNotShutdown();
200 
201   cef_download_item_t* _struct = GetStruct();
202   if (CEF_MEMBER_MISSING(_struct, get_id))
203     return 0;
204 
205   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
206 
207   // Execute
208   uint32 _retval = _struct->get_id(_struct);
209 
210   // Return type: simple
211   return _retval;
212 }
213 
GetURL()214 NO_SANITIZE("cfi-icall") CefString CefDownloadItemCToCpp::GetURL() {
215   shutdown_checker::AssertNotShutdown();
216 
217   cef_download_item_t* _struct = GetStruct();
218   if (CEF_MEMBER_MISSING(_struct, get_url))
219     return CefString();
220 
221   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
222 
223   // Execute
224   cef_string_userfree_t _retval = _struct->get_url(_struct);
225 
226   // Return type: string
227   CefString _retvalStr;
228   _retvalStr.AttachToUserFree(_retval);
229   return _retvalStr;
230 }
231 
GetOriginalUrl()232 NO_SANITIZE("cfi-icall") CefString CefDownloadItemCToCpp::GetOriginalUrl() {
233   shutdown_checker::AssertNotShutdown();
234 
235   cef_download_item_t* _struct = GetStruct();
236   if (CEF_MEMBER_MISSING(_struct, get_original_url))
237     return CefString();
238 
239   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
240 
241   // Execute
242   cef_string_userfree_t _retval = _struct->get_original_url(_struct);
243 
244   // Return type: string
245   CefString _retvalStr;
246   _retvalStr.AttachToUserFree(_retval);
247   return _retvalStr;
248 }
249 
250 NO_SANITIZE("cfi-icall")
GetSuggestedFileName()251 CefString CefDownloadItemCToCpp::GetSuggestedFileName() {
252   shutdown_checker::AssertNotShutdown();
253 
254   cef_download_item_t* _struct = GetStruct();
255   if (CEF_MEMBER_MISSING(_struct, get_suggested_file_name))
256     return CefString();
257 
258   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
259 
260   // Execute
261   cef_string_userfree_t _retval = _struct->get_suggested_file_name(_struct);
262 
263   // Return type: string
264   CefString _retvalStr;
265   _retvalStr.AttachToUserFree(_retval);
266   return _retvalStr;
267 }
268 
269 NO_SANITIZE("cfi-icall")
GetContentDisposition()270 CefString CefDownloadItemCToCpp::GetContentDisposition() {
271   shutdown_checker::AssertNotShutdown();
272 
273   cef_download_item_t* _struct = GetStruct();
274   if (CEF_MEMBER_MISSING(_struct, get_content_disposition))
275     return CefString();
276 
277   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
278 
279   // Execute
280   cef_string_userfree_t _retval = _struct->get_content_disposition(_struct);
281 
282   // Return type: string
283   CefString _retvalStr;
284   _retvalStr.AttachToUserFree(_retval);
285   return _retvalStr;
286 }
287 
GetMimeType()288 NO_SANITIZE("cfi-icall") CefString CefDownloadItemCToCpp::GetMimeType() {
289   shutdown_checker::AssertNotShutdown();
290 
291   cef_download_item_t* _struct = GetStruct();
292   if (CEF_MEMBER_MISSING(_struct, get_mime_type))
293     return CefString();
294 
295   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
296 
297   // Execute
298   cef_string_userfree_t _retval = _struct->get_mime_type(_struct);
299 
300   // Return type: string
301   CefString _retvalStr;
302   _retvalStr.AttachToUserFree(_retval);
303   return _retvalStr;
304 }
305 
306 // CONSTRUCTOR - Do not edit by hand.
307 
CefDownloadItemCToCpp()308 CefDownloadItemCToCpp::CefDownloadItemCToCpp() {}
309 
310 // DESTRUCTOR - Do not edit by hand.
311 
~CefDownloadItemCToCpp()312 CefDownloadItemCToCpp::~CefDownloadItemCToCpp() {
313   shutdown_checker::AssertNotShutdown();
314 }
315 
316 template <>
317 cef_download_item_t*
318 CefCToCppRefCounted<CefDownloadItemCToCpp,
319                     CefDownloadItem,
UnwrapDerived(CefWrapperType type,CefDownloadItem * c)320                     cef_download_item_t>::UnwrapDerived(CefWrapperType type,
321                                                         CefDownloadItem* c) {
322   NOTREACHED() << "Unexpected class type: " << type;
323   return nullptr;
324 }
325 
326 template <>
327 CefWrapperType CefCToCppRefCounted<CefDownloadItemCToCpp,
328                                    CefDownloadItem,
329                                    cef_download_item_t>::kWrapperType =
330     WT_DOWNLOAD_ITEM;
331