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=5ae76b861609dc9f1b0d033dcebf514d8ef68a57$ 13 // 14 15 #include "libcef_dll/cpptoc/extension_cpptoc.h" 16 #include "libcef_dll/cpptoc/dictionary_value_cpptoc.h" 17 #include "libcef_dll/cpptoc/request_context_cpptoc.h" 18 #include "libcef_dll/ctocpp/extension_handler_ctocpp.h" 19 #include "libcef_dll/shutdown_checker.h" 20 21 namespace { 22 23 // MEMBER FUNCTIONS - Body may be edited by hand. 24 25 cef_string_userfree_t CEF_CALLBACK extension_get_identifier(struct _cef_extension_t * self)26extension_get_identifier(struct _cef_extension_t* self) { 27 shutdown_checker::AssertNotShutdown(); 28 29 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 30 31 DCHECK(self); 32 if (!self) 33 return NULL; 34 35 // Execute 36 CefString _retval = CefExtensionCppToC::Get(self)->GetIdentifier(); 37 38 // Return type: string 39 return _retval.DetachToUserFree(); 40 } 41 42 cef_string_userfree_t CEF_CALLBACK extension_get_path(struct _cef_extension_t * self)43extension_get_path(struct _cef_extension_t* self) { 44 shutdown_checker::AssertNotShutdown(); 45 46 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 47 48 DCHECK(self); 49 if (!self) 50 return NULL; 51 52 // Execute 53 CefString _retval = CefExtensionCppToC::Get(self)->GetPath(); 54 55 // Return type: string 56 return _retval.DetachToUserFree(); 57 } 58 59 struct _cef_dictionary_value_t* CEF_CALLBACK extension_get_manifest(struct _cef_extension_t * self)60extension_get_manifest(struct _cef_extension_t* self) { 61 shutdown_checker::AssertNotShutdown(); 62 63 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 64 65 DCHECK(self); 66 if (!self) 67 return NULL; 68 69 // Execute 70 CefRefPtr<CefDictionaryValue> _retval = 71 CefExtensionCppToC::Get(self)->GetManifest(); 72 73 // Return type: refptr_same 74 return CefDictionaryValueCppToC::Wrap(_retval); 75 } 76 extension_is_same(struct _cef_extension_t * self,struct _cef_extension_t * that)77int CEF_CALLBACK extension_is_same(struct _cef_extension_t* self, 78 struct _cef_extension_t* that) { 79 shutdown_checker::AssertNotShutdown(); 80 81 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 82 83 DCHECK(self); 84 if (!self) 85 return 0; 86 // Verify param: that; type: refptr_same 87 DCHECK(that); 88 if (!that) 89 return 0; 90 91 // Execute 92 bool _retval = 93 CefExtensionCppToC::Get(self)->IsSame(CefExtensionCppToC::Unwrap(that)); 94 95 // Return type: bool 96 return _retval; 97 } 98 99 struct _cef_extension_handler_t* CEF_CALLBACK extension_get_handler(struct _cef_extension_t * self)100extension_get_handler(struct _cef_extension_t* self) { 101 shutdown_checker::AssertNotShutdown(); 102 103 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 104 105 DCHECK(self); 106 if (!self) 107 return NULL; 108 109 // Execute 110 CefRefPtr<CefExtensionHandler> _retval = 111 CefExtensionCppToC::Get(self)->GetHandler(); 112 113 // Return type: refptr_diff 114 return CefExtensionHandlerCToCpp::Unwrap(_retval); 115 } 116 117 struct _cef_request_context_t* CEF_CALLBACK extension_get_loader_context(struct _cef_extension_t * self)118extension_get_loader_context(struct _cef_extension_t* self) { 119 shutdown_checker::AssertNotShutdown(); 120 121 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 122 123 DCHECK(self); 124 if (!self) 125 return NULL; 126 127 // Execute 128 CefRefPtr<CefRequestContext> _retval = 129 CefExtensionCppToC::Get(self)->GetLoaderContext(); 130 131 // Return type: refptr_same 132 return CefRequestContextCppToC::Wrap(_retval); 133 } 134 extension_is_loaded(struct _cef_extension_t * self)135int CEF_CALLBACK extension_is_loaded(struct _cef_extension_t* self) { 136 shutdown_checker::AssertNotShutdown(); 137 138 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 139 140 DCHECK(self); 141 if (!self) 142 return 0; 143 144 // Execute 145 bool _retval = CefExtensionCppToC::Get(self)->IsLoaded(); 146 147 // Return type: bool 148 return _retval; 149 } 150 extension_unload(struct _cef_extension_t * self)151void CEF_CALLBACK extension_unload(struct _cef_extension_t* self) { 152 shutdown_checker::AssertNotShutdown(); 153 154 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 155 156 DCHECK(self); 157 if (!self) 158 return; 159 160 // Execute 161 CefExtensionCppToC::Get(self)->Unload(); 162 } 163 164 } // namespace 165 166 // CONSTRUCTOR - Do not edit by hand. 167 CefExtensionCppToC()168CefExtensionCppToC::CefExtensionCppToC() { 169 GetStruct()->get_identifier = extension_get_identifier; 170 GetStruct()->get_path = extension_get_path; 171 GetStruct()->get_manifest = extension_get_manifest; 172 GetStruct()->is_same = extension_is_same; 173 GetStruct()->get_handler = extension_get_handler; 174 GetStruct()->get_loader_context = extension_get_loader_context; 175 GetStruct()->is_loaded = extension_is_loaded; 176 GetStruct()->unload = extension_unload; 177 } 178 179 // DESTRUCTOR - Do not edit by hand. 180 ~CefExtensionCppToC()181CefExtensionCppToC::~CefExtensionCppToC() { 182 shutdown_checker::AssertNotShutdown(); 183 } 184 185 template <> 186 CefRefPtr<CefExtension> 187 CefCppToCRefCounted<CefExtensionCppToC, CefExtension, cef_extension_t>:: UnwrapDerived(CefWrapperType type,cef_extension_t * s)188 UnwrapDerived(CefWrapperType type, cef_extension_t* s) { 189 NOTREACHED() << "Unexpected class type: " << type; 190 return nullptr; 191 } 192 193 template <> 194 CefWrapperType CefCppToCRefCounted<CefExtensionCppToC, 195 CefExtension, 196 cef_extension_t>::kWrapperType = 197 WT_EXTENSION; 198