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=728e5a2aa03b7884d5001f784dcf6bc6fb79254a$
13 //
14
15 #include "libcef_dll/ctocpp/write_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")
Write(const void * ptr,size_t size,size_t n)21 size_t CefWriteHandlerCToCpp::Write(const void* ptr, size_t size, size_t n) {
22 shutdown_checker::AssertNotShutdown();
23
24 cef_write_handler_t* _struct = GetStruct();
25 if (CEF_MEMBER_MISSING(_struct, write))
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->write(_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 CefWriteHandlerCToCpp::Seek(int64 offset, int whence) {
44 shutdown_checker::AssertNotShutdown();
45
46 cef_write_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 CefWriteHandlerCToCpp::Tell() {
60 shutdown_checker::AssertNotShutdown();
61
62 cef_write_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
Flush()75 NO_SANITIZE("cfi-icall") int CefWriteHandlerCToCpp::Flush() {
76 shutdown_checker::AssertNotShutdown();
77
78 cef_write_handler_t* _struct = GetStruct();
79 if (CEF_MEMBER_MISSING(_struct, flush))
80 return 0;
81
82 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
83
84 // Execute
85 int _retval = _struct->flush(_struct);
86
87 // Return type: simple
88 return _retval;
89 }
90
MayBlock()91 NO_SANITIZE("cfi-icall") bool CefWriteHandlerCToCpp::MayBlock() {
92 shutdown_checker::AssertNotShutdown();
93
94 cef_write_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
CefWriteHandlerCToCpp()109 CefWriteHandlerCToCpp::CefWriteHandlerCToCpp() {}
110
111 // DESTRUCTOR - Do not edit by hand.
112
~CefWriteHandlerCToCpp()113 CefWriteHandlerCToCpp::~CefWriteHandlerCToCpp() {
114 shutdown_checker::AssertNotShutdown();
115 }
116
117 template <>
118 cef_write_handler_t*
119 CefCToCppRefCounted<CefWriteHandlerCToCpp,
120 CefWriteHandler,
UnwrapDerived(CefWrapperType type,CefWriteHandler * c)121 cef_write_handler_t>::UnwrapDerived(CefWrapperType type,
122 CefWriteHandler* c) {
123 NOTREACHED() << "Unexpected class type: " << type;
124 return nullptr;
125 }
126
127 template <>
128 CefWrapperType CefCToCppRefCounted<CefWriteHandlerCToCpp,
129 CefWriteHandler,
130 cef_write_handler_t>::kWrapperType =
131 WT_WRITE_HANDLER;
132