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