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=a75829d0f47e772086a586f213cfdfe54ff5554c$
13 //
14
15 #include "libcef_dll/ctocpp/render_process_handler_ctocpp.h"
16 #include "libcef_dll/cpptoc/browser_cpptoc.h"
17 #include "libcef_dll/cpptoc/dictionary_value_cpptoc.h"
18 #include "libcef_dll/cpptoc/domnode_cpptoc.h"
19 #include "libcef_dll/cpptoc/frame_cpptoc.h"
20 #include "libcef_dll/cpptoc/process_message_cpptoc.h"
21 #include "libcef_dll/cpptoc/v8context_cpptoc.h"
22 #include "libcef_dll/cpptoc/v8exception_cpptoc.h"
23 #include "libcef_dll/cpptoc/v8stack_trace_cpptoc.h"
24 #include "libcef_dll/ctocpp/load_handler_ctocpp.h"
25
26 // VIRTUAL METHODS - Body may be edited by hand.
27
28 NO_SANITIZE("cfi-icall")
OnWebKitInitialized()29 void CefRenderProcessHandlerCToCpp::OnWebKitInitialized() {
30 cef_render_process_handler_t* _struct = GetStruct();
31 if (CEF_MEMBER_MISSING(_struct, on_web_kit_initialized))
32 return;
33
34 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
35
36 // Execute
37 _struct->on_web_kit_initialized(_struct);
38 }
39
40 NO_SANITIZE("cfi-icall")
OnBrowserCreated(CefRefPtr<CefBrowser> browser,CefRefPtr<CefDictionaryValue> extra_info)41 void CefRenderProcessHandlerCToCpp::OnBrowserCreated(
42 CefRefPtr<CefBrowser> browser,
43 CefRefPtr<CefDictionaryValue> extra_info) {
44 cef_render_process_handler_t* _struct = GetStruct();
45 if (CEF_MEMBER_MISSING(_struct, on_browser_created))
46 return;
47
48 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
49
50 // Verify param: browser; type: refptr_diff
51 DCHECK(browser.get());
52 if (!browser.get())
53 return;
54 // Unverified params: extra_info
55
56 // Execute
57 _struct->on_browser_created(_struct, CefBrowserCppToC::Wrap(browser),
58 CefDictionaryValueCppToC::Wrap(extra_info));
59 }
60
61 NO_SANITIZE("cfi-icall")
OnBrowserDestroyed(CefRefPtr<CefBrowser> browser)62 void CefRenderProcessHandlerCToCpp::OnBrowserDestroyed(
63 CefRefPtr<CefBrowser> browser) {
64 cef_render_process_handler_t* _struct = GetStruct();
65 if (CEF_MEMBER_MISSING(_struct, on_browser_destroyed))
66 return;
67
68 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
69
70 // Verify param: browser; type: refptr_diff
71 DCHECK(browser.get());
72 if (!browser.get())
73 return;
74
75 // Execute
76 _struct->on_browser_destroyed(_struct, CefBrowserCppToC::Wrap(browser));
77 }
78
79 NO_SANITIZE("cfi-icall")
GetLoadHandler()80 CefRefPtr<CefLoadHandler> CefRenderProcessHandlerCToCpp::GetLoadHandler() {
81 cef_render_process_handler_t* _struct = GetStruct();
82 if (CEF_MEMBER_MISSING(_struct, get_load_handler))
83 return nullptr;
84
85 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
86
87 // Execute
88 cef_load_handler_t* _retval = _struct->get_load_handler(_struct);
89
90 // Return type: refptr_same
91 return CefLoadHandlerCToCpp::Wrap(_retval);
92 }
93
94 NO_SANITIZE("cfi-icall")
OnContextCreated(CefRefPtr<CefBrowser> browser,CefRefPtr<CefFrame> frame,CefRefPtr<CefV8Context> context)95 void CefRenderProcessHandlerCToCpp::OnContextCreated(
96 CefRefPtr<CefBrowser> browser,
97 CefRefPtr<CefFrame> frame,
98 CefRefPtr<CefV8Context> context) {
99 cef_render_process_handler_t* _struct = GetStruct();
100 if (CEF_MEMBER_MISSING(_struct, on_context_created))
101 return;
102
103 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
104
105 // Verify param: browser; type: refptr_diff
106 DCHECK(browser.get());
107 if (!browser.get())
108 return;
109 // Verify param: frame; type: refptr_diff
110 DCHECK(frame.get());
111 if (!frame.get())
112 return;
113 // Verify param: context; type: refptr_diff
114 DCHECK(context.get());
115 if (!context.get())
116 return;
117
118 // Execute
119 _struct->on_context_created(_struct, CefBrowserCppToC::Wrap(browser),
120 CefFrameCppToC::Wrap(frame),
121 CefV8ContextCppToC::Wrap(context));
122 }
123
124 NO_SANITIZE("cfi-icall")
OnContextReleased(CefRefPtr<CefBrowser> browser,CefRefPtr<CefFrame> frame,CefRefPtr<CefV8Context> context)125 void CefRenderProcessHandlerCToCpp::OnContextReleased(
126 CefRefPtr<CefBrowser> browser,
127 CefRefPtr<CefFrame> frame,
128 CefRefPtr<CefV8Context> context) {
129 cef_render_process_handler_t* _struct = GetStruct();
130 if (CEF_MEMBER_MISSING(_struct, on_context_released))
131 return;
132
133 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
134
135 // Verify param: browser; type: refptr_diff
136 DCHECK(browser.get());
137 if (!browser.get())
138 return;
139 // Verify param: frame; type: refptr_diff
140 DCHECK(frame.get());
141 if (!frame.get())
142 return;
143 // Verify param: context; type: refptr_diff
144 DCHECK(context.get());
145 if (!context.get())
146 return;
147
148 // Execute
149 _struct->on_context_released(_struct, CefBrowserCppToC::Wrap(browser),
150 CefFrameCppToC::Wrap(frame),
151 CefV8ContextCppToC::Wrap(context));
152 }
153
154 NO_SANITIZE("cfi-icall")
OnUncaughtException(CefRefPtr<CefBrowser> browser,CefRefPtr<CefFrame> frame,CefRefPtr<CefV8Context> context,CefRefPtr<CefV8Exception> exception,CefRefPtr<CefV8StackTrace> stackTrace)155 void CefRenderProcessHandlerCToCpp::OnUncaughtException(
156 CefRefPtr<CefBrowser> browser,
157 CefRefPtr<CefFrame> frame,
158 CefRefPtr<CefV8Context> context,
159 CefRefPtr<CefV8Exception> exception,
160 CefRefPtr<CefV8StackTrace> stackTrace) {
161 cef_render_process_handler_t* _struct = GetStruct();
162 if (CEF_MEMBER_MISSING(_struct, on_uncaught_exception))
163 return;
164
165 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
166
167 // Verify param: browser; type: refptr_diff
168 DCHECK(browser.get());
169 if (!browser.get())
170 return;
171 // Verify param: frame; type: refptr_diff
172 DCHECK(frame.get());
173 if (!frame.get())
174 return;
175 // Verify param: context; type: refptr_diff
176 DCHECK(context.get());
177 if (!context.get())
178 return;
179 // Verify param: exception; type: refptr_diff
180 DCHECK(exception.get());
181 if (!exception.get())
182 return;
183 // Verify param: stackTrace; type: refptr_diff
184 DCHECK(stackTrace.get());
185 if (!stackTrace.get())
186 return;
187
188 // Execute
189 _struct->on_uncaught_exception(
190 _struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame),
191 CefV8ContextCppToC::Wrap(context), CefV8ExceptionCppToC::Wrap(exception),
192 CefV8StackTraceCppToC::Wrap(stackTrace));
193 }
194
195 NO_SANITIZE("cfi-icall")
OnFocusedNodeChanged(CefRefPtr<CefBrowser> browser,CefRefPtr<CefFrame> frame,CefRefPtr<CefDOMNode> node)196 void CefRenderProcessHandlerCToCpp::OnFocusedNodeChanged(
197 CefRefPtr<CefBrowser> browser,
198 CefRefPtr<CefFrame> frame,
199 CefRefPtr<CefDOMNode> node) {
200 cef_render_process_handler_t* _struct = GetStruct();
201 if (CEF_MEMBER_MISSING(_struct, on_focused_node_changed))
202 return;
203
204 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
205
206 // Verify param: browser; type: refptr_diff
207 DCHECK(browser.get());
208 if (!browser.get())
209 return;
210 // Unverified params: frame, node
211
212 // Execute
213 _struct->on_focused_node_changed(_struct, CefBrowserCppToC::Wrap(browser),
214 CefFrameCppToC::Wrap(frame),
215 CefDOMNodeCppToC::Wrap(node));
216 }
217
218 NO_SANITIZE("cfi-icall")
OnProcessMessageReceived(CefRefPtr<CefBrowser> browser,CefRefPtr<CefFrame> frame,CefProcessId source_process,CefRefPtr<CefProcessMessage> message)219 bool CefRenderProcessHandlerCToCpp::OnProcessMessageReceived(
220 CefRefPtr<CefBrowser> browser,
221 CefRefPtr<CefFrame> frame,
222 CefProcessId source_process,
223 CefRefPtr<CefProcessMessage> message) {
224 cef_render_process_handler_t* _struct = GetStruct();
225 if (CEF_MEMBER_MISSING(_struct, on_process_message_received))
226 return false;
227
228 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
229
230 // Verify param: browser; type: refptr_diff
231 DCHECK(browser.get());
232 if (!browser.get())
233 return false;
234 // Verify param: frame; type: refptr_diff
235 DCHECK(frame.get());
236 if (!frame.get())
237 return false;
238 // Verify param: message; type: refptr_diff
239 DCHECK(message.get());
240 if (!message.get())
241 return false;
242
243 // Execute
244 int _retval = _struct->on_process_message_received(
245 _struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame),
246 source_process, CefProcessMessageCppToC::Wrap(message));
247
248 // Return type: bool
249 return _retval ? true : false;
250 }
251
252 // CONSTRUCTOR - Do not edit by hand.
253
CefRenderProcessHandlerCToCpp()254 CefRenderProcessHandlerCToCpp::CefRenderProcessHandlerCToCpp() {}
255
256 // DESTRUCTOR - Do not edit by hand.
257
~CefRenderProcessHandlerCToCpp()258 CefRenderProcessHandlerCToCpp::~CefRenderProcessHandlerCToCpp() {}
259
260 template <>
261 cef_render_process_handler_t* CefCToCppRefCounted<
262 CefRenderProcessHandlerCToCpp,
263 CefRenderProcessHandler,
UnwrapDerived(CefWrapperType type,CefRenderProcessHandler * c)264 cef_render_process_handler_t>::UnwrapDerived(CefWrapperType type,
265 CefRenderProcessHandler* c) {
266 NOTREACHED() << "Unexpected class type: " << type;
267 return nullptr;
268 }
269
270 template <>
271 CefWrapperType CefCToCppRefCounted<CefRenderProcessHandlerCToCpp,
272 CefRenderProcessHandler,
273 cef_render_process_handler_t>::kWrapperType =
274 WT_RENDER_PROCESS_HANDLER;
275