1 // Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
2 // reserved. Use of this source code is governed by a BSD-style license that
3 // can be found in the LICENSE file.
4 //
5 // ---------------------------------------------------------------------------
6 //
7 // This file was generated by the CEF translator tool. If making changes by
8 // hand only do so within the body of existing method and function
9 // implementations. See the translator.README.txt file in the tools directory
10 // for more information.
11 //
12 // $hash=207fe292d5fec167e20971c9948d0b183e6b3b20$
13 //
14
15 #include "libcef_dll/ctocpp/thread_ctocpp.h"
16 #include "libcef_dll/ctocpp/task_runner_ctocpp.h"
17 #include "libcef_dll/shutdown_checker.h"
18
19 // STATIC METHODS - Body may be edited by hand.
20
21 NO_SANITIZE("cfi-icall")
CreateThread(const CefString & display_name,cef_thread_priority_t priority,cef_message_loop_type_t message_loop_type,bool stoppable,cef_com_init_mode_t com_init_mode)22 CefRefPtr<CefThread> CefThread::CreateThread(
23 const CefString& display_name,
24 cef_thread_priority_t priority,
25 cef_message_loop_type_t message_loop_type,
26 bool stoppable,
27 cef_com_init_mode_t com_init_mode) {
28 shutdown_checker::AssertNotShutdown();
29
30 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
31
32 // Unverified params: display_name
33
34 // Execute
35 cef_thread_t* _retval =
36 cef_thread_create(display_name.GetStruct(), priority, message_loop_type,
37 stoppable, com_init_mode);
38
39 // Return type: refptr_same
40 return CefThreadCToCpp::Wrap(_retval);
41 }
42
43 // VIRTUAL METHODS - Body may be edited by hand.
44
45 NO_SANITIZE("cfi-icall")
GetTaskRunner()46 CefRefPtr<CefTaskRunner> CefThreadCToCpp::GetTaskRunner() {
47 shutdown_checker::AssertNotShutdown();
48
49 cef_thread_t* _struct = GetStruct();
50 if (CEF_MEMBER_MISSING(_struct, get_task_runner))
51 return nullptr;
52
53 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
54
55 // Execute
56 cef_task_runner_t* _retval = _struct->get_task_runner(_struct);
57
58 // Return type: refptr_same
59 return CefTaskRunnerCToCpp::Wrap(_retval);
60 }
61
62 NO_SANITIZE("cfi-icall")
GetPlatformThreadId()63 cef_platform_thread_id_t CefThreadCToCpp::GetPlatformThreadId() {
64 shutdown_checker::AssertNotShutdown();
65
66 cef_thread_t* _struct = GetStruct();
67 if (CEF_MEMBER_MISSING(_struct, get_platform_thread_id))
68 return kInvalidPlatformThreadId;
69
70 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
71
72 // Execute
73 cef_platform_thread_id_t _retval = _struct->get_platform_thread_id(_struct);
74
75 // Return type: simple
76 return _retval;
77 }
78
Stop()79 NO_SANITIZE("cfi-icall") void CefThreadCToCpp::Stop() {
80 shutdown_checker::AssertNotShutdown();
81
82 cef_thread_t* _struct = GetStruct();
83 if (CEF_MEMBER_MISSING(_struct, stop))
84 return;
85
86 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
87
88 // Execute
89 _struct->stop(_struct);
90 }
91
IsRunning()92 NO_SANITIZE("cfi-icall") bool CefThreadCToCpp::IsRunning() {
93 shutdown_checker::AssertNotShutdown();
94
95 cef_thread_t* _struct = GetStruct();
96 if (CEF_MEMBER_MISSING(_struct, is_running))
97 return false;
98
99 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
100
101 // Execute
102 int _retval = _struct->is_running(_struct);
103
104 // Return type: bool
105 return _retval ? true : false;
106 }
107
108 // CONSTRUCTOR - Do not edit by hand.
109
CefThreadCToCpp()110 CefThreadCToCpp::CefThreadCToCpp() {}
111
112 // DESTRUCTOR - Do not edit by hand.
113
~CefThreadCToCpp()114 CefThreadCToCpp::~CefThreadCToCpp() {
115 shutdown_checker::AssertNotShutdown();
116 }
117
118 template <>
119 cef_thread_t*
UnwrapDerived(CefWrapperType type,CefThread * c)120 CefCToCppRefCounted<CefThreadCToCpp, CefThread, cef_thread_t>::UnwrapDerived(
121 CefWrapperType type,
122 CefThread* c) {
123 NOTREACHED() << "Unexpected class type: " << type;
124 return nullptr;
125 }
126
127 template <>
128 CefWrapperType CefCToCppRefCounted<CefThreadCToCpp, CefThread, cef_thread_t>::
129 kWrapperType = WT_THREAD;
130