2019-01-10 15:22:19 +01:00
|
|
|
// Copyright (c) 2019 The Chromium Embedded Framework Authors. All rights
|
2016-11-12 00:22:53 +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.
|
|
|
|
//
|
2019-01-23 17:10:23 +01:00
|
|
|
// $hash=89c3ea8c5830bff809f0d6235dd8ee808d25afa1$
|
2017-05-17 11:29:28 +02:00
|
|
|
//
|
2016-11-12 00:22:53 +01:00
|
|
|
|
|
|
|
#include "libcef_dll/cpptoc/thread_cpptoc.h"
|
2017-05-19 11:06:00 +02:00
|
|
|
#include "libcef_dll/cpptoc/task_runner_cpptoc.h"
|
2019-01-23 16:42:12 +01:00
|
|
|
#include "libcef_dll/shutdown_checker.h"
|
2016-11-12 00:22:53 +01:00
|
|
|
|
|
|
|
// GLOBAL FUNCTIONS - Body may be edited by hand.
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
CEF_EXPORT cef_thread_t* cef_thread_create(
|
|
|
|
const cef_string_t* display_name,
|
|
|
|
cef_thread_priority_t priority,
|
|
|
|
cef_message_loop_type_t message_loop_type,
|
|
|
|
int stoppable,
|
|
|
|
cef_com_init_mode_t com_init_mode) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2016-11-12 00:22:53 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Unverified params: display_name
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefRefPtr<CefThread> _retval = CefThread::CreateThread(
|
2017-05-17 11:29:28 +02:00
|
|
|
CefString(display_name), priority, message_loop_type,
|
|
|
|
stoppable ? true : false, com_init_mode);
|
2016-11-12 00:22:53 +01:00
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefThreadCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
cef_task_runner_t* CEF_CALLBACK
|
|
|
|
thread_get_task_runner(struct _cef_thread_t* self) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2016-11-12 00:22:53 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
CefRefPtr<CefTaskRunner> _retval =
|
|
|
|
CefThreadCppToC::Get(self)->GetTaskRunner();
|
2016-11-12 00:22:53 +01:00
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefTaskRunnerCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
cef_platform_thread_id_t CEF_CALLBACK
|
|
|
|
thread_get_platform_thread_id(struct _cef_thread_t* self) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2016-11-12 00:22:53 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return kInvalidPlatformThreadId;
|
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
cef_platform_thread_id_t _retval =
|
|
|
|
CefThreadCppToC::Get(self)->GetPlatformThreadId();
|
2016-11-12 00:22:53 +01:00
|
|
|
|
|
|
|
// Return type: simple
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK thread_stop(struct _cef_thread_t* self) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2016-11-12 00:22:53 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefThreadCppToC::Get(self)->Stop();
|
|
|
|
}
|
|
|
|
|
|
|
|
int CEF_CALLBACK thread_is_running(struct _cef_thread_t* self) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2016-11-12 00:22:53 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefThreadCppToC::Get(self)->IsRunning();
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefThreadCppToC::CefThreadCppToC() {
|
|
|
|
GetStruct()->get_task_runner = thread_get_task_runner;
|
|
|
|
GetStruct()->get_platform_thread_id = thread_get_platform_thread_id;
|
|
|
|
GetStruct()->stop = thread_stop;
|
|
|
|
GetStruct()->is_running = thread_is_running;
|
|
|
|
}
|
|
|
|
|
2019-01-23 16:42:12 +01:00
|
|
|
// DESTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefThreadCppToC::~CefThreadCppToC() {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
CefRefPtr<CefThread>
|
|
|
|
CefCppToCRefCounted<CefThreadCppToC, CefThread, cef_thread_t>::UnwrapDerived(
|
|
|
|
CefWrapperType type,
|
|
|
|
cef_thread_t* s) {
|
2016-11-12 00:22:53 +01:00
|
|
|
NOTREACHED() << "Unexpected class type: " << type;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
CefWrapperType CefCppToCRefCounted<CefThreadCppToC, CefThread, cef_thread_t>::
|
|
|
|
kWrapperType = WT_THREAD;
|