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=0332caff5ce6230d2cb2d7663fc0bbfac8e45069$
13 //
14
15 #include "libcef_dll/ctocpp/read_handler_ctocpp.h"
16 #include "libcef_dll/shutdown_checker.h"
17
18 // VIRTUAL METHODS - Body may be edited by hand.
19
20 NO_SANITIZE("cfi-icall")
Read(void * ptr,size_t size,size_t n)21 size_t CefReadHandlerCToCpp::Read(void* ptr, size_t size, size_t n) {
22 shutdown_checker::AssertNotShutdown();
23
24 cef_read_handler_t* _struct = GetStruct();
25 if (CEF_MEMBER_MISSING(_struct, read))
26 return 0;
27
28 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
29
30 // Verify param: ptr; type: simple_byaddr
31 DCHECK(ptr);
32 if (!ptr)
33 return 0;
34
35 // Execute
36 size_t _retval = _struct->read(_struct, ptr, size, n);
37
38 // Return type: simple
39 return _retval;
40 }
41
42 NO_SANITIZE("cfi-icall")
Seek(int64 offset,int whence)43 int CefReadHandlerCToCpp::Seek(int64 offset, int whence) {
44 shutdown_checker::AssertNotShutdown();
45
46 cef_read_handler_t* _struct = GetStruct();
47 if (CEF_MEMBER_MISSING(_struct, seek))
48 return 0;
49
50 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
51
52 // Execute
53 int _retval = _struct->seek(_struct, offset, whence);
54
55 // Return type: simple
56 return _retval;
57 }
58
Tell()59 NO_SANITIZE("cfi-icall") int64 CefReadHandlerCToCpp::Tell() {
60 shutdown_checker::AssertNotShutdown();
61
62 cef_read_handler_t* _struct = GetStruct();
63 if (CEF_MEMBER_MISSING(_struct, tell))
64 return 0;
65
66 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
67
68 // Execute
69 int64 _retval = _struct->tell(_struct);
70
71 // Return type: simple
72 return _retval;
73 }
74
Eof()75 NO_SANITIZE("cfi-icall") int CefReadHandlerCToCpp::Eof() {
76 shutdown_checker::AssertNotShutdown();
77
78 cef_read_handler_t* _struct = GetStruct();
79 if (CEF_MEMBER_MISSING(_struct, eof))
80 return 0;
81
82 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
83
84 // Execute
85 int _retval = _struct->eof(_struct);
86
87 // Return type: simple
88 return _retval;
89 }
90
MayBlock()91 NO_SANITIZE("cfi-icall") bool CefReadHandlerCToCpp::MayBlock() {
92 shutdown_checker::AssertNotShutdown();
93
94 cef_read_handler_t* _struct = GetStruct();
95 if (CEF_MEMBER_MISSING(_struct, may_block))
96 return false;
97
98 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
99
100 // Execute
101 int _retval = _struct->may_block(_struct);
102
103 // Return type: bool
104 return _retval ? true : false;
105 }
106
107 // CONSTRUCTOR - Do not edit by hand.
108
CefReadHandlerCToCpp()109 CefReadHandlerCToCpp::CefReadHandlerCToCpp() {}
110
111 // DESTRUCTOR - Do not edit by hand.
112
~CefReadHandlerCToCpp()113 CefReadHandlerCToCpp::~CefReadHandlerCToCpp() {
114 shutdown_checker::AssertNotShutdown();
115 }
116
117 template <>
118 cef_read_handler_t*
119 CefCToCppRefCounted<CefReadHandlerCToCpp, CefReadHandler, cef_read_handler_t>::
UnwrapDerived(CefWrapperType type,CefReadHandler * c)120 UnwrapDerived(CefWrapperType type, CefReadHandler* c) {
121 NOTREACHED() << "Unexpected class type: " << type;
122 return nullptr;
123 }
124
125 template <>
126 CefWrapperType CefCToCppRefCounted<CefReadHandlerCToCpp,
127 CefReadHandler,
128 cef_read_handler_t>::kWrapperType =
129 WT_READ_HANDLER;
130