#include "libcef_dll/ctocpp/read_handler_ctocpp.h"
#include "libcef_dll/shutdown_checker.h"
NO_SANITIZE("cfi-icall")
size_t CefReadHandlerCToCpp::Read(void* ptr, size_t size, size_t n) {
shutdown_checker::AssertNotShutdown();
cef_read_handler_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, read))
return 0;
DCHECK(ptr);
if (!ptr)
return 0;
size_t _retval = _struct->read(_struct, ptr, size, n);
return _retval;
}
NO_SANITIZE("cfi-icall")
int CefReadHandlerCToCpp::Seek(int64 offset, int whence) {
shutdown_checker::AssertNotShutdown();
cef_read_handler_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, seek))
return 0;
int _retval = _struct->seek(_struct, offset, whence);
return _retval;
}
NO_SANITIZE("cfi-icall") int64 CefReadHandlerCToCpp::Tell() {
shutdown_checker::AssertNotShutdown();
cef_read_handler_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, tell))
return 0;
int64 _retval = _struct->tell(_struct);
return _retval;
}
NO_SANITIZE("cfi-icall") int CefReadHandlerCToCpp::Eof() {
shutdown_checker::AssertNotShutdown();
cef_read_handler_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, eof))
return 0;
int _retval = _struct->eof(_struct);
return _retval;
}
NO_SANITIZE("cfi-icall") bool CefReadHandlerCToCpp::MayBlock() {
shutdown_checker::AssertNotShutdown();
cef_read_handler_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, may_block))
return false;
int _retval = _struct->may_block(_struct);
return _retval ? true : false;
}
CefReadHandlerCToCpp::CefReadHandlerCToCpp() {}
CefReadHandlerCToCpp::~CefReadHandlerCToCpp() {
shutdown_checker::AssertNotShutdown();
}
template <>
cef_read_handler_t*
CefCToCppRefCounted<CefReadHandlerCToCpp, CefReadHandler, cef_read_handler_t>::
UnwrapDerived(CefWrapperType type, CefReadHandler* c) {
NOTREACHED() << "Unexpected class type: " << type;
return nullptr;
}
template <>
CefWrapperType CefCToCppRefCounted<CefReadHandlerCToCpp,
CefReadHandler,
cef_read_handler_t>::kWrapperType =
WT_READ_HANDLER;