2024-01-05 19:03:36 +01:00
|
|
|
// Copyright (c) 2024 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.
|
|
|
|
//
|
2024-01-05 19:03:36 +01:00
|
|
|
// $hash=566aa0a59d05ac70f53f5938206980f096dbdda5$
|
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);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2016-11-15 22:18:41 +01:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2016-11-15 22:18:41 +01:00
|
|
|
|
|
|
|
// 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);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2016-11-15 22:18:41 +01:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2016-11-15 22:18:41 +01:00
|
|
|
|
|
|
|
// 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);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2016-11-15 22:18:41 +01:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2016-11-15 22:18:41 +01:00
|
|
|
|
|
|
|
// 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);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2016-11-15 22:18:41 +01:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2016-11-15 22:18:41 +01:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefWaitableEventCppToC::Get(self)->Wait();
|
|
|
|
}
|
|
|
|
|
|
|
|
int CEF_CALLBACK waitable_event_timed_wait(struct _cef_waitable_event_t* self,
|
2023-06-01 16:07:20 +02:00
|
|
|
int64_t 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);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2016-11-15 22:18:41 +01:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2016-11-15 22:18:41 +01:00
|
|
|
|
|
|
|
// 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) {
|
2023-05-08 17:15:02 +02:00
|
|
|
DCHECK(false) << "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;
|