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=de6b935b77168bd9b44f26643c510f360f8b6ebd$
13 //
14
15 #include "libcef_dll/ctocpp/extension_ctocpp.h"
16 #include "libcef_dll/cpptoc/extension_handler_cpptoc.h"
17 #include "libcef_dll/ctocpp/dictionary_value_ctocpp.h"
18 #include "libcef_dll/ctocpp/request_context_ctocpp.h"
19 #include "libcef_dll/shutdown_checker.h"
20
21 // VIRTUAL METHODS - Body may be edited by hand.
22
GetIdentifier()23 NO_SANITIZE("cfi-icall") CefString CefExtensionCToCpp::GetIdentifier() {
24 shutdown_checker::AssertNotShutdown();
25
26 cef_extension_t* _struct = GetStruct();
27 if (CEF_MEMBER_MISSING(_struct, get_identifier))
28 return CefString();
29
30 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
31
32 // Execute
33 cef_string_userfree_t _retval = _struct->get_identifier(_struct);
34
35 // Return type: string
36 CefString _retvalStr;
37 _retvalStr.AttachToUserFree(_retval);
38 return _retvalStr;
39 }
40
GetPath()41 NO_SANITIZE("cfi-icall") CefString CefExtensionCToCpp::GetPath() {
42 shutdown_checker::AssertNotShutdown();
43
44 cef_extension_t* _struct = GetStruct();
45 if (CEF_MEMBER_MISSING(_struct, get_path))
46 return CefString();
47
48 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
49
50 // Execute
51 cef_string_userfree_t _retval = _struct->get_path(_struct);
52
53 // Return type: string
54 CefString _retvalStr;
55 _retvalStr.AttachToUserFree(_retval);
56 return _retvalStr;
57 }
58
59 NO_SANITIZE("cfi-icall")
GetManifest()60 CefRefPtr<CefDictionaryValue> CefExtensionCToCpp::GetManifest() {
61 shutdown_checker::AssertNotShutdown();
62
63 cef_extension_t* _struct = GetStruct();
64 if (CEF_MEMBER_MISSING(_struct, get_manifest))
65 return nullptr;
66
67 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
68
69 // Execute
70 cef_dictionary_value_t* _retval = _struct->get_manifest(_struct);
71
72 // Return type: refptr_same
73 return CefDictionaryValueCToCpp::Wrap(_retval);
74 }
75
76 NO_SANITIZE("cfi-icall")
IsSame(CefRefPtr<CefExtension> that)77 bool CefExtensionCToCpp::IsSame(CefRefPtr<CefExtension> that) {
78 shutdown_checker::AssertNotShutdown();
79
80 cef_extension_t* _struct = GetStruct();
81 if (CEF_MEMBER_MISSING(_struct, is_same))
82 return false;
83
84 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
85
86 // Verify param: that; type: refptr_same
87 DCHECK(that.get());
88 if (!that.get())
89 return false;
90
91 // Execute
92 int _retval = _struct->is_same(_struct, CefExtensionCToCpp::Unwrap(that));
93
94 // Return type: bool
95 return _retval ? true : false;
96 }
97
98 NO_SANITIZE("cfi-icall")
GetHandler()99 CefRefPtr<CefExtensionHandler> CefExtensionCToCpp::GetHandler() {
100 shutdown_checker::AssertNotShutdown();
101
102 cef_extension_t* _struct = GetStruct();
103 if (CEF_MEMBER_MISSING(_struct, get_handler))
104 return nullptr;
105
106 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
107
108 // Execute
109 cef_extension_handler_t* _retval = _struct->get_handler(_struct);
110
111 // Return type: refptr_diff
112 return CefExtensionHandlerCppToC::Unwrap(_retval);
113 }
114
115 NO_SANITIZE("cfi-icall")
GetLoaderContext()116 CefRefPtr<CefRequestContext> CefExtensionCToCpp::GetLoaderContext() {
117 shutdown_checker::AssertNotShutdown();
118
119 cef_extension_t* _struct = GetStruct();
120 if (CEF_MEMBER_MISSING(_struct, get_loader_context))
121 return nullptr;
122
123 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
124
125 // Execute
126 cef_request_context_t* _retval = _struct->get_loader_context(_struct);
127
128 // Return type: refptr_same
129 return CefRequestContextCToCpp::Wrap(_retval);
130 }
131
IsLoaded()132 NO_SANITIZE("cfi-icall") bool CefExtensionCToCpp::IsLoaded() {
133 shutdown_checker::AssertNotShutdown();
134
135 cef_extension_t* _struct = GetStruct();
136 if (CEF_MEMBER_MISSING(_struct, is_loaded))
137 return false;
138
139 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
140
141 // Execute
142 int _retval = _struct->is_loaded(_struct);
143
144 // Return type: bool
145 return _retval ? true : false;
146 }
147
Unload()148 NO_SANITIZE("cfi-icall") void CefExtensionCToCpp::Unload() {
149 shutdown_checker::AssertNotShutdown();
150
151 cef_extension_t* _struct = GetStruct();
152 if (CEF_MEMBER_MISSING(_struct, unload))
153 return;
154
155 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
156
157 // Execute
158 _struct->unload(_struct);
159 }
160
161 // CONSTRUCTOR - Do not edit by hand.
162
CefExtensionCToCpp()163 CefExtensionCToCpp::CefExtensionCToCpp() {}
164
165 // DESTRUCTOR - Do not edit by hand.
166
~CefExtensionCToCpp()167 CefExtensionCToCpp::~CefExtensionCToCpp() {
168 shutdown_checker::AssertNotShutdown();
169 }
170
171 template <>
172 cef_extension_t*
173 CefCToCppRefCounted<CefExtensionCToCpp, CefExtension, cef_extension_t>::
UnwrapDerived(CefWrapperType type,CefExtension * c)174 UnwrapDerived(CefWrapperType type, CefExtension* c) {
175 NOTREACHED() << "Unexpected class type: " << type;
176 return nullptr;
177 }
178
179 template <>
180 CefWrapperType CefCToCppRefCounted<CefExtensionCToCpp,
181 CefExtension,
182 cef_extension_t>::kWrapperType =
183 WT_EXTENSION;
184