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=c4e54b985b45c9cf57f70a3c560fb1d6c5230f9a$
13 //
14
15 #include "libcef_dll/ctocpp/task_runner_ctocpp.h"
16 #include "libcef_dll/cpptoc/task_cpptoc.h"
17 #include "libcef_dll/shutdown_checker.h"
18
19 // STATIC METHODS - Body may be edited by hand.
20
21 NO_SANITIZE("cfi-icall")
GetForCurrentThread()22 CefRefPtr<CefTaskRunner> CefTaskRunner::GetForCurrentThread() {
23 shutdown_checker::AssertNotShutdown();
24
25 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
26
27 // Execute
28 cef_task_runner_t* _retval = cef_task_runner_get_for_current_thread();
29
30 // Return type: refptr_same
31 return CefTaskRunnerCToCpp::Wrap(_retval);
32 }
33
34 NO_SANITIZE("cfi-icall")
GetForThread(CefThreadId threadId)35 CefRefPtr<CefTaskRunner> CefTaskRunner::GetForThread(CefThreadId threadId) {
36 shutdown_checker::AssertNotShutdown();
37
38 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
39
40 // Execute
41 cef_task_runner_t* _retval = cef_task_runner_get_for_thread(threadId);
42
43 // Return type: refptr_same
44 return CefTaskRunnerCToCpp::Wrap(_retval);
45 }
46
47 // VIRTUAL METHODS - Body may be edited by hand.
48
49 NO_SANITIZE("cfi-icall")
IsSame(CefRefPtr<CefTaskRunner> that)50 bool CefTaskRunnerCToCpp::IsSame(CefRefPtr<CefTaskRunner> that) {
51 shutdown_checker::AssertNotShutdown();
52
53 cef_task_runner_t* _struct = GetStruct();
54 if (CEF_MEMBER_MISSING(_struct, is_same))
55 return false;
56
57 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
58
59 // Verify param: that; type: refptr_same
60 DCHECK(that.get());
61 if (!that.get())
62 return false;
63
64 // Execute
65 int _retval = _struct->is_same(_struct, CefTaskRunnerCToCpp::Unwrap(that));
66
67 // Return type: bool
68 return _retval ? true : false;
69 }
70
BelongsToCurrentThread()71 NO_SANITIZE("cfi-icall") bool CefTaskRunnerCToCpp::BelongsToCurrentThread() {
72 shutdown_checker::AssertNotShutdown();
73
74 cef_task_runner_t* _struct = GetStruct();
75 if (CEF_MEMBER_MISSING(_struct, belongs_to_current_thread))
76 return false;
77
78 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
79
80 // Execute
81 int _retval = _struct->belongs_to_current_thread(_struct);
82
83 // Return type: bool
84 return _retval ? true : false;
85 }
86
87 NO_SANITIZE("cfi-icall")
BelongsToThread(CefThreadId threadId)88 bool CefTaskRunnerCToCpp::BelongsToThread(CefThreadId threadId) {
89 shutdown_checker::AssertNotShutdown();
90
91 cef_task_runner_t* _struct = GetStruct();
92 if (CEF_MEMBER_MISSING(_struct, belongs_to_thread))
93 return false;
94
95 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
96
97 // Execute
98 int _retval = _struct->belongs_to_thread(_struct, threadId);
99
100 // Return type: bool
101 return _retval ? true : false;
102 }
103
104 NO_SANITIZE("cfi-icall")
PostTask(CefRefPtr<CefTask> task)105 bool CefTaskRunnerCToCpp::PostTask(CefRefPtr<CefTask> task) {
106 shutdown_checker::AssertNotShutdown();
107
108 cef_task_runner_t* _struct = GetStruct();
109 if (CEF_MEMBER_MISSING(_struct, post_task))
110 return false;
111
112 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
113
114 // Verify param: task; type: refptr_diff
115 DCHECK(task.get());
116 if (!task.get())
117 return false;
118
119 // Execute
120 int _retval = _struct->post_task(_struct, CefTaskCppToC::Wrap(task));
121
122 // Return type: bool
123 return _retval ? true : false;
124 }
125
126 NO_SANITIZE("cfi-icall")
PostDelayedTask(CefRefPtr<CefTask> task,int64 delay_ms)127 bool CefTaskRunnerCToCpp::PostDelayedTask(CefRefPtr<CefTask> task,
128 int64 delay_ms) {
129 shutdown_checker::AssertNotShutdown();
130
131 cef_task_runner_t* _struct = GetStruct();
132 if (CEF_MEMBER_MISSING(_struct, post_delayed_task))
133 return false;
134
135 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
136
137 // Verify param: task; type: refptr_diff
138 DCHECK(task.get());
139 if (!task.get())
140 return false;
141
142 // Execute
143 int _retval =
144 _struct->post_delayed_task(_struct, CefTaskCppToC::Wrap(task), delay_ms);
145
146 // Return type: bool
147 return _retval ? true : false;
148 }
149
150 // CONSTRUCTOR - Do not edit by hand.
151
CefTaskRunnerCToCpp()152 CefTaskRunnerCToCpp::CefTaskRunnerCToCpp() {}
153
154 // DESTRUCTOR - Do not edit by hand.
155
~CefTaskRunnerCToCpp()156 CefTaskRunnerCToCpp::~CefTaskRunnerCToCpp() {
157 shutdown_checker::AssertNotShutdown();
158 }
159
160 template <>
161 cef_task_runner_t*
162 CefCToCppRefCounted<CefTaskRunnerCToCpp, CefTaskRunner, cef_task_runner_t>::
UnwrapDerived(CefWrapperType type,CefTaskRunner * c)163 UnwrapDerived(CefWrapperType type, CefTaskRunner* c) {
164 NOTREACHED() << "Unexpected class type: " << type;
165 return nullptr;
166 }
167
168 template <>
169 CefWrapperType CefCToCppRefCounted<CefTaskRunnerCToCpp,
170 CefTaskRunner,
171 cef_task_runner_t>::kWrapperType =
172 WT_TASK_RUNNER;
173