• 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=a3fd73f0bc089be47e4ebaf9db033d51bebe1498$
13 //
14 
15 #include "libcef_dll/ctocpp/test/translator_test_scoped_library_ctocpp.h"
16 #include "libcef_dll/ctocpp/test/translator_test_scoped_library_child_child_ctocpp.h"
17 #include "libcef_dll/ctocpp/test/translator_test_scoped_library_child_ctocpp.h"
18 
19 // STATIC METHODS - Body may be edited by hand.
20 
21 NO_SANITIZE("cfi-icall")
22 CefOwnPtr<CefTranslatorTestScopedLibrary>
Create(int value)23 CefTranslatorTestScopedLibrary::Create(int value) {
24   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
25 
26   // Execute
27   cef_translator_test_scoped_library_t* _retval =
28       cef_translator_test_scoped_library_create(value);
29 
30   // Return type: ownptr_same
31   return CefTranslatorTestScopedLibraryCToCpp::Wrap(_retval);
32 }
33 
34 // VIRTUAL METHODS - Body may be edited by hand.
35 
GetValue()36 NO_SANITIZE("cfi-icall") int CefTranslatorTestScopedLibraryCToCpp::GetValue() {
37   cef_translator_test_scoped_library_t* _struct = GetStruct();
38   if (CEF_MEMBER_MISSING(_struct, get_value))
39     return 0;
40 
41   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
42 
43   // Execute
44   int _retval = _struct->get_value(_struct);
45 
46   // Return type: simple
47   return _retval;
48 }
49 
50 NO_SANITIZE("cfi-icall")
SetValue(int value)51 void CefTranslatorTestScopedLibraryCToCpp::SetValue(int value) {
52   cef_translator_test_scoped_library_t* _struct = GetStruct();
53   if (CEF_MEMBER_MISSING(_struct, set_value))
54     return;
55 
56   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
57 
58   // Execute
59   _struct->set_value(_struct, value);
60 }
61 
62 // CONSTRUCTOR - Do not edit by hand.
63 
CefTranslatorTestScopedLibraryCToCpp()64 CefTranslatorTestScopedLibraryCToCpp::CefTranslatorTestScopedLibraryCToCpp() {}
65 
66 // DESTRUCTOR - Do not edit by hand.
67 
~CefTranslatorTestScopedLibraryCToCpp()68 CefTranslatorTestScopedLibraryCToCpp::~CefTranslatorTestScopedLibraryCToCpp() {}
69 
70 template <>
71 cef_translator_test_scoped_library_t*
72 CefCToCppScoped<CefTranslatorTestScopedLibraryCToCpp,
73                 CefTranslatorTestScopedLibrary,
74                 cef_translator_test_scoped_library_t>::
UnwrapDerivedOwn(CefWrapperType type,CefOwnPtr<CefTranslatorTestScopedLibrary> c)75     UnwrapDerivedOwn(CefWrapperType type,
76                      CefOwnPtr<CefTranslatorTestScopedLibrary> c) {
77   if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD) {
78     return reinterpret_cast<cef_translator_test_scoped_library_t*>(
79         CefTranslatorTestScopedLibraryChildCToCpp::UnwrapOwn(
80             CefOwnPtr<CefTranslatorTestScopedLibraryChild>(
81                 reinterpret_cast<CefTranslatorTestScopedLibraryChild*>(
82                     c.release()))));
83   }
84   if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD) {
85     return reinterpret_cast<cef_translator_test_scoped_library_t*>(
86         CefTranslatorTestScopedLibraryChildChildCToCpp::UnwrapOwn(
87             CefOwnPtr<CefTranslatorTestScopedLibraryChildChild>(
88                 reinterpret_cast<CefTranslatorTestScopedLibraryChildChild*>(
89                     c.release()))));
90   }
91   NOTREACHED() << "Unexpected class type: " << type;
92   return nullptr;
93 }
94 
95 template <>
96 cef_translator_test_scoped_library_t*
97 CefCToCppScoped<CefTranslatorTestScopedLibraryCToCpp,
98                 CefTranslatorTestScopedLibrary,
99                 cef_translator_test_scoped_library_t>::
UnwrapDerivedRaw(CefWrapperType type,CefRawPtr<CefTranslatorTestScopedLibrary> c)100     UnwrapDerivedRaw(CefWrapperType type,
101                      CefRawPtr<CefTranslatorTestScopedLibrary> c) {
102   if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD) {
103     return reinterpret_cast<cef_translator_test_scoped_library_t*>(
104         CefTranslatorTestScopedLibraryChildCToCpp::UnwrapRaw(
105             CefRawPtr<CefTranslatorTestScopedLibraryChild>(
106                 reinterpret_cast<CefTranslatorTestScopedLibraryChild*>(c))));
107   }
108   if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD) {
109     return reinterpret_cast<cef_translator_test_scoped_library_t*>(
110         CefTranslatorTestScopedLibraryChildChildCToCpp::UnwrapRaw(
111             CefRawPtr<CefTranslatorTestScopedLibraryChildChild>(
112                 reinterpret_cast<CefTranslatorTestScopedLibraryChildChild*>(
113                     c))));
114   }
115   NOTREACHED() << "Unexpected class type: " << type;
116   return nullptr;
117 }
118 
119 template <>
120 CefWrapperType
121     CefCToCppScoped<CefTranslatorTestScopedLibraryCToCpp,
122                     CefTranslatorTestScopedLibrary,
123                     cef_translator_test_scoped_library_t>::kWrapperType =
124         WT_TRANSLATOR_TEST_SCOPED_LIBRARY;
125