• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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=f320ce71f5396e28767dfdb2292c87a8c2396cf8$
13 //
14 
15 #include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.h"
16 #include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.h"
17 #include "libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.h"
18 #include "libcef_dll/shutdown_checker.h"
19 
20 // STATIC METHODS - Body may be edited by hand.
21 
22 NO_SANITIZE("cfi-icall")
23 CefRefPtr<CefTranslatorTestRefPtrLibrary>
Create(int value)24 CefTranslatorTestRefPtrLibrary::Create(int value) {
25   shutdown_checker::AssertNotShutdown();
26 
27   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
28 
29   // Execute
30   cef_translator_test_ref_ptr_library_t* _retval =
31       cef_translator_test_ref_ptr_library_create(value);
32 
33   // Return type: refptr_same
34   return CefTranslatorTestRefPtrLibraryCToCpp::Wrap(_retval);
35 }
36 
37 // VIRTUAL METHODS - Body may be edited by hand.
38 
GetValue()39 NO_SANITIZE("cfi-icall") int CefTranslatorTestRefPtrLibraryCToCpp::GetValue() {
40   shutdown_checker::AssertNotShutdown();
41 
42   cef_translator_test_ref_ptr_library_t* _struct = GetStruct();
43   if (CEF_MEMBER_MISSING(_struct, get_value))
44     return 0;
45 
46   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
47 
48   // Execute
49   int _retval = _struct->get_value(_struct);
50 
51   // Return type: simple
52   return _retval;
53 }
54 
55 NO_SANITIZE("cfi-icall")
SetValue(int value)56 void CefTranslatorTestRefPtrLibraryCToCpp::SetValue(int value) {
57   shutdown_checker::AssertNotShutdown();
58 
59   cef_translator_test_ref_ptr_library_t* _struct = GetStruct();
60   if (CEF_MEMBER_MISSING(_struct, set_value))
61     return;
62 
63   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
64 
65   // Execute
66   _struct->set_value(_struct, value);
67 }
68 
69 // CONSTRUCTOR - Do not edit by hand.
70 
CefTranslatorTestRefPtrLibraryCToCpp()71 CefTranslatorTestRefPtrLibraryCToCpp::CefTranslatorTestRefPtrLibraryCToCpp() {}
72 
73 // DESTRUCTOR - Do not edit by hand.
74 
~CefTranslatorTestRefPtrLibraryCToCpp()75 CefTranslatorTestRefPtrLibraryCToCpp::~CefTranslatorTestRefPtrLibraryCToCpp() {
76   shutdown_checker::AssertNotShutdown();
77 }
78 
79 template <>
80 cef_translator_test_ref_ptr_library_t*
81 CefCToCppRefCounted<CefTranslatorTestRefPtrLibraryCToCpp,
82                     CefTranslatorTestRefPtrLibrary,
83                     cef_translator_test_ref_ptr_library_t>::
UnwrapDerived(CefWrapperType type,CefTranslatorTestRefPtrLibrary * c)84     UnwrapDerived(CefWrapperType type, CefTranslatorTestRefPtrLibrary* c) {
85   if (type == WT_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD) {
86     return reinterpret_cast<cef_translator_test_ref_ptr_library_t*>(
87         CefTranslatorTestRefPtrLibraryChildCToCpp::Unwrap(
88             reinterpret_cast<CefTranslatorTestRefPtrLibraryChild*>(c)));
89   }
90   if (type == WT_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CHILD) {
91     return reinterpret_cast<cef_translator_test_ref_ptr_library_t*>(
92         CefTranslatorTestRefPtrLibraryChildChildCToCpp::Unwrap(
93             reinterpret_cast<CefTranslatorTestRefPtrLibraryChildChild*>(c)));
94   }
95   NOTREACHED() << "Unexpected class type: " << type;
96   return nullptr;
97 }
98 
99 template <>
100 CefWrapperType
101     CefCToCppRefCounted<CefTranslatorTestRefPtrLibraryCToCpp,
102                         CefTranslatorTestRefPtrLibrary,
103                         cef_translator_test_ref_ptr_library_t>::kWrapperType =
104         WT_TRANSLATOR_TEST_REF_PTR_LIBRARY;
105