• 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=fd44b20a616ead48395d44804c8e8df40f7bc384$
13 //
14 
15 #include "libcef_dll/cpptoc/frame_cpptoc.h"
16 #include "libcef_dll/cpptoc/browser_cpptoc.h"
17 #include "libcef_dll/cpptoc/process_message_cpptoc.h"
18 #include "libcef_dll/cpptoc/request_cpptoc.h"
19 #include "libcef_dll/cpptoc/urlrequest_cpptoc.h"
20 #include "libcef_dll/cpptoc/v8context_cpptoc.h"
21 #include "libcef_dll/ctocpp/domvisitor_ctocpp.h"
22 #include "libcef_dll/ctocpp/string_visitor_ctocpp.h"
23 #include "libcef_dll/ctocpp/urlrequest_client_ctocpp.h"
24 #include "libcef_dll/shutdown_checker.h"
25 
26 namespace {
27 
28 // MEMBER FUNCTIONS - Body may be edited by hand.
29 
frame_is_valid(struct _cef_frame_t * self)30 int CEF_CALLBACK frame_is_valid(struct _cef_frame_t* self) {
31   shutdown_checker::AssertNotShutdown();
32 
33   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
34 
35   DCHECK(self);
36   if (!self)
37     return 0;
38 
39   // Execute
40   bool _retval = CefFrameCppToC::Get(self)->IsValid();
41 
42   // Return type: bool
43   return _retval;
44 }
45 
frame_undo(struct _cef_frame_t * self)46 void CEF_CALLBACK frame_undo(struct _cef_frame_t* self) {
47   shutdown_checker::AssertNotShutdown();
48 
49   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
50 
51   DCHECK(self);
52   if (!self)
53     return;
54 
55   // Execute
56   CefFrameCppToC::Get(self)->Undo();
57 }
58 
frame_redo(struct _cef_frame_t * self)59 void CEF_CALLBACK frame_redo(struct _cef_frame_t* self) {
60   shutdown_checker::AssertNotShutdown();
61 
62   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
63 
64   DCHECK(self);
65   if (!self)
66     return;
67 
68   // Execute
69   CefFrameCppToC::Get(self)->Redo();
70 }
71 
frame_cut(struct _cef_frame_t * self)72 void CEF_CALLBACK frame_cut(struct _cef_frame_t* self) {
73   shutdown_checker::AssertNotShutdown();
74 
75   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
76 
77   DCHECK(self);
78   if (!self)
79     return;
80 
81   // Execute
82   CefFrameCppToC::Get(self)->Cut();
83 }
84 
frame_copy(struct _cef_frame_t * self)85 void CEF_CALLBACK frame_copy(struct _cef_frame_t* self) {
86   shutdown_checker::AssertNotShutdown();
87 
88   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
89 
90   DCHECK(self);
91   if (!self)
92     return;
93 
94   // Execute
95   CefFrameCppToC::Get(self)->Copy();
96 }
97 
frame_paste(struct _cef_frame_t * self)98 void CEF_CALLBACK frame_paste(struct _cef_frame_t* self) {
99   shutdown_checker::AssertNotShutdown();
100 
101   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
102 
103   DCHECK(self);
104   if (!self)
105     return;
106 
107   // Execute
108   CefFrameCppToC::Get(self)->Paste();
109 }
110 
frame_del(struct _cef_frame_t * self)111 void CEF_CALLBACK frame_del(struct _cef_frame_t* self) {
112   shutdown_checker::AssertNotShutdown();
113 
114   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
115 
116   DCHECK(self);
117   if (!self)
118     return;
119 
120   // Execute
121   CefFrameCppToC::Get(self)->Delete();
122 }
123 
frame_select_all(struct _cef_frame_t * self)124 void CEF_CALLBACK frame_select_all(struct _cef_frame_t* self) {
125   shutdown_checker::AssertNotShutdown();
126 
127   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
128 
129   DCHECK(self);
130   if (!self)
131     return;
132 
133   // Execute
134   CefFrameCppToC::Get(self)->SelectAll();
135 }
136 
frame_view_source(struct _cef_frame_t * self)137 void CEF_CALLBACK frame_view_source(struct _cef_frame_t* self) {
138   shutdown_checker::AssertNotShutdown();
139 
140   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
141 
142   DCHECK(self);
143   if (!self)
144     return;
145 
146   // Execute
147   CefFrameCppToC::Get(self)->ViewSource();
148 }
149 
frame_get_source(struct _cef_frame_t * self,struct _cef_string_visitor_t * visitor)150 void CEF_CALLBACK frame_get_source(struct _cef_frame_t* self,
151                                    struct _cef_string_visitor_t* visitor) {
152   shutdown_checker::AssertNotShutdown();
153 
154   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
155 
156   DCHECK(self);
157   if (!self)
158     return;
159   // Verify param: visitor; type: refptr_diff
160   DCHECK(visitor);
161   if (!visitor)
162     return;
163 
164   // Execute
165   CefFrameCppToC::Get(self)->GetSource(CefStringVisitorCToCpp::Wrap(visitor));
166 }
167 
frame_get_text(struct _cef_frame_t * self,struct _cef_string_visitor_t * visitor)168 void CEF_CALLBACK frame_get_text(struct _cef_frame_t* self,
169                                  struct _cef_string_visitor_t* visitor) {
170   shutdown_checker::AssertNotShutdown();
171 
172   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
173 
174   DCHECK(self);
175   if (!self)
176     return;
177   // Verify param: visitor; type: refptr_diff
178   DCHECK(visitor);
179   if (!visitor)
180     return;
181 
182   // Execute
183   CefFrameCppToC::Get(self)->GetText(CefStringVisitorCToCpp::Wrap(visitor));
184 }
185 
frame_load_request(struct _cef_frame_t * self,struct _cef_request_t * request)186 void CEF_CALLBACK frame_load_request(struct _cef_frame_t* self,
187                                      struct _cef_request_t* request) {
188   shutdown_checker::AssertNotShutdown();
189 
190   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
191 
192   DCHECK(self);
193   if (!self)
194     return;
195   // Verify param: request; type: refptr_same
196   DCHECK(request);
197   if (!request)
198     return;
199 
200   // Execute
201   CefFrameCppToC::Get(self)->LoadRequest(CefRequestCppToC::Unwrap(request));
202 }
203 
frame_load_url(struct _cef_frame_t * self,const cef_string_t * url)204 void CEF_CALLBACK frame_load_url(struct _cef_frame_t* self,
205                                  const cef_string_t* url) {
206   shutdown_checker::AssertNotShutdown();
207 
208   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
209 
210   DCHECK(self);
211   if (!self)
212     return;
213   // Verify param: url; type: string_byref_const
214   DCHECK(url);
215   if (!url)
216     return;
217 
218   // Execute
219   CefFrameCppToC::Get(self)->LoadURL(CefString(url));
220 }
221 
frame_execute_java_script(struct _cef_frame_t * self,const cef_string_t * code,const cef_string_t * script_url,int start_line)222 void CEF_CALLBACK frame_execute_java_script(struct _cef_frame_t* self,
223                                             const cef_string_t* code,
224                                             const cef_string_t* script_url,
225                                             int start_line) {
226   shutdown_checker::AssertNotShutdown();
227 
228   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
229 
230   DCHECK(self);
231   if (!self)
232     return;
233   // Verify param: code; type: string_byref_const
234   DCHECK(code);
235   if (!code)
236     return;
237   // Unverified params: script_url
238 
239   // Execute
240   CefFrameCppToC::Get(self)->ExecuteJavaScript(
241       CefString(code), CefString(script_url), start_line);
242 }
243 
frame_is_main(struct _cef_frame_t * self)244 int CEF_CALLBACK frame_is_main(struct _cef_frame_t* self) {
245   shutdown_checker::AssertNotShutdown();
246 
247   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
248 
249   DCHECK(self);
250   if (!self)
251     return 0;
252 
253   // Execute
254   bool _retval = CefFrameCppToC::Get(self)->IsMain();
255 
256   // Return type: bool
257   return _retval;
258 }
259 
frame_is_focused(struct _cef_frame_t * self)260 int CEF_CALLBACK frame_is_focused(struct _cef_frame_t* self) {
261   shutdown_checker::AssertNotShutdown();
262 
263   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
264 
265   DCHECK(self);
266   if (!self)
267     return 0;
268 
269   // Execute
270   bool _retval = CefFrameCppToC::Get(self)->IsFocused();
271 
272   // Return type: bool
273   return _retval;
274 }
275 
frame_get_name(struct _cef_frame_t * self)276 cef_string_userfree_t CEF_CALLBACK frame_get_name(struct _cef_frame_t* self) {
277   shutdown_checker::AssertNotShutdown();
278 
279   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
280 
281   DCHECK(self);
282   if (!self)
283     return NULL;
284 
285   // Execute
286   CefString _retval = CefFrameCppToC::Get(self)->GetName();
287 
288   // Return type: string
289   return _retval.DetachToUserFree();
290 }
291 
frame_get_identifier(struct _cef_frame_t * self)292 int64 CEF_CALLBACK frame_get_identifier(struct _cef_frame_t* self) {
293   shutdown_checker::AssertNotShutdown();
294 
295   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
296 
297   DCHECK(self);
298   if (!self)
299     return 0;
300 
301   // Execute
302   int64 _retval = CefFrameCppToC::Get(self)->GetIdentifier();
303 
304   // Return type: simple
305   return _retval;
306 }
307 
frame_get_parent(struct _cef_frame_t * self)308 struct _cef_frame_t* CEF_CALLBACK frame_get_parent(struct _cef_frame_t* self) {
309   shutdown_checker::AssertNotShutdown();
310 
311   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
312 
313   DCHECK(self);
314   if (!self)
315     return NULL;
316 
317   // Execute
318   CefRefPtr<CefFrame> _retval = CefFrameCppToC::Get(self)->GetParent();
319 
320   // Return type: refptr_same
321   return CefFrameCppToC::Wrap(_retval);
322 }
323 
frame_get_url(struct _cef_frame_t * self)324 cef_string_userfree_t CEF_CALLBACK frame_get_url(struct _cef_frame_t* self) {
325   shutdown_checker::AssertNotShutdown();
326 
327   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
328 
329   DCHECK(self);
330   if (!self)
331     return NULL;
332 
333   // Execute
334   CefString _retval = CefFrameCppToC::Get(self)->GetURL();
335 
336   // Return type: string
337   return _retval.DetachToUserFree();
338 }
339 
frame_get_browser(struct _cef_frame_t * self)340 cef_browser_t* CEF_CALLBACK frame_get_browser(struct _cef_frame_t* self) {
341   shutdown_checker::AssertNotShutdown();
342 
343   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
344 
345   DCHECK(self);
346   if (!self)
347     return NULL;
348 
349   // Execute
350   CefRefPtr<CefBrowser> _retval = CefFrameCppToC::Get(self)->GetBrowser();
351 
352   // Return type: refptr_same
353   return CefBrowserCppToC::Wrap(_retval);
354 }
355 
356 struct _cef_v8context_t* CEF_CALLBACK
frame_get_v8context(struct _cef_frame_t * self)357 frame_get_v8context(struct _cef_frame_t* self) {
358   shutdown_checker::AssertNotShutdown();
359 
360   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
361 
362   DCHECK(self);
363   if (!self)
364     return NULL;
365 
366   // Execute
367   CefRefPtr<CefV8Context> _retval = CefFrameCppToC::Get(self)->GetV8Context();
368 
369   // Return type: refptr_same
370   return CefV8ContextCppToC::Wrap(_retval);
371 }
372 
frame_visit_dom(struct _cef_frame_t * self,cef_domvisitor_t * visitor)373 void CEF_CALLBACK frame_visit_dom(struct _cef_frame_t* self,
374                                   cef_domvisitor_t* visitor) {
375   shutdown_checker::AssertNotShutdown();
376 
377   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
378 
379   DCHECK(self);
380   if (!self)
381     return;
382   // Verify param: visitor; type: refptr_diff
383   DCHECK(visitor);
384   if (!visitor)
385     return;
386 
387   // Execute
388   CefFrameCppToC::Get(self)->VisitDOM(CefDOMVisitorCToCpp::Wrap(visitor));
389 }
390 
391 struct _cef_urlrequest_t* CEF_CALLBACK
frame_create_urlrequest(struct _cef_frame_t * self,struct _cef_request_t * request,struct _cef_urlrequest_client_t * client)392 frame_create_urlrequest(struct _cef_frame_t* self,
393                         struct _cef_request_t* request,
394                         struct _cef_urlrequest_client_t* client) {
395   shutdown_checker::AssertNotShutdown();
396 
397   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
398 
399   DCHECK(self);
400   if (!self)
401     return NULL;
402   // Verify param: request; type: refptr_same
403   DCHECK(request);
404   if (!request)
405     return NULL;
406   // Verify param: client; type: refptr_diff
407   DCHECK(client);
408   if (!client)
409     return NULL;
410 
411   // Execute
412   CefRefPtr<CefURLRequest> _retval =
413       CefFrameCppToC::Get(self)->CreateURLRequest(
414           CefRequestCppToC::Unwrap(request),
415           CefURLRequestClientCToCpp::Wrap(client));
416 
417   // Return type: refptr_same
418   return CefURLRequestCppToC::Wrap(_retval);
419 }
420 
421 void CEF_CALLBACK
frame_send_process_message(struct _cef_frame_t * self,cef_process_id_t target_process,struct _cef_process_message_t * message)422 frame_send_process_message(struct _cef_frame_t* self,
423                            cef_process_id_t target_process,
424                            struct _cef_process_message_t* message) {
425   shutdown_checker::AssertNotShutdown();
426 
427   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
428 
429   DCHECK(self);
430   if (!self)
431     return;
432   // Verify param: message; type: refptr_same
433   DCHECK(message);
434   if (!message)
435     return;
436 
437   // Execute
438   CefFrameCppToC::Get(self)->SendProcessMessage(
439       target_process, CefProcessMessageCppToC::Unwrap(message));
440 }
441 
442 }  // namespace
443 
444 // CONSTRUCTOR - Do not edit by hand.
445 
CefFrameCppToC()446 CefFrameCppToC::CefFrameCppToC() {
447   GetStruct()->is_valid = frame_is_valid;
448   GetStruct()->undo = frame_undo;
449   GetStruct()->redo = frame_redo;
450   GetStruct()->cut = frame_cut;
451   GetStruct()->copy = frame_copy;
452   GetStruct()->paste = frame_paste;
453   GetStruct()->del = frame_del;
454   GetStruct()->select_all = frame_select_all;
455   GetStruct()->view_source = frame_view_source;
456   GetStruct()->get_source = frame_get_source;
457   GetStruct()->get_text = frame_get_text;
458   GetStruct()->load_request = frame_load_request;
459   GetStruct()->load_url = frame_load_url;
460   GetStruct()->execute_java_script = frame_execute_java_script;
461   GetStruct()->is_main = frame_is_main;
462   GetStruct()->is_focused = frame_is_focused;
463   GetStruct()->get_name = frame_get_name;
464   GetStruct()->get_identifier = frame_get_identifier;
465   GetStruct()->get_parent = frame_get_parent;
466   GetStruct()->get_url = frame_get_url;
467   GetStruct()->get_browser = frame_get_browser;
468   GetStruct()->get_v8context = frame_get_v8context;
469   GetStruct()->visit_dom = frame_visit_dom;
470   GetStruct()->create_urlrequest = frame_create_urlrequest;
471   GetStruct()->send_process_message = frame_send_process_message;
472 }
473 
474 // DESTRUCTOR - Do not edit by hand.
475 
~CefFrameCppToC()476 CefFrameCppToC::~CefFrameCppToC() {
477   shutdown_checker::AssertNotShutdown();
478 }
479 
480 template <>
481 CefRefPtr<CefFrame>
UnwrapDerived(CefWrapperType type,cef_frame_t * s)482 CefCppToCRefCounted<CefFrameCppToC, CefFrame, cef_frame_t>::UnwrapDerived(
483     CefWrapperType type,
484     cef_frame_t* s) {
485   NOTREACHED() << "Unexpected class type: " << type;
486   return nullptr;
487 }
488 
489 template <>
490 CefWrapperType
491     CefCppToCRefCounted<CefFrameCppToC, CefFrame, cef_frame_t>::kWrapperType =
492         WT_FRAME;
493