• 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=4d16f6afcc06cee186ba3aa5752dc5933e6b57f4$
13 //
14 
15 #include "libcef_dll/ctocpp/waitable_event_ctocpp.h"
16 #include "libcef_dll/shutdown_checker.h"
17 
18 // STATIC METHODS - Body may be edited by hand.
19 
20 NO_SANITIZE("cfi-icall")
CreateWaitableEvent(bool automatic_reset,bool initially_signaled)21 CefRefPtr<CefWaitableEvent> CefWaitableEvent::CreateWaitableEvent(
22     bool automatic_reset,
23     bool initially_signaled) {
24   shutdown_checker::AssertNotShutdown();
25 
26   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
27 
28   // Execute
29   cef_waitable_event_t* _retval =
30       cef_waitable_event_create(automatic_reset, initially_signaled);
31 
32   // Return type: refptr_same
33   return CefWaitableEventCToCpp::Wrap(_retval);
34 }
35 
36 // VIRTUAL METHODS - Body may be edited by hand.
37 
Reset()38 NO_SANITIZE("cfi-icall") void CefWaitableEventCToCpp::Reset() {
39   shutdown_checker::AssertNotShutdown();
40 
41   cef_waitable_event_t* _struct = GetStruct();
42   if (CEF_MEMBER_MISSING(_struct, reset))
43     return;
44 
45   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
46 
47   // Execute
48   _struct->reset(_struct);
49 }
50 
Signal()51 NO_SANITIZE("cfi-icall") void CefWaitableEventCToCpp::Signal() {
52   shutdown_checker::AssertNotShutdown();
53 
54   cef_waitable_event_t* _struct = GetStruct();
55   if (CEF_MEMBER_MISSING(_struct, signal))
56     return;
57 
58   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
59 
60   // Execute
61   _struct->signal(_struct);
62 }
63 
IsSignaled()64 NO_SANITIZE("cfi-icall") bool CefWaitableEventCToCpp::IsSignaled() {
65   shutdown_checker::AssertNotShutdown();
66 
67   cef_waitable_event_t* _struct = GetStruct();
68   if (CEF_MEMBER_MISSING(_struct, is_signaled))
69     return false;
70 
71   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
72 
73   // Execute
74   int _retval = _struct->is_signaled(_struct);
75 
76   // Return type: bool
77   return _retval ? true : false;
78 }
79 
Wait()80 NO_SANITIZE("cfi-icall") void CefWaitableEventCToCpp::Wait() {
81   shutdown_checker::AssertNotShutdown();
82 
83   cef_waitable_event_t* _struct = GetStruct();
84   if (CEF_MEMBER_MISSING(_struct, wait))
85     return;
86 
87   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
88 
89   // Execute
90   _struct->wait(_struct);
91 }
92 
TimedWait(int64 max_ms)93 NO_SANITIZE("cfi-icall") bool CefWaitableEventCToCpp::TimedWait(int64 max_ms) {
94   shutdown_checker::AssertNotShutdown();
95 
96   cef_waitable_event_t* _struct = GetStruct();
97   if (CEF_MEMBER_MISSING(_struct, timed_wait))
98     return false;
99 
100   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
101 
102   // Execute
103   int _retval = _struct->timed_wait(_struct, max_ms);
104 
105   // Return type: bool
106   return _retval ? true : false;
107 }
108 
109 // CONSTRUCTOR - Do not edit by hand.
110 
CefWaitableEventCToCpp()111 CefWaitableEventCToCpp::CefWaitableEventCToCpp() {}
112 
113 // DESTRUCTOR - Do not edit by hand.
114 
~CefWaitableEventCToCpp()115 CefWaitableEventCToCpp::~CefWaitableEventCToCpp() {
116   shutdown_checker::AssertNotShutdown();
117 }
118 
119 template <>
120 cef_waitable_event_t*
121 CefCToCppRefCounted<CefWaitableEventCToCpp,
122                     CefWaitableEvent,
UnwrapDerived(CefWrapperType type,CefWaitableEvent * c)123                     cef_waitable_event_t>::UnwrapDerived(CefWrapperType type,
124                                                          CefWaitableEvent* c) {
125   NOTREACHED() << "Unexpected class type: " << type;
126   return nullptr;
127 }
128 
129 template <>
130 CefWrapperType CefCToCppRefCounted<CefWaitableEventCToCpp,
131                                    CefWaitableEvent,
132                                    cef_waitable_event_t>::kWrapperType =
133     WT_WAITABLE_EVENT;
134