• 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=e675ed75d36a3ce409ed3131229fb591f7e1a05a$
13 //
14 
15 #include "libcef_dll/ctocpp/cookie_manager_ctocpp.h"
16 #include "libcef_dll/cpptoc/completion_callback_cpptoc.h"
17 #include "libcef_dll/cpptoc/cookie_visitor_cpptoc.h"
18 #include "libcef_dll/cpptoc/delete_cookies_callback_cpptoc.h"
19 #include "libcef_dll/cpptoc/set_cookie_callback_cpptoc.h"
20 
21 // STATIC METHODS - Body may be edited by hand.
22 
23 NO_SANITIZE("cfi-icall")
GetGlobalManager(CefRefPtr<CefCompletionCallback> callback)24 CefRefPtr<CefCookieManager> CefCookieManager::GetGlobalManager(
25     CefRefPtr<CefCompletionCallback> callback) {
26   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
27 
28   // Unverified params: callback
29 
30   // Execute
31   cef_cookie_manager_t* _retval = cef_cookie_manager_get_global_manager(
32       CefCompletionCallbackCppToC::Wrap(callback));
33 
34   // Return type: refptr_same
35   return CefCookieManagerCToCpp::Wrap(_retval);
36 }
37 
38 // VIRTUAL METHODS - Body may be edited by hand.
39 
40 NO_SANITIZE("cfi-icall")
VisitAllCookies(CefRefPtr<CefCookieVisitor> visitor)41 bool CefCookieManagerCToCpp::VisitAllCookies(
42     CefRefPtr<CefCookieVisitor> visitor) {
43   cef_cookie_manager_t* _struct = GetStruct();
44   if (CEF_MEMBER_MISSING(_struct, visit_all_cookies))
45     return false;
46 
47   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
48 
49   // Verify param: visitor; type: refptr_diff
50   DCHECK(visitor.get());
51   if (!visitor.get())
52     return false;
53 
54   // Execute
55   int _retval = _struct->visit_all_cookies(
56       _struct, CefCookieVisitorCppToC::Wrap(visitor));
57 
58   // Return type: bool
59   return _retval ? true : false;
60 }
61 
62 NO_SANITIZE("cfi-icall")
VisitUrlCookies(const CefString & url,bool includeHttpOnly,CefRefPtr<CefCookieVisitor> visitor)63 bool CefCookieManagerCToCpp::VisitUrlCookies(
64     const CefString& url,
65     bool includeHttpOnly,
66     CefRefPtr<CefCookieVisitor> visitor) {
67   cef_cookie_manager_t* _struct = GetStruct();
68   if (CEF_MEMBER_MISSING(_struct, visit_url_cookies))
69     return false;
70 
71   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
72 
73   // Verify param: url; type: string_byref_const
74   DCHECK(!url.empty());
75   if (url.empty())
76     return false;
77   // Verify param: visitor; type: refptr_diff
78   DCHECK(visitor.get());
79   if (!visitor.get())
80     return false;
81 
82   // Execute
83   int _retval =
84       _struct->visit_url_cookies(_struct, url.GetStruct(), includeHttpOnly,
85                                  CefCookieVisitorCppToC::Wrap(visitor));
86 
87   // Return type: bool
88   return _retval ? true : false;
89 }
90 
91 NO_SANITIZE("cfi-icall")
SetCookie(const CefString & url,const CefCookie & cookie,CefRefPtr<CefSetCookieCallback> callback)92 bool CefCookieManagerCToCpp::SetCookie(
93     const CefString& url,
94     const CefCookie& cookie,
95     CefRefPtr<CefSetCookieCallback> callback) {
96   cef_cookie_manager_t* _struct = GetStruct();
97   if (CEF_MEMBER_MISSING(_struct, set_cookie))
98     return false;
99 
100   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
101 
102   // Verify param: url; type: string_byref_const
103   DCHECK(!url.empty());
104   if (url.empty())
105     return false;
106   // Unverified params: callback
107 
108   // Execute
109   int _retval = _struct->set_cookie(_struct, url.GetStruct(), &cookie,
110                                     CefSetCookieCallbackCppToC::Wrap(callback));
111 
112   // Return type: bool
113   return _retval ? true : false;
114 }
115 
116 NO_SANITIZE("cfi-icall")
DeleteCookies(const CefString & url,const CefString & cookie_name,CefRefPtr<CefDeleteCookiesCallback> callback)117 bool CefCookieManagerCToCpp::DeleteCookies(
118     const CefString& url,
119     const CefString& cookie_name,
120     CefRefPtr<CefDeleteCookiesCallback> callback) {
121   cef_cookie_manager_t* _struct = GetStruct();
122   if (CEF_MEMBER_MISSING(_struct, delete_cookies))
123     return false;
124 
125   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
126 
127   // Unverified params: url, cookie_name, callback
128 
129   // Execute
130   int _retval =
131       _struct->delete_cookies(_struct, url.GetStruct(), cookie_name.GetStruct(),
132                               CefDeleteCookiesCallbackCppToC::Wrap(callback));
133 
134   // Return type: bool
135   return _retval ? true : false;
136 }
137 
138 NO_SANITIZE("cfi-icall")
FlushStore(CefRefPtr<CefCompletionCallback> callback)139 bool CefCookieManagerCToCpp::FlushStore(
140     CefRefPtr<CefCompletionCallback> callback) {
141   cef_cookie_manager_t* _struct = GetStruct();
142   if (CEF_MEMBER_MISSING(_struct, flush_store))
143     return false;
144 
145   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
146 
147   // Unverified params: callback
148 
149   // Execute
150   int _retval = _struct->flush_store(
151       _struct, CefCompletionCallbackCppToC::Wrap(callback));
152 
153   // Return type: bool
154   return _retval ? true : false;
155 }
156 
157 // CONSTRUCTOR - Do not edit by hand.
158 
CefCookieManagerCToCpp()159 CefCookieManagerCToCpp::CefCookieManagerCToCpp() {}
160 
161 // DESTRUCTOR - Do not edit by hand.
162 
~CefCookieManagerCToCpp()163 CefCookieManagerCToCpp::~CefCookieManagerCToCpp() {}
164 
165 template <>
166 cef_cookie_manager_t*
167 CefCToCppRefCounted<CefCookieManagerCToCpp,
168                     CefCookieManager,
UnwrapDerived(CefWrapperType type,CefCookieManager * c)169                     cef_cookie_manager_t>::UnwrapDerived(CefWrapperType type,
170                                                          CefCookieManager* c) {
171   NOTREACHED() << "Unexpected class type: " << type;
172   return nullptr;
173 }
174 
175 template <>
176 CefWrapperType CefCToCppRefCounted<CefCookieManagerCToCpp,
177                                    CefCookieManager,
178                                    cef_cookie_manager_t>::kWrapperType =
179     WT_COOKIE_MANAGER;
180