2024-01-05 19:03:36 +01:00
|
|
|
// Copyright (c) 2024 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.
|
|
|
|
//
|
2024-01-05 19:03:36 +01:00
|
|
|
// $hash=740a136b543a32de5788c9395fca7f808d1b363c$
|
2019-04-24 04:50:25 +02:00
|
|
|
//
|
|
|
|
|
|
|
|
#include "libcef_dll/cpptoc/resource_request_handler_cpptoc.h"
|
2019-04-26 19:02:47 +02:00
|
|
|
#include "libcef_dll/cpptoc/cookie_access_filter_cpptoc.h"
|
2019-04-24 04:50:25 +02:00
|
|
|
#include "libcef_dll/cpptoc/resource_handler_cpptoc.h"
|
|
|
|
#include "libcef_dll/cpptoc/response_filter_cpptoc.h"
|
|
|
|
#include "libcef_dll/ctocpp/browser_ctocpp.h"
|
2021-09-27 11:09:45 +02:00
|
|
|
#include "libcef_dll/ctocpp/callback_ctocpp.h"
|
2019-04-24 04:50:25 +02:00
|
|
|
#include "libcef_dll/ctocpp/frame_ctocpp.h"
|
|
|
|
#include "libcef_dll/ctocpp/request_ctocpp.h"
|
|
|
|
#include "libcef_dll/ctocpp/response_ctocpp.h"
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
|
|
|
|
2019-04-26 19:02:47 +02:00
|
|
|
struct _cef_cookie_access_filter_t* CEF_CALLBACK
|
|
|
|
resource_request_handler_get_cookie_access_filter(
|
|
|
|
struct _cef_resource_request_handler_t* self,
|
|
|
|
cef_browser_t* browser,
|
|
|
|
cef_frame_t* frame,
|
|
|
|
cef_request_t* request) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2019-04-26 19:02:47 +02:00
|
|
|
return NULL;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2019-04-26 19:02:47 +02:00
|
|
|
// Verify param: request; type: refptr_diff
|
|
|
|
DCHECK(request);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!request) {
|
2019-04-26 19:02:47 +02:00
|
|
|
return NULL;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2019-04-26 19:02:47 +02:00
|
|
|
// Unverified params: browser, frame
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefRefPtr<CefCookieAccessFilter> _retval =
|
|
|
|
CefResourceRequestHandlerCppToC::Get(self)->GetCookieAccessFilter(
|
|
|
|
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
|
|
|
|
CefRequestCToCpp::Wrap(request));
|
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefCookieAccessFilterCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
2019-04-24 04:50:25 +02:00
|
|
|
cef_return_value_t CEF_CALLBACK
|
|
|
|
resource_request_handler_on_before_resource_load(
|
|
|
|
struct _cef_resource_request_handler_t* self,
|
|
|
|
cef_browser_t* browser,
|
|
|
|
cef_frame_t* frame,
|
|
|
|
cef_request_t* request,
|
2021-09-27 11:09:45 +02:00
|
|
|
cef_callback_t* callback) {
|
2019-04-24 04:50:25 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
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: request; type: refptr_diff
|
|
|
|
DCHECK(request);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!request) {
|
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);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!callback) {
|
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 =
|
|
|
|
CefResourceRequestHandlerCppToC::Get(self)->OnBeforeResourceLoad(
|
|
|
|
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
|
2021-09-27 11:09:45 +02:00
|
|
|
CefRequestCToCpp::Wrap(request), CefCallbackCToCpp::Wrap(callback));
|
2019-04-24 04:50:25 +02:00
|
|
|
|
|
|
|
// Return type: simple
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
cef_resource_handler_t* CEF_CALLBACK
|
|
|
|
resource_request_handler_get_resource_handler(
|
|
|
|
struct _cef_resource_request_handler_t* self,
|
|
|
|
cef_browser_t* browser,
|
|
|
|
cef_frame_t* frame,
|
|
|
|
cef_request_t* request) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2019-04-24 04:50:25 +02:00
|
|
|
return NULL;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2019-04-24 04:50:25 +02:00
|
|
|
// Verify param: request; type: refptr_diff
|
|
|
|
DCHECK(request);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!request) {
|
2019-04-24 04:50:25 +02:00
|
|
|
return NULL;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2019-04-24 04:50:25 +02:00
|
|
|
// Unverified params: browser, frame
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefRefPtr<CefResourceHandler> _retval =
|
|
|
|
CefResourceRequestHandlerCppToC::Get(self)->GetResourceHandler(
|
|
|
|
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
|
|
|
|
CefRequestCToCpp::Wrap(request));
|
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefResourceHandlerCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK resource_request_handler_on_resource_redirect(
|
|
|
|
struct _cef_resource_request_handler_t* self,
|
|
|
|
cef_browser_t* browser,
|
|
|
|
cef_frame_t* frame,
|
|
|
|
cef_request_t* request,
|
|
|
|
struct _cef_response_t* response,
|
|
|
|
cef_string_t* new_url) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
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: request; type: refptr_diff
|
|
|
|
DCHECK(request);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!request) {
|
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);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!response) {
|
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: new_url; type: string_byref
|
|
|
|
DCHECK(new_url);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!new_url) {
|
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: new_url; type: string_byref
|
|
|
|
CefString new_urlStr(new_url);
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefResourceRequestHandlerCppToC::Get(self)->OnResourceRedirect(
|
|
|
|
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
|
|
|
|
CefRequestCToCpp::Wrap(request), CefResponseCToCpp::Wrap(response),
|
|
|
|
new_urlStr);
|
|
|
|
}
|
|
|
|
|
|
|
|
int CEF_CALLBACK resource_request_handler_on_resource_response(
|
|
|
|
struct _cef_resource_request_handler_t* self,
|
|
|
|
cef_browser_t* browser,
|
|
|
|
cef_frame_t* frame,
|
|
|
|
cef_request_t* request,
|
|
|
|
struct _cef_response_t* response) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2019-04-24 04:50:25 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2019-04-24 04:50:25 +02:00
|
|
|
// Verify param: request; type: refptr_diff
|
|
|
|
DCHECK(request);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!request) {
|
2019-04-24 04:50:25 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2019-04-24 04:50:25 +02:00
|
|
|
// Verify param: response; type: refptr_diff
|
|
|
|
DCHECK(response);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!response) {
|
2019-04-24 04:50:25 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2019-04-24 04:50:25 +02:00
|
|
|
// Unverified params: browser, frame
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefResourceRequestHandlerCppToC::Get(self)->OnResourceResponse(
|
|
|
|
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
|
|
|
|
CefRequestCToCpp::Wrap(request), CefResponseCToCpp::Wrap(response));
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct _cef_response_filter_t* CEF_CALLBACK
|
|
|
|
resource_request_handler_get_resource_response_filter(
|
|
|
|
struct _cef_resource_request_handler_t* self,
|
|
|
|
cef_browser_t* browser,
|
|
|
|
cef_frame_t* frame,
|
|
|
|
cef_request_t* request,
|
|
|
|
struct _cef_response_t* response) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2019-04-24 04:50:25 +02:00
|
|
|
return NULL;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2019-04-24 04:50:25 +02:00
|
|
|
// Verify param: request; type: refptr_diff
|
|
|
|
DCHECK(request);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!request) {
|
2019-04-24 04:50:25 +02:00
|
|
|
return NULL;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2019-04-24 04:50:25 +02:00
|
|
|
// Verify param: response; type: refptr_diff
|
|
|
|
DCHECK(response);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!response) {
|
2019-04-24 04:50:25 +02:00
|
|
|
return NULL;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2019-04-24 04:50:25 +02:00
|
|
|
// Unverified params: browser, frame
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefRefPtr<CefResponseFilter> _retval =
|
|
|
|
CefResourceRequestHandlerCppToC::Get(self)->GetResourceResponseFilter(
|
|
|
|
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
|
|
|
|
CefRequestCToCpp::Wrap(request), CefResponseCToCpp::Wrap(response));
|
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefResponseFilterCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK resource_request_handler_on_resource_load_complete(
|
|
|
|
struct _cef_resource_request_handler_t* self,
|
|
|
|
cef_browser_t* browser,
|
|
|
|
cef_frame_t* frame,
|
|
|
|
cef_request_t* request,
|
|
|
|
struct _cef_response_t* response,
|
|
|
|
cef_urlrequest_status_t status,
|
2023-06-01 16:07:20 +02:00
|
|
|
int64_t received_content_length) {
|
2019-04-24 04:50:25 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
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: request; type: refptr_diff
|
|
|
|
DCHECK(request);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!request) {
|
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);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!response) {
|
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
|
|
|
|
CefResourceRequestHandlerCppToC::Get(self)->OnResourceLoadComplete(
|
|
|
|
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
|
|
|
|
CefRequestCToCpp::Wrap(request), CefResponseCToCpp::Wrap(response),
|
|
|
|
status, received_content_length);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK resource_request_handler_on_protocol_execution(
|
|
|
|
struct _cef_resource_request_handler_t* self,
|
|
|
|
cef_browser_t* browser,
|
|
|
|
cef_frame_t* frame,
|
|
|
|
cef_request_t* request,
|
|
|
|
int* allow_os_execution) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
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: request; type: refptr_diff
|
|
|
|
DCHECK(request);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!request) {
|
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: allow_os_execution; type: bool_byref
|
|
|
|
DCHECK(allow_os_execution);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!allow_os_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
|
|
|
// Unverified params: browser, frame
|
|
|
|
|
|
|
|
// Translate param: allow_os_execution; type: bool_byref
|
|
|
|
bool allow_os_executionBool =
|
|
|
|
(allow_os_execution && *allow_os_execution) ? true : false;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefResourceRequestHandlerCppToC::Get(self)->OnProtocolExecution(
|
|
|
|
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
|
|
|
|
CefRequestCToCpp::Wrap(request), allow_os_executionBool);
|
|
|
|
|
|
|
|
// Restore param: allow_os_execution; type: bool_byref
|
2023-01-02 23:47:15 +01:00
|
|
|
if (allow_os_execution) {
|
2019-04-24 04:50:25 +02:00
|
|
|
*allow_os_execution = allow_os_executionBool ? true : false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2019-04-24 04:50:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefResourceRequestHandlerCppToC::CefResourceRequestHandlerCppToC() {
|
2019-04-26 19:02:47 +02:00
|
|
|
GetStruct()->get_cookie_access_filter =
|
|
|
|
resource_request_handler_get_cookie_access_filter;
|
2019-04-24 04:50:25 +02:00
|
|
|
GetStruct()->on_before_resource_load =
|
|
|
|
resource_request_handler_on_before_resource_load;
|
|
|
|
GetStruct()->get_resource_handler =
|
|
|
|
resource_request_handler_get_resource_handler;
|
|
|
|
GetStruct()->on_resource_redirect =
|
|
|
|
resource_request_handler_on_resource_redirect;
|
|
|
|
GetStruct()->on_resource_response =
|
|
|
|
resource_request_handler_on_resource_response;
|
|
|
|
GetStruct()->get_resource_response_filter =
|
|
|
|
resource_request_handler_get_resource_response_filter;
|
|
|
|
GetStruct()->on_resource_load_complete =
|
|
|
|
resource_request_handler_on_resource_load_complete;
|
|
|
|
GetStruct()->on_protocol_execution =
|
|
|
|
resource_request_handler_on_protocol_execution;
|
|
|
|
}
|
|
|
|
|
|
|
|
// DESTRUCTOR - Do not edit by hand.
|
|
|
|
|
2019-05-18 11:15:04 +02:00
|
|
|
CefResourceRequestHandlerCppToC::~CefResourceRequestHandlerCppToC() {}
|
2019-04-24 04:50:25 +02:00
|
|
|
|
|
|
|
template <>
|
|
|
|
CefRefPtr<CefResourceRequestHandler>
|
|
|
|
CefCppToCRefCounted<CefResourceRequestHandlerCppToC,
|
|
|
|
CefResourceRequestHandler,
|
|
|
|
cef_resource_request_handler_t>::
|
|
|
|
UnwrapDerived(CefWrapperType type, cef_resource_request_handler_t* s) {
|
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
|
|
|
|
CefCppToCRefCounted<CefResourceRequestHandlerCppToC,
|
|
|
|
CefResourceRequestHandler,
|
|
|
|
cef_resource_request_handler_t>::kWrapperType =
|
|
|
|
WT_RESOURCE_REQUEST_HANDLER;
|