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