2019-01-10 15:22:19 +01:00
|
|
|
// Copyright (c) 2019 The Chromium Embedded Framework Authors. All rights
|
2012-04-03 03:34:16 +02:00
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that
|
|
|
|
// can be found in the LICENSE file.
|
|
|
|
//
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// This file was generated by the CEF translator tool. If making changes by
|
|
|
|
// hand only do so within the body of existing method and function
|
|
|
|
// implementations. See the translator.README.txt file in the tools directory
|
|
|
|
// for more information.
|
|
|
|
//
|
2019-04-24 04:50:25 +02:00
|
|
|
// $hash=bad7476938f349b5b34be6c99e6d2d65e80de30c$
|
2017-05-17 11:29:28 +02:00
|
|
|
//
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2017-05-19 11:06:00 +02:00
|
|
|
#include "libcef_dll/ctocpp/resource_handler_ctocpp.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
#include "libcef_dll/cpptoc/callback_cpptoc.h"
|
|
|
|
#include "libcef_dll/cpptoc/request_cpptoc.h"
|
2019-04-24 04:50:25 +02:00
|
|
|
#include "libcef_dll/cpptoc/resource_read_callback_cpptoc.h"
|
|
|
|
#include "libcef_dll/cpptoc/resource_skip_callback_cpptoc.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
#include "libcef_dll/cpptoc/response_cpptoc.h"
|
2019-01-23 16:42:12 +01:00
|
|
|
#include "libcef_dll/shutdown_checker.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// VIRTUAL METHODS - Body may be edited by hand.
|
|
|
|
|
2019-04-24 04:50:25 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
|
|
|
bool CefResourceHandlerCToCpp::Open(CefRefPtr<CefRequest> request,
|
|
|
|
bool& handle_request,
|
|
|
|
CefRefPtr<CefCallback> callback) {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
cef_resource_handler_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, open))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: request; type: refptr_diff
|
|
|
|
DCHECK(request.get());
|
|
|
|
if (!request.get())
|
|
|
|
return false;
|
|
|
|
// Verify param: callback; type: refptr_diff
|
|
|
|
DCHECK(callback.get());
|
|
|
|
if (!callback.get())
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// Translate param: handle_request; type: bool_byref
|
|
|
|
int handle_requestInt = handle_request;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
int _retval =
|
|
|
|
_struct->open(_struct, CefRequestCppToC::Wrap(request),
|
|
|
|
&handle_requestInt, CefCallbackCppToC::Wrap(callback));
|
|
|
|
|
|
|
|
// Restore param:handle_request; type: bool_byref
|
|
|
|
handle_request = handle_requestInt ? true : false;
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval ? true : false;
|
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2012-04-03 03:34:16 +02:00
|
|
|
bool CefResourceHandlerCToCpp::ProcessRequest(CefRefPtr<CefRequest> request,
|
2017-05-17 11:29:28 +02:00
|
|
|
CefRefPtr<CefCallback> callback) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_resource_handler_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, process_request))
|
2012-04-03 03:34:16 +02:00
|
|
|
return false;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: request; type: refptr_diff
|
|
|
|
DCHECK(request.get());
|
|
|
|
if (!request.get())
|
|
|
|
return false;
|
|
|
|
// Verify param: callback; type: refptr_diff
|
|
|
|
DCHECK(callback.get());
|
|
|
|
if (!callback.get())
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
int _retval =
|
|
|
|
_struct->process_request(_struct, CefRequestCppToC::Wrap(request),
|
|
|
|
CefCallbackCppToC::Wrap(callback));
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Return type: bool
|
2017-05-17 11:29:28 +02:00
|
|
|
return _retval ? true : false;
|
2012-04-03 03:34:16 +02:00
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2012-04-03 03:34:16 +02:00
|
|
|
void CefResourceHandlerCToCpp::GetResponseHeaders(
|
2017-05-17 11:29:28 +02:00
|
|
|
CefRefPtr<CefResponse> response,
|
|
|
|
int64& response_length,
|
2012-04-03 03:34:16 +02:00
|
|
|
CefString& redirectUrl) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_resource_handler_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, get_response_headers))
|
2012-04-03 03:34:16 +02:00
|
|
|
return;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: response; type: refptr_diff
|
|
|
|
DCHECK(response.get());
|
|
|
|
if (!response.get())
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
_struct->get_response_headers(_struct, CefResponseCppToC::Wrap(response),
|
|
|
|
&response_length,
|
|
|
|
redirectUrl.GetWritableStruct());
|
2012-04-03 03:34:16 +02:00
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2019-04-24 04:50:25 +02:00
|
|
|
bool CefResourceHandlerCToCpp::Skip(
|
|
|
|
int64 bytes_to_skip,
|
|
|
|
int64& bytes_skipped,
|
|
|
|
CefRefPtr<CefResourceSkipCallback> callback) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_resource_handler_t* _struct = GetStruct();
|
2019-04-24 04:50:25 +02:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, skip))
|
2012-04-03 03:34:16 +02:00
|
|
|
return false;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: callback; type: refptr_diff
|
|
|
|
DCHECK(callback.get());
|
|
|
|
if (!callback.get())
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// Execute
|
2019-04-24 04:50:25 +02:00
|
|
|
int _retval = _struct->skip(_struct, bytes_to_skip, &bytes_skipped,
|
|
|
|
CefResourceSkipCallbackCppToC::Wrap(callback));
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Return type: bool
|
2017-05-17 11:29:28 +02:00
|
|
|
return _retval ? true : false;
|
2012-04-03 03:34:16 +02:00
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2019-04-24 04:50:25 +02:00
|
|
|
bool CefResourceHandlerCToCpp::Read(
|
|
|
|
void* data_out,
|
|
|
|
int bytes_to_read,
|
|
|
|
int& bytes_read,
|
|
|
|
CefRefPtr<CefResourceReadCallback> callback) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_resource_handler_t* _struct = GetStruct();
|
2019-04-24 04:50:25 +02:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, read))
|
2012-06-19 18:29:49 +02:00
|
|
|
return false;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
2019-04-24 04:50:25 +02:00
|
|
|
// Verify param: data_out; type: simple_byaddr
|
|
|
|
DCHECK(data_out);
|
|
|
|
if (!data_out)
|
|
|
|
return false;
|
|
|
|
// Verify param: callback; type: refptr_diff
|
|
|
|
DCHECK(callback.get());
|
|
|
|
if (!callback.get())
|
|
|
|
return false;
|
|
|
|
|
2012-06-19 18:29:49 +02:00
|
|
|
// Execute
|
2019-04-24 04:50:25 +02:00
|
|
|
int _retval = _struct->read(_struct, data_out, bytes_to_read, &bytes_read,
|
|
|
|
CefResourceReadCallbackCppToC::Wrap(callback));
|
2012-06-19 18:29:49 +02:00
|
|
|
|
|
|
|
// Return type: bool
|
2017-05-17 11:29:28 +02:00
|
|
|
return _retval ? true : false;
|
2012-06-19 18:29:49 +02:00
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2019-04-24 04:50:25 +02:00
|
|
|
bool CefResourceHandlerCToCpp::ReadResponse(void* data_out,
|
|
|
|
int bytes_to_read,
|
|
|
|
int& bytes_read,
|
|
|
|
CefRefPtr<CefCallback> callback) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_resource_handler_t* _struct = GetStruct();
|
2019-04-24 04:50:25 +02:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, read_response))
|
2012-06-19 18:29:49 +02:00
|
|
|
return false;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
2019-04-24 04:50:25 +02:00
|
|
|
// Verify param: data_out; type: simple_byaddr
|
|
|
|
DCHECK(data_out);
|
|
|
|
if (!data_out)
|
|
|
|
return false;
|
|
|
|
// Verify param: callback; type: refptr_diff
|
|
|
|
DCHECK(callback.get());
|
|
|
|
if (!callback.get())
|
|
|
|
return false;
|
|
|
|
|
2012-06-19 18:29:49 +02:00
|
|
|
// Execute
|
2019-04-24 04:50:25 +02:00
|
|
|
int _retval =
|
|
|
|
_struct->read_response(_struct, data_out, bytes_to_read, &bytes_read,
|
|
|
|
CefCallbackCppToC::Wrap(callback));
|
2012-06-19 18:29:49 +02:00
|
|
|
|
|
|
|
// Return type: bool
|
2017-05-17 11:29:28 +02:00
|
|
|
return _retval ? true : false;
|
2012-06-19 18:29:49 +02:00
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall") void CefResourceHandlerCToCpp::Cancel() {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_resource_handler_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, cancel))
|
2012-04-03 03:34:16 +02:00
|
|
|
return;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
2015-04-26 20:40:01 +02:00
|
|
|
_struct->cancel(_struct);
|
2012-04-03 03:34:16 +02:00
|
|
|
}
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
CefResourceHandlerCToCpp::CefResourceHandlerCToCpp() {}
|
2015-04-26 20:40:01 +02:00
|
|
|
|
2019-01-23 16:42:12 +01:00
|
|
|
// DESTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefResourceHandlerCToCpp::~CefResourceHandlerCToCpp() {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
cef_resource_handler_t* CefCToCppRefCounted<
|
|
|
|
CefResourceHandlerCToCpp,
|
|
|
|
CefResourceHandler,
|
|
|
|
cef_resource_handler_t>::UnwrapDerived(CefWrapperType type,
|
|
|
|
CefResourceHandler* c) {
|
2015-04-26 20:40:01 +02:00
|
|
|
NOTREACHED() << "Unexpected class type: " << type;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
CefWrapperType CefCToCppRefCounted<CefResourceHandlerCToCpp,
|
|
|
|
CefResourceHandler,
|
|
|
|
cef_resource_handler_t>::kWrapperType =
|
2015-04-26 20:40:01 +02:00
|
|
|
WT_RESOURCE_HANDLER;
|