#include "libcef_dll/ctocpp/waitable_event_ctocpp.h"
#include "libcef_dll/shutdown_checker.h"
NO_SANITIZE("cfi-icall")
CefRefPtr<CefWaitableEvent> CefWaitableEvent::CreateWaitableEvent(
bool automatic_reset,
bool initially_signaled) {
shutdown_checker::AssertNotShutdown();
cef_waitable_event_t* _retval =
cef_waitable_event_create(automatic_reset, initially_signaled);
return CefWaitableEventCToCpp::Wrap(_retval);
}
NO_SANITIZE("cfi-icall") void CefWaitableEventCToCpp::Reset() {
shutdown_checker::AssertNotShutdown();
cef_waitable_event_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, reset))
return;
_struct->reset(_struct);
}
NO_SANITIZE("cfi-icall") void CefWaitableEventCToCpp::Signal() {
shutdown_checker::AssertNotShutdown();
cef_waitable_event_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, signal))
return;
_struct->signal(_struct);
}
NO_SANITIZE("cfi-icall") bool CefWaitableEventCToCpp::IsSignaled() {
shutdown_checker::AssertNotShutdown();
cef_waitable_event_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, is_signaled))
return false;
int _retval = _struct->is_signaled(_struct);
return _retval ? true : false;
}
NO_SANITIZE("cfi-icall") void CefWaitableEventCToCpp::Wait() {
shutdown_checker::AssertNotShutdown();
cef_waitable_event_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, wait))
return;
_struct->wait(_struct);
}
NO_SANITIZE("cfi-icall") bool CefWaitableEventCToCpp::TimedWait(int64 max_ms) {
shutdown_checker::AssertNotShutdown();
cef_waitable_event_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, timed_wait))
return false;
int _retval = _struct->timed_wait(_struct, max_ms);
return _retval ? true : false;
}
CefWaitableEventCToCpp::CefWaitableEventCToCpp() {}
CefWaitableEventCToCpp::~CefWaitableEventCToCpp() {
shutdown_checker::AssertNotShutdown();
}
template <>
cef_waitable_event_t*
CefCToCppRefCounted<CefWaitableEventCToCpp,
CefWaitableEvent,
cef_waitable_event_t>::UnwrapDerived(CefWrapperType type,
CefWaitableEvent* c) {
NOTREACHED() << "Unexpected class type: " << type;
return nullptr;
}
template <>
CefWrapperType CefCToCppRefCounted<CefWaitableEventCToCpp,
CefWaitableEvent,
cef_waitable_event_t>::kWrapperType =
WT_WAITABLE_EVENT;