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=215ecf50a38a26a660ebd9c9784ddba9ef9ac336$ 13 // 14 15 #include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.h" 16 #include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.h" 17 #include "libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.h" 18 #include "libcef_dll/shutdown_checker.h" 19 20 // GLOBAL FUNCTIONS - Body may be edited by hand. 21 22 CEF_EXPORT cef_translator_test_ref_ptr_library_t* cef_translator_test_ref_ptr_library_create(int value)23cef_translator_test_ref_ptr_library_create(int value) { 24 shutdown_checker::AssertNotShutdown(); 25 26 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 27 28 // Execute 29 CefRefPtr<CefTranslatorTestRefPtrLibrary> _retval = 30 CefTranslatorTestRefPtrLibrary::Create(value); 31 32 // Return type: refptr_same 33 return CefTranslatorTestRefPtrLibraryCppToC::Wrap(_retval); 34 } 35 36 namespace { 37 38 // MEMBER FUNCTIONS - Body may be edited by hand. 39 translator_test_ref_ptr_library_get_value(struct _cef_translator_test_ref_ptr_library_t * self)40int CEF_CALLBACK translator_test_ref_ptr_library_get_value( 41 struct _cef_translator_test_ref_ptr_library_t* self) { 42 shutdown_checker::AssertNotShutdown(); 43 44 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 45 46 DCHECK(self); 47 if (!self) 48 return 0; 49 50 // Execute 51 int _retval = CefTranslatorTestRefPtrLibraryCppToC::Get(self)->GetValue(); 52 53 // Return type: simple 54 return _retval; 55 } 56 translator_test_ref_ptr_library_set_value(struct _cef_translator_test_ref_ptr_library_t * self,int value)57void CEF_CALLBACK translator_test_ref_ptr_library_set_value( 58 struct _cef_translator_test_ref_ptr_library_t* self, 59 int value) { 60 shutdown_checker::AssertNotShutdown(); 61 62 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING 63 64 DCHECK(self); 65 if (!self) 66 return; 67 68 // Execute 69 CefTranslatorTestRefPtrLibraryCppToC::Get(self)->SetValue(value); 70 } 71 72 } // namespace 73 74 // CONSTRUCTOR - Do not edit by hand. 75 CefTranslatorTestRefPtrLibraryCppToC()76CefTranslatorTestRefPtrLibraryCppToC::CefTranslatorTestRefPtrLibraryCppToC() { 77 GetStruct()->get_value = translator_test_ref_ptr_library_get_value; 78 GetStruct()->set_value = translator_test_ref_ptr_library_set_value; 79 } 80 81 // DESTRUCTOR - Do not edit by hand. 82 ~CefTranslatorTestRefPtrLibraryCppToC()83CefTranslatorTestRefPtrLibraryCppToC::~CefTranslatorTestRefPtrLibraryCppToC() { 84 shutdown_checker::AssertNotShutdown(); 85 } 86 87 template <> 88 CefRefPtr<CefTranslatorTestRefPtrLibrary> 89 CefCppToCRefCounted<CefTranslatorTestRefPtrLibraryCppToC, 90 CefTranslatorTestRefPtrLibrary, 91 cef_translator_test_ref_ptr_library_t>:: UnwrapDerived(CefWrapperType type,cef_translator_test_ref_ptr_library_t * s)92 UnwrapDerived(CefWrapperType type, 93 cef_translator_test_ref_ptr_library_t* s) { 94 if (type == WT_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD) { 95 return CefTranslatorTestRefPtrLibraryChildCppToC::Unwrap( 96 reinterpret_cast<cef_translator_test_ref_ptr_library_child_t*>(s)); 97 } 98 if (type == WT_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CHILD) { 99 return CefTranslatorTestRefPtrLibraryChildChildCppToC::Unwrap( 100 reinterpret_cast<cef_translator_test_ref_ptr_library_child_child_t*>( 101 s)); 102 } 103 NOTREACHED() << "Unexpected class type: " << type; 104 return nullptr; 105 } 106 107 template <> 108 CefWrapperType 109 CefCppToCRefCounted<CefTranslatorTestRefPtrLibraryCppToC, 110 CefTranslatorTestRefPtrLibrary, 111 cef_translator_test_ref_ptr_library_t>::kWrapperType = 112 WT_TRANSLATOR_TEST_REF_PTR_LIBRARY; 113