2020-01-06 10:59:05 +01:00
|
|
|
// Copyright (c) 2020 The Chromium Embedded Framework Authors. All rights
|
2013-01-03 18:24:24 +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.
|
|
|
|
//
|
2020-01-15 14:53:19 +01:00
|
|
|
// $hash=8653934432648c7d636bc39d14a16a536352241c$
|
2017-05-17 11:29:28 +02:00
|
|
|
//
|
2013-01-03 18:24:24 +01:00
|
|
|
|
|
|
|
#include "libcef_dll/cpptoc/task_runner_cpptoc.h"
|
|
|
|
#include "libcef_dll/ctocpp/task_ctocpp.h"
|
2019-01-23 16:42:12 +01:00
|
|
|
#include "libcef_dll/shutdown_checker.h"
|
2013-01-03 18:24:24 +01:00
|
|
|
|
|
|
|
// GLOBAL FUNCTIONS - Body may be edited by hand.
|
|
|
|
|
|
|
|
CEF_EXPORT cef_task_runner_t* cef_task_runner_get_for_current_thread() {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2013-01-03 18:24:24 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefRefPtr<CefTaskRunner> _retval = CefTaskRunner::GetForCurrentThread();
|
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefTaskRunnerCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
CEF_EXPORT cef_task_runner_t* cef_task_runner_get_for_thread(
|
|
|
|
cef_thread_id_t threadId) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2013-01-03 18:24:24 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
CefRefPtr<CefTaskRunner> _retval = CefTaskRunner::GetForThread(threadId);
|
2013-01-03 18:24:24 +01:00
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefTaskRunnerCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
namespace {
|
|
|
|
|
2013-01-03 18:24:24 +01:00
|
|
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
|
|
|
|
|
|
|
int CEF_CALLBACK task_runner_is_same(struct _cef_task_runner_t* self,
|
2017-05-17 11:29:28 +02:00
|
|
|
struct _cef_task_runner_t* that) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2013-01-03 18:24:24 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return 0;
|
|
|
|
// Verify param: that; type: refptr_same
|
|
|
|
DCHECK(that);
|
|
|
|
if (!that)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
bool _retval =
|
|
|
|
CefTaskRunnerCppToC::Get(self)->IsSame(CefTaskRunnerCppToC::Unwrap(that));
|
2013-01-03 18:24:24 +01:00
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
int CEF_CALLBACK
|
|
|
|
task_runner_belongs_to_current_thread(struct _cef_task_runner_t* self) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2013-01-03 18:24:24 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefTaskRunnerCppToC::Get(self)->BelongsToCurrentThread();
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
int CEF_CALLBACK task_runner_belongs_to_thread(struct _cef_task_runner_t* self,
|
2017-05-17 11:29:28 +02:00
|
|
|
cef_thread_id_t threadId) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2013-01-03 18:24:24 +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 = CefTaskRunnerCppToC::Get(self)->BelongsToThread(threadId);
|
2013-01-03 18:24:24 +01:00
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
int CEF_CALLBACK task_runner_post_task(struct _cef_task_runner_t* self,
|
2017-05-17 11:29:28 +02:00
|
|
|
cef_task_t* task) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2013-01-03 18:24:24 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return 0;
|
|
|
|
// Verify param: task; type: refptr_diff
|
|
|
|
DCHECK(task);
|
|
|
|
if (!task)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
bool _retval =
|
|
|
|
CefTaskRunnerCppToC::Get(self)->PostTask(CefTaskCToCpp::Wrap(task));
|
2013-01-03 18:24:24 +01:00
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
int CEF_CALLBACK task_runner_post_delayed_task(struct _cef_task_runner_t* self,
|
2017-05-17 11:29:28 +02:00
|
|
|
cef_task_t* task,
|
|
|
|
int64 delay_ms) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2013-01-03 18:24:24 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return 0;
|
|
|
|
// Verify param: task; type: refptr_diff
|
|
|
|
DCHECK(task);
|
|
|
|
if (!task)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefTaskRunnerCppToC::Get(self)->PostDelayedTask(
|
2017-05-17 11:29:28 +02:00
|
|
|
CefTaskCToCpp::Wrap(task), delay_ms);
|
2013-01-03 18:24:24 +01:00
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
} // namespace
|
|
|
|
|
2013-01-03 18:24:24 +01:00
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
CefTaskRunnerCppToC::CefTaskRunnerCppToC() {
|
|
|
|
GetStruct()->is_same = task_runner_is_same;
|
|
|
|
GetStruct()->belongs_to_current_thread =
|
2013-01-03 18:24:24 +01:00
|
|
|
task_runner_belongs_to_current_thread;
|
2015-04-26 20:40:01 +02:00
|
|
|
GetStruct()->belongs_to_thread = task_runner_belongs_to_thread;
|
|
|
|
GetStruct()->post_task = task_runner_post_task;
|
|
|
|
GetStruct()->post_delayed_task = task_runner_post_delayed_task;
|
|
|
|
}
|
|
|
|
|
2019-01-23 16:42:12 +01:00
|
|
|
// DESTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefTaskRunnerCppToC::~CefTaskRunnerCppToC() {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
CefRefPtr<CefTaskRunner>
|
|
|
|
CefCppToCRefCounted<CefTaskRunnerCppToC, CefTaskRunner, cef_task_runner_t>::
|
|
|
|
UnwrapDerived(CefWrapperType type, cef_task_runner_t* s) {
|
2015-04-26 20:40:01 +02:00
|
|
|
NOTREACHED() << "Unexpected class type: " << type;
|
2020-01-15 14:53:19 +01:00
|
|
|
return nullptr;
|
2013-01-03 18:24:24 +01:00
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
CefWrapperType CefCppToCRefCounted<CefTaskRunnerCppToC,
|
|
|
|
CefTaskRunner,
|
|
|
|
cef_task_runner_t>::kWrapperType =
|
|
|
|
WT_TASK_RUNNER;
|