Replace CefRequestCallback with CefCallback (fixes issue #1861)

CefRequestCallback::Continue(false) was the same as Cancel(), so we can just
use CefCallback instead.
This commit is contained in:
Marshall Greenblatt
2021-09-27 12:09:45 +03:00
parent 23be17f693
commit cbc5710801
33 changed files with 185 additions and 546 deletions

View File

@ -1,79 +0,0 @@
// Copyright (c) 2021 The Chromium Embedded Framework Authors. All rights
// 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.
//
// $hash=bee998a59050e372ea10d1ce146532c074b1a3ec$
//
#include "libcef_dll/cpptoc/request_callback_cpptoc.h"
#include "libcef_dll/shutdown_checker.h"
namespace {
// MEMBER FUNCTIONS - Body may be edited by hand.
void CEF_CALLBACK request_callback_cont(struct _cef_request_callback_t* self,
int allow) {
shutdown_checker::AssertNotShutdown();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Execute
CefRequestCallbackCppToC::Get(self)->Continue(allow ? true : false);
}
void CEF_CALLBACK
request_callback_cancel(struct _cef_request_callback_t* self) {
shutdown_checker::AssertNotShutdown();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Execute
CefRequestCallbackCppToC::Get(self)->Cancel();
}
} // namespace
// CONSTRUCTOR - Do not edit by hand.
CefRequestCallbackCppToC::CefRequestCallbackCppToC() {
GetStruct()->cont = request_callback_cont;
GetStruct()->cancel = request_callback_cancel;
}
// DESTRUCTOR - Do not edit by hand.
CefRequestCallbackCppToC::~CefRequestCallbackCppToC() {
shutdown_checker::AssertNotShutdown();
}
template <>
CefRefPtr<CefRequestCallback> CefCppToCRefCounted<
CefRequestCallbackCppToC,
CefRequestCallback,
cef_request_callback_t>::UnwrapDerived(CefWrapperType type,
cef_request_callback_t* s) {
NOTREACHED() << "Unexpected class type: " << type;
return nullptr;
}
template <>
CefWrapperType CefCppToCRefCounted<CefRequestCallbackCppToC,
CefRequestCallback,
cef_request_callback_t>::kWrapperType =
WT_REQUEST_CALLBACK;

View File

@ -1,38 +0,0 @@
// Copyright (c) 2021 The Chromium Embedded Framework Authors. All rights
// 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.
//
// $hash=bd2b56bd152e80651c9a3de4472891d7cf65b130$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_REQUEST_CALLBACK_CPPTOC_H_
#define CEF_LIBCEF_DLL_CPPTOC_REQUEST_CALLBACK_CPPTOC_H_
#pragma once
#if !defined(BUILDING_CEF_SHARED)
#error This file can be included DLL-side only
#endif
#include "include/capi/cef_request_callback_capi.h"
#include "include/cef_request_callback.h"
#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
// Wrap a C++ class with a C structure.
// This class may be instantiated and accessed DLL-side only.
class CefRequestCallbackCppToC
: public CefCppToCRefCounted<CefRequestCallbackCppToC,
CefRequestCallback,
cef_request_callback_t> {
public:
CefRequestCallbackCppToC();
virtual ~CefRequestCallbackCppToC();
};
#endif // CEF_LIBCEF_DLL_CPPTOC_REQUEST_CALLBACK_CPPTOC_H_

View File

@ -9,15 +9,15 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=baa4e92404f1c0b975c3724e649afb4ef04250f0$
// $hash=0a2ea84b20bc58f12e8e97d2b38a55448abd47dd$
//
#include "libcef_dll/cpptoc/request_handler_cpptoc.h"
#include "libcef_dll/cpptoc/resource_request_handler_cpptoc.h"
#include "libcef_dll/ctocpp/auth_callback_ctocpp.h"
#include "libcef_dll/ctocpp/browser_ctocpp.h"
#include "libcef_dll/ctocpp/callback_ctocpp.h"
#include "libcef_dll/ctocpp/frame_ctocpp.h"
#include "libcef_dll/ctocpp/request_callback_ctocpp.h"
#include "libcef_dll/ctocpp/request_ctocpp.h"
#include "libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.h"
#include "libcef_dll/ctocpp/sslinfo_ctocpp.h"
@ -206,7 +206,7 @@ request_handler_on_quota_request(struct _cef_request_handler_t* self,
cef_browser_t* browser,
const cef_string_t* origin_url,
int64 new_size,
cef_request_callback_t* callback) {
cef_callback_t* callback) {
shutdown_checker::AssertNotShutdown();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@ -230,7 +230,7 @@ request_handler_on_quota_request(struct _cef_request_handler_t* self,
// Execute
bool _retval = CefRequestHandlerCppToC::Get(self)->OnQuotaRequest(
CefBrowserCToCpp::Wrap(browser), CefString(origin_url), new_size,
CefRequestCallbackCToCpp::Wrap(callback));
CefCallbackCToCpp::Wrap(callback));
// Return type: bool
return _retval;
@ -242,7 +242,7 @@ request_handler_on_certificate_error(struct _cef_request_handler_t* self,
cef_errorcode_t cert_error,
const cef_string_t* request_url,
struct _cef_sslinfo_t* ssl_info,
cef_request_callback_t* callback) {
cef_callback_t* callback) {
shutdown_checker::AssertNotShutdown();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@ -270,8 +270,7 @@ request_handler_on_certificate_error(struct _cef_request_handler_t* self,
// Execute
bool _retval = CefRequestHandlerCppToC::Get(self)->OnCertificateError(
CefBrowserCToCpp::Wrap(browser), cert_error, CefString(request_url),
CefSSLInfoCToCpp::Wrap(ssl_info),
CefRequestCallbackCToCpp::Wrap(callback));
CefSSLInfoCToCpp::Wrap(ssl_info), CefCallbackCToCpp::Wrap(callback));
// Return type: bool
return _retval;

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=1009f2ed21a03d2a6e47372def61b0696055d4e1$
// $hash=e80900e24065ddf936bd64c2c40d70eddf47009c$
//
#include "libcef_dll/cpptoc/resource_request_handler_cpptoc.h"
@ -17,8 +17,8 @@
#include "libcef_dll/cpptoc/resource_handler_cpptoc.h"
#include "libcef_dll/cpptoc/response_filter_cpptoc.h"
#include "libcef_dll/ctocpp/browser_ctocpp.h"
#include "libcef_dll/ctocpp/callback_ctocpp.h"
#include "libcef_dll/ctocpp/frame_ctocpp.h"
#include "libcef_dll/ctocpp/request_callback_ctocpp.h"
#include "libcef_dll/ctocpp/request_ctocpp.h"
#include "libcef_dll/ctocpp/response_ctocpp.h"
@ -59,7 +59,7 @@ resource_request_handler_on_before_resource_load(
cef_browser_t* browser,
cef_frame_t* frame,
cef_request_t* request,
cef_request_callback_t* callback) {
cef_callback_t* callback) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
@ -79,8 +79,7 @@ resource_request_handler_on_before_resource_load(
cef_return_value_t _retval =
CefResourceRequestHandlerCppToC::Get(self)->OnBeforeResourceLoad(
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
CefRequestCToCpp::Wrap(request),
CefRequestCallbackCToCpp::Wrap(callback));
CefRequestCToCpp::Wrap(request), CefCallbackCToCpp::Wrap(callback));
// Return type: simple
return _retval;