2022-01-06 19:34:35 +01:00
|
|
|
// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
|
2016-11-15 22:18:41 +01:00
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that
|
|
|
|
// can be found in the LICENSE file.
|
|
|
|
//
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// This file was generated by the CEF translator tool. If making changes by
|
|
|
|
// hand only do so within the body of existing method and function
|
|
|
|
// implementations. See the translator.README.txt file in the tools directory
|
|
|
|
// for more information.
|
|
|
|
//
|
2022-01-06 19:34:35 +01:00
|
|
|
// $hash=ea0c4c4d8c202a47a9b5b63a57525dc726c1e40e$
|
2017-05-17 11:29:28 +02:00
|
|
|
//
|
2016-11-15 22:18:41 +01:00
|
|
|
|
|
|
|
#include "libcef_dll/cpptoc/waitable_event_cpptoc.h"
|
2019-01-23 16:42:12 +01:00
|
|
|
#include "libcef_dll/shutdown_checker.h"
|
2016-11-15 22:18:41 +01:00
|
|
|
|
|
|
|
// GLOBAL FUNCTIONS - Body may be edited by hand.
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
CEF_EXPORT cef_waitable_event_t* cef_waitable_event_create(
|
|
|
|
int automatic_reset,
|
2016-11-15 22:18:41 +01:00
|
|
|
int initially_signaled) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2016-11-15 22:18:41 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefRefPtr<CefWaitableEvent> _retval = CefWaitableEvent::CreateWaitableEvent(
|
2017-05-17 11:29:28 +02:00
|
|
|
automatic_reset ? true : false, initially_signaled ? true : false);
|
2016-11-15 22:18:41 +01:00
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefWaitableEventCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
|
|
|
|
|
|
|
void CEF_CALLBACK waitable_event_reset(struct _cef_waitable_event_t* self) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2016-11-15 22:18:41 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefWaitableEventCppToC::Get(self)->Reset();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK waitable_event_signal(struct _cef_waitable_event_t* self) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2016-11-15 22:18:41 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefWaitableEventCppToC::Get(self)->Signal();
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
int CEF_CALLBACK
|
|
|
|
waitable_event_is_signaled(struct _cef_waitable_event_t* self) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2016-11-15 22:18:41 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefWaitableEventCppToC::Get(self)->IsSignaled();
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK waitable_event_wait(struct _cef_waitable_event_t* self) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2016-11-15 22:18:41 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefWaitableEventCppToC::Get(self)->Wait();
|
|
|
|
}
|
|
|
|
|
|
|
|
int CEF_CALLBACK waitable_event_timed_wait(struct _cef_waitable_event_t* self,
|
2017-05-17 11:29:28 +02:00
|
|
|
int64 max_ms) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2016-11-15 22:18:41 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
bool _retval = CefWaitableEventCppToC::Get(self)->TimedWait(max_ms);
|
2016-11-15 22:18:41 +01:00
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefWaitableEventCppToC::CefWaitableEventCppToC() {
|
|
|
|
GetStruct()->reset = waitable_event_reset;
|
|
|
|
GetStruct()->signal = waitable_event_signal;
|
|
|
|
GetStruct()->is_signaled = waitable_event_is_signaled;
|
|
|
|
GetStruct()->wait = waitable_event_wait;
|
|
|
|
GetStruct()->timed_wait = waitable_event_timed_wait;
|
|
|
|
}
|
|
|
|
|
2019-01-23 16:42:12 +01:00
|
|
|
// DESTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefWaitableEventCppToC::~CefWaitableEventCppToC() {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
CefRefPtr<CefWaitableEvent> CefCppToCRefCounted<
|
|
|
|
CefWaitableEventCppToC,
|
|
|
|
CefWaitableEvent,
|
|
|
|
cef_waitable_event_t>::UnwrapDerived(CefWrapperType type,
|
|
|
|
cef_waitable_event_t* s) {
|
2016-11-15 22:18:41 +01:00
|
|
|
NOTREACHED() << "Unexpected class type: " << type;
|
2020-01-15 14:53:19 +01:00
|
|
|
return nullptr;
|
2016-11-15 22:18:41 +01:00
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
CefWrapperType CefCppToCRefCounted<CefWaitableEventCppToC,
|
|
|
|
CefWaitableEvent,
|
|
|
|
cef_waitable_event_t>::kWrapperType =
|
|
|
|
WT_WAITABLE_EVENT;
|