• 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=8a64cdcb148bd7c9cad278d57c353ebf48386a16$
13 //
14 
15 #include "libcef_dll/cpptoc/cookie_access_filter_cpptoc.h"
16 #include "libcef_dll/ctocpp/browser_ctocpp.h"
17 #include "libcef_dll/ctocpp/frame_ctocpp.h"
18 #include "libcef_dll/ctocpp/request_ctocpp.h"
19 #include "libcef_dll/ctocpp/response_ctocpp.h"
20 
21 namespace {
22 
23 // MEMBER FUNCTIONS - Body may be edited by hand.
24 
25 int CEF_CALLBACK
cookie_access_filter_can_send_cookie(struct _cef_cookie_access_filter_t * self,cef_browser_t * browser,cef_frame_t * frame,cef_request_t * request,const struct _cef_cookie_t * cookie)26 cookie_access_filter_can_send_cookie(struct _cef_cookie_access_filter_t* self,
27                                      cef_browser_t* browser,
28                                      cef_frame_t* frame,
29                                      cef_request_t* request,
30                                      const struct _cef_cookie_t* cookie) {
31   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
32 
33   DCHECK(self);
34   if (!self)
35     return 0;
36   // Verify param: request; type: refptr_diff
37   DCHECK(request);
38   if (!request)
39     return 0;
40   // Verify param: cookie; type: struct_byref_const
41   DCHECK(cookie);
42   if (!cookie)
43     return 0;
44   // Unverified params: browser, frame
45 
46   // Translate param: cookie; type: struct_byref_const
47   CefCookie cookieObj;
48   if (cookie)
49     cookieObj.Set(*cookie, false);
50 
51   // Execute
52   bool _retval = CefCookieAccessFilterCppToC::Get(self)->CanSendCookie(
53       CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
54       CefRequestCToCpp::Wrap(request), cookieObj);
55 
56   // Return type: bool
57   return _retval;
58 }
59 
60 int CEF_CALLBACK
cookie_access_filter_can_save_cookie(struct _cef_cookie_access_filter_t * self,cef_browser_t * browser,cef_frame_t * frame,cef_request_t * request,struct _cef_response_t * response,const struct _cef_cookie_t * cookie)61 cookie_access_filter_can_save_cookie(struct _cef_cookie_access_filter_t* self,
62                                      cef_browser_t* browser,
63                                      cef_frame_t* frame,
64                                      cef_request_t* request,
65                                      struct _cef_response_t* response,
66                                      const struct _cef_cookie_t* cookie) {
67   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
68 
69   DCHECK(self);
70   if (!self)
71     return 0;
72   // Verify param: request; type: refptr_diff
73   DCHECK(request);
74   if (!request)
75     return 0;
76   // Verify param: response; type: refptr_diff
77   DCHECK(response);
78   if (!response)
79     return 0;
80   // Verify param: cookie; type: struct_byref_const
81   DCHECK(cookie);
82   if (!cookie)
83     return 0;
84   // Unverified params: browser, frame
85 
86   // Translate param: cookie; type: struct_byref_const
87   CefCookie cookieObj;
88   if (cookie)
89     cookieObj.Set(*cookie, false);
90 
91   // Execute
92   bool _retval = CefCookieAccessFilterCppToC::Get(self)->CanSaveCookie(
93       CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
94       CefRequestCToCpp::Wrap(request), CefResponseCToCpp::Wrap(response),
95       cookieObj);
96 
97   // Return type: bool
98   return _retval;
99 }
100 
101 }  // namespace
102 
103 // CONSTRUCTOR - Do not edit by hand.
104 
CefCookieAccessFilterCppToC()105 CefCookieAccessFilterCppToC::CefCookieAccessFilterCppToC() {
106   GetStruct()->can_send_cookie = cookie_access_filter_can_send_cookie;
107   GetStruct()->can_save_cookie = cookie_access_filter_can_save_cookie;
108 }
109 
110 // DESTRUCTOR - Do not edit by hand.
111 
~CefCookieAccessFilterCppToC()112 CefCookieAccessFilterCppToC::~CefCookieAccessFilterCppToC() {}
113 
114 template <>
115 CefRefPtr<CefCookieAccessFilter> CefCppToCRefCounted<
116     CefCookieAccessFilterCppToC,
117     CefCookieAccessFilter,
UnwrapDerived(CefWrapperType type,cef_cookie_access_filter_t * s)118     cef_cookie_access_filter_t>::UnwrapDerived(CefWrapperType type,
119                                                cef_cookie_access_filter_t* s) {
120   NOTREACHED() << "Unexpected class type: " << type;
121   return nullptr;
122 }
123 
124 template <>
125 CefWrapperType CefCppToCRefCounted<CefCookieAccessFilterCppToC,
126                                    CefCookieAccessFilter,
127                                    cef_cookie_access_filter_t>::kWrapperType =
128     WT_COOKIE_ACCESS_FILTER;
129