2023-01-02 23:47:15 +01:00
|
|
|
// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
|
2019-04-24 04:50:25 +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.
|
|
|
|
//
|
2023-05-08 17:15:02 +02:00
|
|
|
// $hash=bbb95fcb51fd9200a472d7a35f857750f4f8798b$
|
2019-04-24 04:50:25 +02:00
|
|
|
//
|
|
|
|
|
|
|
|
#include "libcef_dll/ctocpp/resource_request_handler_ctocpp.h"
|
|
|
|
#include "libcef_dll/cpptoc/browser_cpptoc.h"
|
2021-09-27 11:09:45 +02:00
|
|
|
#include "libcef_dll/cpptoc/callback_cpptoc.h"
|
2019-04-24 04:50:25 +02:00
|
|
|
#include "libcef_dll/cpptoc/frame_cpptoc.h"
|
|
|
|
#include "libcef_dll/cpptoc/request_cpptoc.h"
|
|
|
|
#include "libcef_dll/cpptoc/response_cpptoc.h"
|
2019-04-26 19:02:47 +02:00
|
|
|
#include "libcef_dll/ctocpp/cookie_access_filter_ctocpp.h"
|
2019-04-24 04:50:25 +02:00
|
|
|
#include "libcef_dll/ctocpp/resource_handler_ctocpp.h"
|
|
|
|
#include "libcef_dll/ctocpp/response_filter_ctocpp.h"
|
|
|
|
|
|
|
|
// VIRTUAL METHODS - Body may be edited by hand.
|
|
|
|
|
2019-04-26 19:02:47 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2021-09-27 11:09:45 +02:00
|
|
|
CefRefPtr<CefCookieAccessFilter>
|
|
|
|
CefResourceRequestHandlerCToCpp::GetCookieAccessFilter(
|
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame,
|
|
|
|
CefRefPtr<CefRequest> request) {
|
2019-04-26 19:02:47 +02:00
|
|
|
cef_resource_request_handler_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, get_cookie_access_filter)) {
|
2020-01-15 14:53:19 +01:00
|
|
|
return nullptr;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2019-04-26 19:02:47 +02:00
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: request; type: refptr_diff
|
|
|
|
DCHECK(request.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!request.get()) {
|
2020-01-15 14:53:19 +01:00
|
|
|
return nullptr;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2019-04-26 19:02:47 +02:00
|
|
|
// Unverified params: browser, frame
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
cef_cookie_access_filter_t* _retval = _struct->get_cookie_access_filter(
|
|
|
|
_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame),
|
|
|
|
CefRequestCppToC::Wrap(request));
|
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefCookieAccessFilterCToCpp::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
2019-04-24 04:50:25 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
|
|
|
CefResourceRequestHandler::ReturnValue
|
2021-09-27 11:09:45 +02:00
|
|
|
CefResourceRequestHandlerCToCpp::OnBeforeResourceLoad(
|
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame,
|
|
|
|
CefRefPtr<CefRequest> request,
|
|
|
|
CefRefPtr<CefCallback> callback) {
|
2019-04-24 04:50:25 +02:00
|
|
|
cef_resource_request_handler_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_before_resource_load)) {
|
2019-04-24 04:50:25 +02:00
|
|
|
return RV_CONTINUE;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2019-04-24 04:50:25 +02:00
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: request; type: refptr_diff
|
|
|
|
DCHECK(request.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!request.get()) {
|
2019-04-24 04:50:25 +02:00
|
|
|
return RV_CONTINUE;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2019-04-24 04:50:25 +02:00
|
|
|
// Verify param: callback; type: refptr_diff
|
|
|
|
DCHECK(callback.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!callback.get()) {
|
2019-04-24 04:50:25 +02:00
|
|
|
return RV_CONTINUE;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2019-04-24 04:50:25 +02:00
|
|
|
// Unverified params: browser, frame
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
cef_return_value_t _retval = _struct->on_before_resource_load(
|
|
|
|
_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame),
|
2021-09-27 11:09:45 +02:00
|
|
|
CefRequestCppToC::Wrap(request), CefCallbackCppToC::Wrap(callback));
|
2019-04-24 04:50:25 +02:00
|
|
|
|
|
|
|
// Return type: simple
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
NO_SANITIZE("cfi-icall")
|
2021-09-27 11:09:45 +02:00
|
|
|
CefRefPtr<CefResourceHandler>
|
|
|
|
CefResourceRequestHandlerCToCpp::GetResourceHandler(
|
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame,
|
|
|
|
CefRefPtr<CefRequest> request) {
|
2019-04-24 04:50:25 +02:00
|
|
|
cef_resource_request_handler_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, get_resource_handler)) {
|
2020-01-15 14:53:19 +01:00
|
|
|
return nullptr;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2019-04-24 04:50:25 +02:00
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: request; type: refptr_diff
|
|
|
|
DCHECK(request.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!request.get()) {
|
2020-01-15 14:53:19 +01:00
|
|
|
return nullptr;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2019-04-24 04:50:25 +02:00
|
|
|
// Unverified params: browser, frame
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
cef_resource_handler_t* _retval = _struct->get_resource_handler(
|
|
|
|
_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame),
|
|
|
|
CefRequestCppToC::Wrap(request));
|
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefResourceHandlerCToCpp::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
NO_SANITIZE("cfi-icall")
|
|
|
|
void CefResourceRequestHandlerCToCpp::OnResourceRedirect(
|
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame,
|
|
|
|
CefRefPtr<CefRequest> request,
|
|
|
|
CefRefPtr<CefResponse> response,
|
|
|
|
CefString& new_url) {
|
|
|
|
cef_resource_request_handler_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_resource_redirect)) {
|
2019-04-24 04:50:25 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2019-04-24 04:50:25 +02:00
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: request; type: refptr_diff
|
|
|
|
DCHECK(request.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!request.get()) {
|
2019-04-24 04:50:25 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2019-04-24 04:50:25 +02:00
|
|
|
// Verify param: response; type: refptr_diff
|
|
|
|
DCHECK(response.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!response.get()) {
|
2019-04-24 04:50:25 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2019-04-24 04:50:25 +02:00
|
|
|
// Unverified params: browser, frame
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
_struct->on_resource_redirect(
|
|
|
|
_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame),
|
|
|
|
CefRequestCppToC::Wrap(request), CefResponseCppToC::Wrap(response),
|
|
|
|
new_url.GetWritableStruct());
|
|
|
|
}
|
|
|
|
|
|
|
|
NO_SANITIZE("cfi-icall")
|
|
|
|
bool CefResourceRequestHandlerCToCpp::OnResourceResponse(
|
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame,
|
|
|
|
CefRefPtr<CefRequest> request,
|
|
|
|
CefRefPtr<CefResponse> response) {
|
|
|
|
cef_resource_request_handler_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_resource_response)) {
|
2019-04-24 04:50:25 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2019-04-24 04:50:25 +02:00
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: request; type: refptr_diff
|
|
|
|
DCHECK(request.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!request.get()) {
|
2019-04-24 04:50:25 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2019-04-24 04:50:25 +02:00
|
|
|
// Verify param: response; type: refptr_diff
|
|
|
|
DCHECK(response.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!response.get()) {
|
2019-04-24 04:50:25 +02:00
|
|
|
return false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2019-04-24 04:50:25 +02:00
|
|
|
// Unverified params: browser, frame
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
int _retval = _struct->on_resource_response(
|
|
|
|
_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame),
|
|
|
|
CefRequestCppToC::Wrap(request), CefResponseCppToC::Wrap(response));
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval ? true : false;
|
|
|
|
}
|
|
|
|
|
|
|
|
NO_SANITIZE("cfi-icall")
|
2021-09-27 11:09:45 +02:00
|
|
|
CefRefPtr<CefResponseFilter>
|
|
|
|
CefResourceRequestHandlerCToCpp::GetResourceResponseFilter(
|
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame,
|
|
|
|
CefRefPtr<CefRequest> request,
|
|
|
|
CefRefPtr<CefResponse> response) {
|
2019-04-24 04:50:25 +02:00
|
|
|
cef_resource_request_handler_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, get_resource_response_filter)) {
|
2020-01-15 14:53:19 +01:00
|
|
|
return nullptr;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2019-04-24 04:50:25 +02:00
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: request; type: refptr_diff
|
|
|
|
DCHECK(request.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!request.get()) {
|
2020-01-15 14:53:19 +01:00
|
|
|
return nullptr;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2019-04-24 04:50:25 +02:00
|
|
|
// Verify param: response; type: refptr_diff
|
|
|
|
DCHECK(response.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!response.get()) {
|
2020-01-15 14:53:19 +01:00
|
|
|
return nullptr;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2019-04-24 04:50:25 +02:00
|
|
|
// Unverified params: browser, frame
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
cef_response_filter_t* _retval = _struct->get_resource_response_filter(
|
|
|
|
_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame),
|
|
|
|
CefRequestCppToC::Wrap(request), CefResponseCppToC::Wrap(response));
|
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefResponseFilterCToCpp::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
NO_SANITIZE("cfi-icall")
|
|
|
|
void CefResourceRequestHandlerCToCpp::OnResourceLoadComplete(
|
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame,
|
|
|
|
CefRefPtr<CefRequest> request,
|
|
|
|
CefRefPtr<CefResponse> response,
|
|
|
|
URLRequestStatus status,
|
|
|
|
int64 received_content_length) {
|
|
|
|
cef_resource_request_handler_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_resource_load_complete)) {
|
2019-04-24 04:50:25 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2019-04-24 04:50:25 +02:00
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: request; type: refptr_diff
|
|
|
|
DCHECK(request.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!request.get()) {
|
2019-04-24 04:50:25 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2019-04-24 04:50:25 +02:00
|
|
|
// Verify param: response; type: refptr_diff
|
|
|
|
DCHECK(response.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!response.get()) {
|
2019-04-24 04:50:25 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2019-04-24 04:50:25 +02:00
|
|
|
// Unverified params: browser, frame
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
_struct->on_resource_load_complete(
|
|
|
|
_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame),
|
|
|
|
CefRequestCppToC::Wrap(request), CefResponseCppToC::Wrap(response),
|
|
|
|
status, received_content_length);
|
|
|
|
}
|
|
|
|
|
|
|
|
NO_SANITIZE("cfi-icall")
|
|
|
|
void CefResourceRequestHandlerCToCpp::OnProtocolExecution(
|
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame,
|
|
|
|
CefRefPtr<CefRequest> request,
|
|
|
|
bool& allow_os_execution) {
|
|
|
|
cef_resource_request_handler_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_protocol_execution)) {
|
2019-04-24 04:50:25 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2019-04-24 04:50:25 +02:00
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: request; type: refptr_diff
|
|
|
|
DCHECK(request.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!request.get()) {
|
2019-04-24 04:50:25 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2019-04-24 04:50:25 +02:00
|
|
|
// Unverified params: browser, frame
|
|
|
|
|
|
|
|
// Translate param: allow_os_execution; type: bool_byref
|
|
|
|
int allow_os_executionInt = allow_os_execution;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
_struct->on_protocol_execution(
|
|
|
|
_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame),
|
|
|
|
CefRequestCppToC::Wrap(request), &allow_os_executionInt);
|
|
|
|
|
|
|
|
// Restore param:allow_os_execution; type: bool_byref
|
|
|
|
allow_os_execution = allow_os_executionInt ? true : false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefResourceRequestHandlerCToCpp::CefResourceRequestHandlerCToCpp() {}
|
|
|
|
|
|
|
|
// DESTRUCTOR - Do not edit by hand.
|
|
|
|
|
2019-05-18 11:15:04 +02:00
|
|
|
CefResourceRequestHandlerCToCpp::~CefResourceRequestHandlerCToCpp() {}
|
2019-04-24 04:50:25 +02:00
|
|
|
|
|
|
|
template <>
|
|
|
|
cef_resource_request_handler_t* CefCToCppRefCounted<
|
|
|
|
CefResourceRequestHandlerCToCpp,
|
|
|
|
CefResourceRequestHandler,
|
|
|
|
cef_resource_request_handler_t>::UnwrapDerived(CefWrapperType type,
|
|
|
|
CefResourceRequestHandler*
|
|
|
|
c) {
|
2023-05-08 17:15:02 +02:00
|
|
|
DCHECK(false) << "Unexpected class type: " << type;
|
2020-01-15 14:53:19 +01:00
|
|
|
return nullptr;
|
2019-04-24 04:50:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
CefWrapperType
|
|
|
|
CefCToCppRefCounted<CefResourceRequestHandlerCToCpp,
|
|
|
|
CefResourceRequestHandler,
|
|
|
|
cef_resource_request_handler_t>::kWrapperType =
|
|
|
|
WT_RESOURCE_REQUEST_HANDLER;
|