• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2021 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=c590e9344004031c7cfe302bcb138635268b1251$
13 //
14 
15 #include "libcef_dll/cpptoc/x509cert_principal_cpptoc.h"
16 #include "libcef_dll/shutdown_checker.h"
17 #include "libcef_dll/transfer_util.h"
18 
19 namespace {
20 
21 // MEMBER FUNCTIONS - Body may be edited by hand.
22 
23 cef_string_userfree_t CEF_CALLBACK
x509cert_principal_get_display_name(struct _cef_x509cert_principal_t * self)24 x509cert_principal_get_display_name(struct _cef_x509cert_principal_t* self) {
25   shutdown_checker::AssertNotShutdown();
26 
27   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
28 
29   DCHECK(self);
30   if (!self)
31     return NULL;
32 
33   // Execute
34   CefString _retval = CefX509CertPrincipalCppToC::Get(self)->GetDisplayName();
35 
36   // Return type: string
37   return _retval.DetachToUserFree();
38 }
39 
40 cef_string_userfree_t CEF_CALLBACK
x509cert_principal_get_common_name(struct _cef_x509cert_principal_t * self)41 x509cert_principal_get_common_name(struct _cef_x509cert_principal_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 NULL;
49 
50   // Execute
51   CefString _retval = CefX509CertPrincipalCppToC::Get(self)->GetCommonName();
52 
53   // Return type: string
54   return _retval.DetachToUserFree();
55 }
56 
57 cef_string_userfree_t CEF_CALLBACK
x509cert_principal_get_locality_name(struct _cef_x509cert_principal_t * self)58 x509cert_principal_get_locality_name(struct _cef_x509cert_principal_t* self) {
59   shutdown_checker::AssertNotShutdown();
60 
61   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
62 
63   DCHECK(self);
64   if (!self)
65     return NULL;
66 
67   // Execute
68   CefString _retval = CefX509CertPrincipalCppToC::Get(self)->GetLocalityName();
69 
70   // Return type: string
71   return _retval.DetachToUserFree();
72 }
73 
74 cef_string_userfree_t CEF_CALLBACK
x509cert_principal_get_state_or_province_name(struct _cef_x509cert_principal_t * self)75 x509cert_principal_get_state_or_province_name(
76     struct _cef_x509cert_principal_t* self) {
77   shutdown_checker::AssertNotShutdown();
78 
79   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
80 
81   DCHECK(self);
82   if (!self)
83     return NULL;
84 
85   // Execute
86   CefString _retval =
87       CefX509CertPrincipalCppToC::Get(self)->GetStateOrProvinceName();
88 
89   // Return type: string
90   return _retval.DetachToUserFree();
91 }
92 
93 cef_string_userfree_t CEF_CALLBACK
x509cert_principal_get_country_name(struct _cef_x509cert_principal_t * self)94 x509cert_principal_get_country_name(struct _cef_x509cert_principal_t* self) {
95   shutdown_checker::AssertNotShutdown();
96 
97   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
98 
99   DCHECK(self);
100   if (!self)
101     return NULL;
102 
103   // Execute
104   CefString _retval = CefX509CertPrincipalCppToC::Get(self)->GetCountryName();
105 
106   // Return type: string
107   return _retval.DetachToUserFree();
108 }
109 
110 void CEF_CALLBACK
x509cert_principal_get_street_addresses(struct _cef_x509cert_principal_t * self,cef_string_list_t addresses)111 x509cert_principal_get_street_addresses(struct _cef_x509cert_principal_t* self,
112                                         cef_string_list_t addresses) {
113   shutdown_checker::AssertNotShutdown();
114 
115   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
116 
117   DCHECK(self);
118   if (!self)
119     return;
120   // Verify param: addresses; type: string_vec_byref
121   DCHECK(addresses);
122   if (!addresses)
123     return;
124 
125   // Translate param: addresses; type: string_vec_byref
126   std::vector<CefString> addressesList;
127   transfer_string_list_contents(addresses, addressesList);
128 
129   // Execute
130   CefX509CertPrincipalCppToC::Get(self)->GetStreetAddresses(addressesList);
131 
132   // Restore param: addresses; type: string_vec_byref
133   cef_string_list_clear(addresses);
134   transfer_string_list_contents(addressesList, addresses);
135 }
136 
x509cert_principal_get_organization_names(struct _cef_x509cert_principal_t * self,cef_string_list_t names)137 void CEF_CALLBACK x509cert_principal_get_organization_names(
138     struct _cef_x509cert_principal_t* self,
139     cef_string_list_t names) {
140   shutdown_checker::AssertNotShutdown();
141 
142   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
143 
144   DCHECK(self);
145   if (!self)
146     return;
147   // Verify param: names; type: string_vec_byref
148   DCHECK(names);
149   if (!names)
150     return;
151 
152   // Translate param: names; type: string_vec_byref
153   std::vector<CefString> namesList;
154   transfer_string_list_contents(names, namesList);
155 
156   // Execute
157   CefX509CertPrincipalCppToC::Get(self)->GetOrganizationNames(namesList);
158 
159   // Restore param: names; type: string_vec_byref
160   cef_string_list_clear(names);
161   transfer_string_list_contents(namesList, names);
162 }
163 
x509cert_principal_get_organization_unit_names(struct _cef_x509cert_principal_t * self,cef_string_list_t names)164 void CEF_CALLBACK x509cert_principal_get_organization_unit_names(
165     struct _cef_x509cert_principal_t* self,
166     cef_string_list_t names) {
167   shutdown_checker::AssertNotShutdown();
168 
169   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
170 
171   DCHECK(self);
172   if (!self)
173     return;
174   // Verify param: names; type: string_vec_byref
175   DCHECK(names);
176   if (!names)
177     return;
178 
179   // Translate param: names; type: string_vec_byref
180   std::vector<CefString> namesList;
181   transfer_string_list_contents(names, namesList);
182 
183   // Execute
184   CefX509CertPrincipalCppToC::Get(self)->GetOrganizationUnitNames(namesList);
185 
186   // Restore param: names; type: string_vec_byref
187   cef_string_list_clear(names);
188   transfer_string_list_contents(namesList, names);
189 }
190 
191 void CEF_CALLBACK
x509cert_principal_get_domain_components(struct _cef_x509cert_principal_t * self,cef_string_list_t components)192 x509cert_principal_get_domain_components(struct _cef_x509cert_principal_t* self,
193                                          cef_string_list_t components) {
194   shutdown_checker::AssertNotShutdown();
195 
196   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
197 
198   DCHECK(self);
199   if (!self)
200     return;
201   // Verify param: components; type: string_vec_byref
202   DCHECK(components);
203   if (!components)
204     return;
205 
206   // Translate param: components; type: string_vec_byref
207   std::vector<CefString> componentsList;
208   transfer_string_list_contents(components, componentsList);
209 
210   // Execute
211   CefX509CertPrincipalCppToC::Get(self)->GetDomainComponents(componentsList);
212 
213   // Restore param: components; type: string_vec_byref
214   cef_string_list_clear(components);
215   transfer_string_list_contents(componentsList, components);
216 }
217 
218 }  // namespace
219 
220 // CONSTRUCTOR - Do not edit by hand.
221 
CefX509CertPrincipalCppToC()222 CefX509CertPrincipalCppToC::CefX509CertPrincipalCppToC() {
223   GetStruct()->get_display_name = x509cert_principal_get_display_name;
224   GetStruct()->get_common_name = x509cert_principal_get_common_name;
225   GetStruct()->get_locality_name = x509cert_principal_get_locality_name;
226   GetStruct()->get_state_or_province_name =
227       x509cert_principal_get_state_or_province_name;
228   GetStruct()->get_country_name = x509cert_principal_get_country_name;
229   GetStruct()->get_street_addresses = x509cert_principal_get_street_addresses;
230   GetStruct()->get_organization_names =
231       x509cert_principal_get_organization_names;
232   GetStruct()->get_organization_unit_names =
233       x509cert_principal_get_organization_unit_names;
234   GetStruct()->get_domain_components = x509cert_principal_get_domain_components;
235 }
236 
237 // DESTRUCTOR - Do not edit by hand.
238 
~CefX509CertPrincipalCppToC()239 CefX509CertPrincipalCppToC::~CefX509CertPrincipalCppToC() {
240   shutdown_checker::AssertNotShutdown();
241 }
242 
243 template <>
244 CefRefPtr<CefX509CertPrincipal> CefCppToCRefCounted<
245     CefX509CertPrincipalCppToC,
246     CefX509CertPrincipal,
UnwrapDerived(CefWrapperType type,cef_x509cert_principal_t * s)247     cef_x509cert_principal_t>::UnwrapDerived(CefWrapperType type,
248                                              cef_x509cert_principal_t* s) {
249   NOTREACHED() << "Unexpected class type: " << type;
250   return nullptr;
251 }
252 
253 template <>
254 CefWrapperType CefCppToCRefCounted<CefX509CertPrincipalCppToC,
255                                    CefX509CertPrincipal,
256                                    cef_x509cert_principal_t>::kWrapperType =
257     WT_X509CERT_PRINCIPAL;
258