• 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=208b9651cb7a357f7665e6d449c6ba974dfae9e3$
13 //
14 
15 #include "libcef_dll/cpptoc/write_handler_cpptoc.h"
16 #include "libcef_dll/shutdown_checker.h"
17 
18 namespace {
19 
20 // MEMBER FUNCTIONS - Body may be edited by hand.
21 
write_handler_write(struct _cef_write_handler_t * self,const void * ptr,size_t size,size_t n)22 size_t CEF_CALLBACK write_handler_write(struct _cef_write_handler_t* self,
23                                         const void* ptr,
24                                         size_t size,
25                                         size_t n) {
26   shutdown_checker::AssertNotShutdown();
27 
28   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
29 
30   DCHECK(self);
31   if (!self)
32     return 0;
33   // Verify param: ptr; type: simple_byaddr
34   DCHECK(ptr);
35   if (!ptr)
36     return 0;
37 
38   // Execute
39   size_t _retval = CefWriteHandlerCppToC::Get(self)->Write(ptr, size, n);
40 
41   // Return type: simple
42   return _retval;
43 }
44 
write_handler_seek(struct _cef_write_handler_t * self,int64 offset,int whence)45 int CEF_CALLBACK write_handler_seek(struct _cef_write_handler_t* self,
46                                     int64 offset,
47                                     int whence) {
48   shutdown_checker::AssertNotShutdown();
49 
50   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
51 
52   DCHECK(self);
53   if (!self)
54     return 0;
55 
56   // Execute
57   int _retval = CefWriteHandlerCppToC::Get(self)->Seek(offset, whence);
58 
59   // Return type: simple
60   return _retval;
61 }
62 
write_handler_tell(struct _cef_write_handler_t * self)63 int64 CEF_CALLBACK write_handler_tell(struct _cef_write_handler_t* self) {
64   shutdown_checker::AssertNotShutdown();
65 
66   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
67 
68   DCHECK(self);
69   if (!self)
70     return 0;
71 
72   // Execute
73   int64 _retval = CefWriteHandlerCppToC::Get(self)->Tell();
74 
75   // Return type: simple
76   return _retval;
77 }
78 
write_handler_flush(struct _cef_write_handler_t * self)79 int CEF_CALLBACK write_handler_flush(struct _cef_write_handler_t* self) {
80   shutdown_checker::AssertNotShutdown();
81 
82   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
83 
84   DCHECK(self);
85   if (!self)
86     return 0;
87 
88   // Execute
89   int _retval = CefWriteHandlerCppToC::Get(self)->Flush();
90 
91   // Return type: simple
92   return _retval;
93 }
94 
write_handler_may_block(struct _cef_write_handler_t * self)95 int CEF_CALLBACK write_handler_may_block(struct _cef_write_handler_t* self) {
96   shutdown_checker::AssertNotShutdown();
97 
98   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
99 
100   DCHECK(self);
101   if (!self)
102     return 0;
103 
104   // Execute
105   bool _retval = CefWriteHandlerCppToC::Get(self)->MayBlock();
106 
107   // Return type: bool
108   return _retval;
109 }
110 
111 }  // namespace
112 
113 // CONSTRUCTOR - Do not edit by hand.
114 
CefWriteHandlerCppToC()115 CefWriteHandlerCppToC::CefWriteHandlerCppToC() {
116   GetStruct()->write = write_handler_write;
117   GetStruct()->seek = write_handler_seek;
118   GetStruct()->tell = write_handler_tell;
119   GetStruct()->flush = write_handler_flush;
120   GetStruct()->may_block = write_handler_may_block;
121 }
122 
123 // DESTRUCTOR - Do not edit by hand.
124 
~CefWriteHandlerCppToC()125 CefWriteHandlerCppToC::~CefWriteHandlerCppToC() {
126   shutdown_checker::AssertNotShutdown();
127 }
128 
129 template <>
130 CefRefPtr<CefWriteHandler> CefCppToCRefCounted<
131     CefWriteHandlerCppToC,
132     CefWriteHandler,
UnwrapDerived(CefWrapperType type,cef_write_handler_t * s)133     cef_write_handler_t>::UnwrapDerived(CefWrapperType type,
134                                         cef_write_handler_t* s) {
135   NOTREACHED() << "Unexpected class type: " << type;
136   return nullptr;
137 }
138 
139 template <>
140 CefWrapperType CefCppToCRefCounted<CefWriteHandlerCppToC,
141                                    CefWriteHandler,
142                                    cef_write_handler_t>::kWrapperType =
143     WT_WRITE_HANDLER;
144