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=08f14fa621595f247e87853c39c3375fce2c9326$
13 //
14
15 #include "libcef_dll/cpptoc/render_process_handler_cpptoc.h"
16 #include "libcef_dll/cpptoc/load_handler_cpptoc.h"
17 #include "libcef_dll/ctocpp/browser_ctocpp.h"
18 #include "libcef_dll/ctocpp/dictionary_value_ctocpp.h"
19 #include "libcef_dll/ctocpp/domnode_ctocpp.h"
20 #include "libcef_dll/ctocpp/frame_ctocpp.h"
21 #include "libcef_dll/ctocpp/process_message_ctocpp.h"
22 #include "libcef_dll/ctocpp/v8context_ctocpp.h"
23 #include "libcef_dll/ctocpp/v8exception_ctocpp.h"
24 #include "libcef_dll/ctocpp/v8stack_trace_ctocpp.h"
25
26 namespace {
27
28 // MEMBER FUNCTIONS - Body may be edited by hand.
29
render_process_handler_on_web_kit_initialized(struct _cef_render_process_handler_t * self)30 void CEF_CALLBACK render_process_handler_on_web_kit_initialized(
31 struct _cef_render_process_handler_t* self) {
32 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
33
34 DCHECK(self);
35 if (!self)
36 return;
37
38 // Execute
39 CefRenderProcessHandlerCppToC::Get(self)->OnWebKitInitialized();
40 }
41
render_process_handler_on_browser_created(struct _cef_render_process_handler_t * self,cef_browser_t * browser,struct _cef_dictionary_value_t * extra_info)42 void CEF_CALLBACK render_process_handler_on_browser_created(
43 struct _cef_render_process_handler_t* self,
44 cef_browser_t* browser,
45 struct _cef_dictionary_value_t* extra_info) {
46 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
47
48 DCHECK(self);
49 if (!self)
50 return;
51 // Verify param: browser; type: refptr_diff
52 DCHECK(browser);
53 if (!browser)
54 return;
55 // Unverified params: extra_info
56
57 // Execute
58 CefRenderProcessHandlerCppToC::Get(self)->OnBrowserCreated(
59 CefBrowserCToCpp::Wrap(browser),
60 CefDictionaryValueCToCpp::Wrap(extra_info));
61 }
62
render_process_handler_on_browser_destroyed(struct _cef_render_process_handler_t * self,cef_browser_t * browser)63 void CEF_CALLBACK render_process_handler_on_browser_destroyed(
64 struct _cef_render_process_handler_t* self,
65 cef_browser_t* browser) {
66 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
67
68 DCHECK(self);
69 if (!self)
70 return;
71 // Verify param: browser; type: refptr_diff
72 DCHECK(browser);
73 if (!browser)
74 return;
75
76 // Execute
77 CefRenderProcessHandlerCppToC::Get(self)->OnBrowserDestroyed(
78 CefBrowserCToCpp::Wrap(browser));
79 }
80
render_process_handler_get_load_handler(struct _cef_render_process_handler_t * self)81 cef_load_handler_t* CEF_CALLBACK render_process_handler_get_load_handler(
82 struct _cef_render_process_handler_t* self) {
83 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
84
85 DCHECK(self);
86 if (!self)
87 return NULL;
88
89 // Execute
90 CefRefPtr<CefLoadHandler> _retval =
91 CefRenderProcessHandlerCppToC::Get(self)->GetLoadHandler();
92
93 // Return type: refptr_same
94 return CefLoadHandlerCppToC::Wrap(_retval);
95 }
96
render_process_handler_on_context_created(struct _cef_render_process_handler_t * self,cef_browser_t * browser,cef_frame_t * frame,struct _cef_v8context_t * context)97 void CEF_CALLBACK render_process_handler_on_context_created(
98 struct _cef_render_process_handler_t* self,
99 cef_browser_t* browser,
100 cef_frame_t* frame,
101 struct _cef_v8context_t* context) {
102 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
103
104 DCHECK(self);
105 if (!self)
106 return;
107 // Verify param: browser; type: refptr_diff
108 DCHECK(browser);
109 if (!browser)
110 return;
111 // Verify param: frame; type: refptr_diff
112 DCHECK(frame);
113 if (!frame)
114 return;
115 // Verify param: context; type: refptr_diff
116 DCHECK(context);
117 if (!context)
118 return;
119
120 // Execute
121 CefRenderProcessHandlerCppToC::Get(self)->OnContextCreated(
122 CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
123 CefV8ContextCToCpp::Wrap(context));
124 }
125
render_process_handler_on_context_released(struct _cef_render_process_handler_t * self,cef_browser_t * browser,cef_frame_t * frame,struct _cef_v8context_t * context)126 void CEF_CALLBACK render_process_handler_on_context_released(
127 struct _cef_render_process_handler_t* self,
128 cef_browser_t* browser,
129 cef_frame_t* frame,
130 struct _cef_v8context_t* context) {
131 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
132
133 DCHECK(self);
134 if (!self)
135 return;
136 // Verify param: browser; type: refptr_diff
137 DCHECK(browser);
138 if (!browser)
139 return;
140 // Verify param: frame; type: refptr_diff
141 DCHECK(frame);
142 if (!frame)
143 return;
144 // Verify param: context; type: refptr_diff
145 DCHECK(context);
146 if (!context)
147 return;
148
149 // Execute
150 CefRenderProcessHandlerCppToC::Get(self)->OnContextReleased(
151 CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
152 CefV8ContextCToCpp::Wrap(context));
153 }
154
render_process_handler_on_uncaught_exception(struct _cef_render_process_handler_t * self,cef_browser_t * browser,cef_frame_t * frame,struct _cef_v8context_t * context,struct _cef_v8exception_t * exception,struct _cef_v8stack_trace_t * stackTrace)155 void CEF_CALLBACK render_process_handler_on_uncaught_exception(
156 struct _cef_render_process_handler_t* self,
157 cef_browser_t* browser,
158 cef_frame_t* frame,
159 struct _cef_v8context_t* context,
160 struct _cef_v8exception_t* exception,
161 struct _cef_v8stack_trace_t* stackTrace) {
162 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
163
164 DCHECK(self);
165 if (!self)
166 return;
167 // Verify param: browser; type: refptr_diff
168 DCHECK(browser);
169 if (!browser)
170 return;
171 // Verify param: frame; type: refptr_diff
172 DCHECK(frame);
173 if (!frame)
174 return;
175 // Verify param: context; type: refptr_diff
176 DCHECK(context);
177 if (!context)
178 return;
179 // Verify param: exception; type: refptr_diff
180 DCHECK(exception);
181 if (!exception)
182 return;
183 // Verify param: stackTrace; type: refptr_diff
184 DCHECK(stackTrace);
185 if (!stackTrace)
186 return;
187
188 // Execute
189 CefRenderProcessHandlerCppToC::Get(self)->OnUncaughtException(
190 CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
191 CefV8ContextCToCpp::Wrap(context), CefV8ExceptionCToCpp::Wrap(exception),
192 CefV8StackTraceCToCpp::Wrap(stackTrace));
193 }
194
render_process_handler_on_focused_node_changed(struct _cef_render_process_handler_t * self,cef_browser_t * browser,cef_frame_t * frame,cef_domnode_t * node)195 void CEF_CALLBACK render_process_handler_on_focused_node_changed(
196 struct _cef_render_process_handler_t* self,
197 cef_browser_t* browser,
198 cef_frame_t* frame,
199 cef_domnode_t* node) {
200 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
201
202 DCHECK(self);
203 if (!self)
204 return;
205 // Verify param: browser; type: refptr_diff
206 DCHECK(browser);
207 if (!browser)
208 return;
209 // Unverified params: frame, node
210
211 // Execute
212 CefRenderProcessHandlerCppToC::Get(self)->OnFocusedNodeChanged(
213 CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
214 CefDOMNodeCToCpp::Wrap(node));
215 }
216
render_process_handler_on_process_message_received(struct _cef_render_process_handler_t * self,cef_browser_t * browser,cef_frame_t * frame,cef_process_id_t source_process,cef_process_message_t * message)217 int CEF_CALLBACK render_process_handler_on_process_message_received(
218 struct _cef_render_process_handler_t* self,
219 cef_browser_t* browser,
220 cef_frame_t* frame,
221 cef_process_id_t source_process,
222 cef_process_message_t* message) {
223 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
224
225 DCHECK(self);
226 if (!self)
227 return 0;
228 // Verify param: browser; type: refptr_diff
229 DCHECK(browser);
230 if (!browser)
231 return 0;
232 // Verify param: frame; type: refptr_diff
233 DCHECK(frame);
234 if (!frame)
235 return 0;
236 // Verify param: message; type: refptr_diff
237 DCHECK(message);
238 if (!message)
239 return 0;
240
241 // Execute
242 bool _retval =
243 CefRenderProcessHandlerCppToC::Get(self)->OnProcessMessageReceived(
244 CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
245 source_process, CefProcessMessageCToCpp::Wrap(message));
246
247 // Return type: bool
248 return _retval;
249 }
250
251 } // namespace
252
253 // CONSTRUCTOR - Do not edit by hand.
254
CefRenderProcessHandlerCppToC()255 CefRenderProcessHandlerCppToC::CefRenderProcessHandlerCppToC() {
256 GetStruct()->on_web_kit_initialized =
257 render_process_handler_on_web_kit_initialized;
258 GetStruct()->on_browser_created = render_process_handler_on_browser_created;
259 GetStruct()->on_browser_destroyed =
260 render_process_handler_on_browser_destroyed;
261 GetStruct()->get_load_handler = render_process_handler_get_load_handler;
262 GetStruct()->on_context_created = render_process_handler_on_context_created;
263 GetStruct()->on_context_released = render_process_handler_on_context_released;
264 GetStruct()->on_uncaught_exception =
265 render_process_handler_on_uncaught_exception;
266 GetStruct()->on_focused_node_changed =
267 render_process_handler_on_focused_node_changed;
268 GetStruct()->on_process_message_received =
269 render_process_handler_on_process_message_received;
270 }
271
272 // DESTRUCTOR - Do not edit by hand.
273
~CefRenderProcessHandlerCppToC()274 CefRenderProcessHandlerCppToC::~CefRenderProcessHandlerCppToC() {}
275
276 template <>
277 CefRefPtr<CefRenderProcessHandler> CefCppToCRefCounted<
278 CefRenderProcessHandlerCppToC,
279 CefRenderProcessHandler,
UnwrapDerived(CefWrapperType type,cef_render_process_handler_t * s)280 cef_render_process_handler_t>::UnwrapDerived(CefWrapperType type,
281 cef_render_process_handler_t*
282 s) {
283 NOTREACHED() << "Unexpected class type: " << type;
284 return nullptr;
285 }
286
287 template <>
288 CefWrapperType CefCppToCRefCounted<CefRenderProcessHandlerCppToC,
289 CefRenderProcessHandler,
290 cef_render_process_handler_t>::kWrapperType =
291 WT_RENDER_PROCESS_HANDLER;
292