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=9986455b9b29bd88504e9b4c2b73bfebc87cfc61$
13 //
14
15 #include "libcef_dll/ctocpp/app_ctocpp.h"
16 #include "libcef_dll/cpptoc/command_line_cpptoc.h"
17 #include "libcef_dll/cpptoc/scheme_registrar_cpptoc.h"
18 #include "libcef_dll/ctocpp/browser_process_handler_ctocpp.h"
19 #include "libcef_dll/ctocpp/render_process_handler_ctocpp.h"
20 #include "libcef_dll/ctocpp/resource_bundle_handler_ctocpp.h"
21
22 // VIRTUAL METHODS - Body may be edited by hand.
23
24 NO_SANITIZE("cfi-icall")
OnBeforeCommandLineProcessing(const CefString & process_type,CefRefPtr<CefCommandLine> command_line)25 void CefAppCToCpp::OnBeforeCommandLineProcessing(
26 const CefString& process_type,
27 CefRefPtr<CefCommandLine> command_line) {
28 cef_app_t* _struct = GetStruct();
29 if (CEF_MEMBER_MISSING(_struct, on_before_command_line_processing))
30 return;
31
32 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
33
34 // Verify param: command_line; type: refptr_diff
35 DCHECK(command_line.get());
36 if (!command_line.get())
37 return;
38 // Unverified params: process_type
39
40 // Execute
41 _struct->on_before_command_line_processing(
42 _struct, process_type.GetStruct(),
43 CefCommandLineCppToC::Wrap(command_line));
44 }
45
46 NO_SANITIZE("cfi-icall")
OnRegisterCustomSchemes(CefRawPtr<CefSchemeRegistrar> registrar)47 void CefAppCToCpp::OnRegisterCustomSchemes(
48 CefRawPtr<CefSchemeRegistrar> registrar) {
49 cef_app_t* _struct = GetStruct();
50 if (CEF_MEMBER_MISSING(_struct, on_register_custom_schemes))
51 return;
52
53 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
54
55 // Verify param: registrar; type: rawptr_diff
56 DCHECK(registrar);
57 if (!registrar)
58 return;
59
60 // Translate param: registrar; type: rawptr_diff
61 CefOwnPtr<CefSchemeRegistrarCppToC> registrarPtr(
62 CefSchemeRegistrarCppToC::WrapRaw(registrar));
63
64 // Execute
65 _struct->on_register_custom_schemes(_struct, registrarPtr->GetStruct());
66 }
67
68 NO_SANITIZE("cfi-icall")
GetResourceBundleHandler()69 CefRefPtr<CefResourceBundleHandler> CefAppCToCpp::GetResourceBundleHandler() {
70 cef_app_t* _struct = GetStruct();
71 if (CEF_MEMBER_MISSING(_struct, get_resource_bundle_handler))
72 return nullptr;
73
74 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
75
76 // Execute
77 cef_resource_bundle_handler_t* _retval =
78 _struct->get_resource_bundle_handler(_struct);
79
80 // Return type: refptr_same
81 return CefResourceBundleHandlerCToCpp::Wrap(_retval);
82 }
83
84 NO_SANITIZE("cfi-icall")
GetBrowserProcessHandler()85 CefRefPtr<CefBrowserProcessHandler> CefAppCToCpp::GetBrowserProcessHandler() {
86 cef_app_t* _struct = GetStruct();
87 if (CEF_MEMBER_MISSING(_struct, get_browser_process_handler))
88 return nullptr;
89
90 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
91
92 // Execute
93 cef_browser_process_handler_t* _retval =
94 _struct->get_browser_process_handler(_struct);
95
96 // Return type: refptr_same
97 return CefBrowserProcessHandlerCToCpp::Wrap(_retval);
98 }
99
100 NO_SANITIZE("cfi-icall")
GetRenderProcessHandler()101 CefRefPtr<CefRenderProcessHandler> CefAppCToCpp::GetRenderProcessHandler() {
102 cef_app_t* _struct = GetStruct();
103 if (CEF_MEMBER_MISSING(_struct, get_render_process_handler))
104 return nullptr;
105
106 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
107
108 // Execute
109 cef_render_process_handler_t* _retval =
110 _struct->get_render_process_handler(_struct);
111
112 // Return type: refptr_same
113 return CefRenderProcessHandlerCToCpp::Wrap(_retval);
114 }
115
116 // CONSTRUCTOR - Do not edit by hand.
117
CefAppCToCpp()118 CefAppCToCpp::CefAppCToCpp() {}
119
120 // DESTRUCTOR - Do not edit by hand.
121
~CefAppCToCpp()122 CefAppCToCpp::~CefAppCToCpp() {}
123
124 template <>
UnwrapDerived(CefWrapperType type,CefApp * c)125 cef_app_t* CefCToCppRefCounted<CefAppCToCpp, CefApp, cef_app_t>::UnwrapDerived(
126 CefWrapperType type,
127 CefApp* c) {
128 NOTREACHED() << "Unexpected class type: " << type;
129 return nullptr;
130 }
131
132 template <>
133 CefWrapperType
134 CefCToCppRefCounted<CefAppCToCpp, CefApp, cef_app_t>::kWrapperType = WT_APP;
135