• 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=8568e306d0db860b1cd222f7c6dba344f349cb2d$
13 //
14 
15 #include "libcef_dll/ctocpp/download_image_callback_ctocpp.h"
16 #include "libcef_dll/cpptoc/image_cpptoc.h"
17 #include "libcef_dll/shutdown_checker.h"
18 
19 // VIRTUAL METHODS - Body may be edited by hand.
20 
21 NO_SANITIZE("cfi-icall")
OnDownloadImageFinished(const CefString & image_url,int http_status_code,CefRefPtr<CefImage> image)22 void CefDownloadImageCallbackCToCpp::OnDownloadImageFinished(
23     const CefString& image_url,
24     int http_status_code,
25     CefRefPtr<CefImage> image) {
26   shutdown_checker::AssertNotShutdown();
27 
28   cef_download_image_callback_t* _struct = GetStruct();
29   if (CEF_MEMBER_MISSING(_struct, on_download_image_finished))
30     return;
31 
32   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
33 
34   // Verify param: image_url; type: string_byref_const
35   DCHECK(!image_url.empty());
36   if (image_url.empty())
37     return;
38   // Unverified params: image
39 
40   // Execute
41   _struct->on_download_image_finished(_struct, image_url.GetStruct(),
42                                       http_status_code,
43                                       CefImageCppToC::Wrap(image));
44 }
45 
46 // CONSTRUCTOR - Do not edit by hand.
47 
CefDownloadImageCallbackCToCpp()48 CefDownloadImageCallbackCToCpp::CefDownloadImageCallbackCToCpp() {}
49 
50 // DESTRUCTOR - Do not edit by hand.
51 
~CefDownloadImageCallbackCToCpp()52 CefDownloadImageCallbackCToCpp::~CefDownloadImageCallbackCToCpp() {
53   shutdown_checker::AssertNotShutdown();
54 }
55 
56 template <>
57 cef_download_image_callback_t* CefCToCppRefCounted<
58     CefDownloadImageCallbackCToCpp,
59     CefDownloadImageCallback,
UnwrapDerived(CefWrapperType type,CefDownloadImageCallback * c)60     cef_download_image_callback_t>::UnwrapDerived(CefWrapperType type,
61                                                   CefDownloadImageCallback* c) {
62   NOTREACHED() << "Unexpected class type: " << type;
63   return nullptr;
64 }
65 
66 template <>
67 CefWrapperType
68     CefCToCppRefCounted<CefDownloadImageCallbackCToCpp,
69                         CefDownloadImageCallback,
70                         cef_download_image_callback_t>::kWrapperType =
71         WT_DOWNLOAD_IMAGE_CALLBACK;
72