1 // Copyright (c) 2021 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=bd98cacb709cbd923c79cf8d61847e0bd6a2e3d9$
13 //
14
15 #include "libcef_dll/cpptoc/download_image_callback_cpptoc.h"
16 #include "libcef_dll/ctocpp/image_ctocpp.h"
17 #include "libcef_dll/shutdown_checker.h"
18
19 namespace {
20
21 // MEMBER FUNCTIONS - Body may be edited by hand.
22
download_image_callback_on_download_image_finished(struct _cef_download_image_callback_t * self,const cef_string_t * image_url,int http_status_code,struct _cef_image_t * image)23 void CEF_CALLBACK download_image_callback_on_download_image_finished(
24 struct _cef_download_image_callback_t* self,
25 const cef_string_t* image_url,
26 int http_status_code,
27 struct _cef_image_t* image) {
28 shutdown_checker::AssertNotShutdown();
29
30 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
31
32 DCHECK(self);
33 if (!self)
34 return;
35 // Verify param: image_url; type: string_byref_const
36 DCHECK(image_url);
37 if (!image_url)
38 return;
39 // Unverified params: image
40
41 // Execute
42 CefDownloadImageCallbackCppToC::Get(self)->OnDownloadImageFinished(
43 CefString(image_url), http_status_code, CefImageCToCpp::Wrap(image));
44 }
45
46 } // namespace
47
48 // CONSTRUCTOR - Do not edit by hand.
49
CefDownloadImageCallbackCppToC()50 CefDownloadImageCallbackCppToC::CefDownloadImageCallbackCppToC() {
51 GetStruct()->on_download_image_finished =
52 download_image_callback_on_download_image_finished;
53 }
54
55 // DESTRUCTOR - Do not edit by hand.
56
~CefDownloadImageCallbackCppToC()57 CefDownloadImageCallbackCppToC::~CefDownloadImageCallbackCppToC() {
58 shutdown_checker::AssertNotShutdown();
59 }
60
61 template <>
62 CefRefPtr<CefDownloadImageCallback> CefCppToCRefCounted<
63 CefDownloadImageCallbackCppToC,
64 CefDownloadImageCallback,
UnwrapDerived(CefWrapperType type,cef_download_image_callback_t * s)65 cef_download_image_callback_t>::UnwrapDerived(CefWrapperType type,
66 cef_download_image_callback_t*
67 s) {
68 NOTREACHED() << "Unexpected class type: " << type;
69 return nullptr;
70 }
71
72 template <>
73 CefWrapperType
74 CefCppToCRefCounted<CefDownloadImageCallbackCppToC,
75 CefDownloadImageCallback,
76 cef_download_image_callback_t>::kWrapperType =
77 WT_DOWNLOAD_IMAGE_CALLBACK;
78