• 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=ddb4710d1e5bc73df68f132d56661b0d22520ad9$
13 //
14 
15 #include "libcef_dll/ctocpp/response_filter_ctocpp.h"
16 #include "libcef_dll/shutdown_checker.h"
17 
18 // VIRTUAL METHODS - Body may be edited by hand.
19 
InitFilter()20 NO_SANITIZE("cfi-icall") bool CefResponseFilterCToCpp::InitFilter() {
21   shutdown_checker::AssertNotShutdown();
22 
23   cef_response_filter_t* _struct = GetStruct();
24   if (CEF_MEMBER_MISSING(_struct, init_filter))
25     return false;
26 
27   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
28 
29   // Execute
30   int _retval = _struct->init_filter(_struct);
31 
32   // Return type: bool
33   return _retval ? true : false;
34 }
35 
36 NO_SANITIZE("cfi-icall")
Filter(void * data_in,size_t data_in_size,size_t & data_in_read,void * data_out,size_t data_out_size,size_t & data_out_written)37 CefResponseFilter::FilterStatus CefResponseFilterCToCpp::Filter(
38     void* data_in,
39     size_t data_in_size,
40     size_t& data_in_read,
41     void* data_out,
42     size_t data_out_size,
43     size_t& data_out_written) {
44   shutdown_checker::AssertNotShutdown();
45 
46   cef_response_filter_t* _struct = GetStruct();
47   if (CEF_MEMBER_MISSING(_struct, filter))
48     return RESPONSE_FILTER_ERROR;
49 
50   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
51 
52   // Verify param: data_out; type: simple_byaddr
53   DCHECK(data_out);
54   if (!data_out)
55     return RESPONSE_FILTER_ERROR;
56   // Unverified params: data_in
57 
58   // Execute
59   cef_response_filter_status_t _retval =
60       _struct->filter(_struct, data_in, data_in_size, &data_in_read, data_out,
61                       data_out_size, &data_out_written);
62 
63   // Return type: simple
64   return _retval;
65 }
66 
67 // CONSTRUCTOR - Do not edit by hand.
68 
CefResponseFilterCToCpp()69 CefResponseFilterCToCpp::CefResponseFilterCToCpp() {}
70 
71 // DESTRUCTOR - Do not edit by hand.
72 
~CefResponseFilterCToCpp()73 CefResponseFilterCToCpp::~CefResponseFilterCToCpp() {
74   shutdown_checker::AssertNotShutdown();
75 }
76 
77 template <>
78 cef_response_filter_t* CefCToCppRefCounted<
79     CefResponseFilterCToCpp,
80     CefResponseFilter,
UnwrapDerived(CefWrapperType type,CefResponseFilter * c)81     cef_response_filter_t>::UnwrapDerived(CefWrapperType type,
82                                           CefResponseFilter* c) {
83   NOTREACHED() << "Unexpected class type: " << type;
84   return nullptr;
85 }
86 
87 template <>
88 CefWrapperType CefCToCppRefCounted<CefResponseFilterCToCpp,
89                                    CefResponseFilter,
90                                    cef_response_filter_t>::kWrapperType =
91     WT_RESPONSE_FILTER;
92