• 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=922e883b71eb54b943f7cb4748bd2298eb296eee$
13 //
14 
15 #include "libcef_dll/cpptoc/cookie_visitor_cpptoc.h"
16 #include "libcef_dll/shutdown_checker.h"
17 
18 namespace {
19 
20 // MEMBER FUNCTIONS - Body may be edited by hand.
21 
cookie_visitor_visit(struct _cef_cookie_visitor_t * self,const struct _cef_cookie_t * cookie,int count,int total,int * deleteCookie)22 int CEF_CALLBACK cookie_visitor_visit(struct _cef_cookie_visitor_t* self,
23                                       const struct _cef_cookie_t* cookie,
24                                       int count,
25                                       int total,
26                                       int* deleteCookie) {
27   shutdown_checker::AssertNotShutdown();
28 
29   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
30 
31   DCHECK(self);
32   if (!self)
33     return 0;
34   // Verify param: cookie; type: struct_byref_const
35   DCHECK(cookie);
36   if (!cookie)
37     return 0;
38   // Verify param: deleteCookie; type: bool_byref
39   DCHECK(deleteCookie);
40   if (!deleteCookie)
41     return 0;
42 
43   // Translate param: cookie; type: struct_byref_const
44   CefCookie cookieObj;
45   if (cookie)
46     cookieObj.Set(*cookie, false);
47   // Translate param: deleteCookie; type: bool_byref
48   bool deleteCookieBool = (deleteCookie && *deleteCookie) ? true : false;
49 
50   // Execute
51   bool _retval = CefCookieVisitorCppToC::Get(self)->Visit(
52       cookieObj, count, total, deleteCookieBool);
53 
54   // Restore param: deleteCookie; type: bool_byref
55   if (deleteCookie)
56     *deleteCookie = deleteCookieBool ? true : false;
57 
58   // Return type: bool
59   return _retval;
60 }
61 
62 }  // namespace
63 
64 // CONSTRUCTOR - Do not edit by hand.
65 
CefCookieVisitorCppToC()66 CefCookieVisitorCppToC::CefCookieVisitorCppToC() {
67   GetStruct()->visit = cookie_visitor_visit;
68 }
69 
70 // DESTRUCTOR - Do not edit by hand.
71 
~CefCookieVisitorCppToC()72 CefCookieVisitorCppToC::~CefCookieVisitorCppToC() {
73   shutdown_checker::AssertNotShutdown();
74 }
75 
76 template <>
77 CefRefPtr<CefCookieVisitor> CefCppToCRefCounted<
78     CefCookieVisitorCppToC,
79     CefCookieVisitor,
UnwrapDerived(CefWrapperType type,cef_cookie_visitor_t * s)80     cef_cookie_visitor_t>::UnwrapDerived(CefWrapperType type,
81                                          cef_cookie_visitor_t* s) {
82   NOTREACHED() << "Unexpected class type: " << type;
83   return nullptr;
84 }
85 
86 template <>
87 CefWrapperType CefCppToCRefCounted<CefCookieVisitorCppToC,
88                                    CefCookieVisitor,
89                                    cef_cookie_visitor_t>::kWrapperType =
90     WT_COOKIE_VISITOR;
91