mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-02-16 20:20:51 +01:00
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:
parent
23be17f693
commit
cbc5710801
@ -8,7 +8,7 @@
|
||||
# by hand. See the translator.README.txt file in the tools directory for
|
||||
# more information.
|
||||
#
|
||||
# $hash=216bf0511bdceca67cdbdcf30f8316db2d00e276$
|
||||
# $hash=42b9ae0a0ee20489699d69dcdbcbf8ad3265f821$
|
||||
#
|
||||
|
||||
{
|
||||
@ -62,7 +62,6 @@
|
||||
'include/cef_render_handler.h',
|
||||
'include/cef_render_process_handler.h',
|
||||
'include/cef_request.h',
|
||||
'include/cef_request_callback.h',
|
||||
'include/cef_request_context.h',
|
||||
'include/cef_request_context_handler.h',
|
||||
'include/cef_request_handler.h',
|
||||
@ -162,7 +161,6 @@
|
||||
'include/capi/cef_render_handler_capi.h',
|
||||
'include/capi/cef_render_process_handler_capi.h',
|
||||
'include/capi/cef_request_capi.h',
|
||||
'include/capi/cef_request_callback_capi.h',
|
||||
'include/capi/cef_request_context_capi.h',
|
||||
'include/capi/cef_request_context_handler_capi.h',
|
||||
'include/capi/cef_request_handler_capi.h',
|
||||
@ -388,8 +386,6 @@
|
||||
'libcef_dll/ctocpp/render_process_handler_ctocpp.h',
|
||||
'libcef_dll/cpptoc/request_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/request_cpptoc.h',
|
||||
'libcef_dll/cpptoc/request_callback_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/request_callback_cpptoc.h',
|
||||
'libcef_dll/cpptoc/request_context_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/request_context_cpptoc.h',
|
||||
'libcef_dll/ctocpp/request_context_handler_ctocpp.cc',
|
||||
@ -700,8 +696,6 @@
|
||||
'libcef_dll/cpptoc/render_process_handler_cpptoc.h',
|
||||
'libcef_dll/ctocpp/request_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/request_ctocpp.h',
|
||||
'libcef_dll/ctocpp/request_callback_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/request_callback_ctocpp.h',
|
||||
'libcef_dll/ctocpp/request_context_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/request_context_ctocpp.h',
|
||||
'libcef_dll/cpptoc/request_context_handler_cpptoc.cc',
|
||||
|
@ -1,74 +0,0 @@
|
||||
// Copyright (c) 2021 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool and should not edited
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=273af5bd01c6ab5d4df8efb2af2b4e2da9c21760$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CALLBACK_CAPI_H_
|
||||
#define CEF_INCLUDE_CAPI_CEF_REQUEST_CALLBACK_CAPI_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
///
|
||||
// Callback structure used for asynchronous continuation of url requests.
|
||||
///
|
||||
typedef struct _cef_request_callback_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
cef_base_ref_counted_t base;
|
||||
|
||||
///
|
||||
// Continue the url request. If |allow| is true (1) the request will be
|
||||
// continued. Otherwise, the request will be canceled.
|
||||
///
|
||||
void(CEF_CALLBACK* cont)(struct _cef_request_callback_t* self, int allow);
|
||||
|
||||
///
|
||||
// Cancel the url request.
|
||||
///
|
||||
void(CEF_CALLBACK* cancel)(struct _cef_request_callback_t* self);
|
||||
} cef_request_callback_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CEF_INCLUDE_CAPI_CEF_REQUEST_CALLBACK_CAPI_H_
|
@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=1d8b3f540a8305ce1738c5fe7c716434062c67b0$
|
||||
// $hash=83ff671e8a4db001029be8a02a414333fe4354af$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_HANDLER_CAPI_H_
|
||||
@ -43,8 +43,8 @@
|
||||
#include "include/capi/cef_auth_callback_capi.h"
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
#include "include/capi/cef_browser_capi.h"
|
||||
#include "include/capi/cef_callback_capi.h"
|
||||
#include "include/capi/cef_frame_capi.h"
|
||||
#include "include/capi/cef_request_callback_capi.h"
|
||||
#include "include/capi/cef_request_capi.h"
|
||||
#include "include/capi/cef_resource_request_handler_capi.h"
|
||||
#include "include/capi/cef_ssl_info_capi.h"
|
||||
@ -180,31 +180,30 @@ typedef struct _cef_request_handler_t {
|
||||
// size via the webkitStorageInfo.requestQuota function. |origin_url| is the
|
||||
// origin of the page making the request. |new_size| is the requested quota
|
||||
// size in bytes. Return true (1) to continue the request and call
|
||||
// cef_request_callback_t::cont() either in this function or at a later time
|
||||
// to grant or deny the request. Return false (0) to cancel the request
|
||||
// cef_callback_t functions either in this function or at a later time to
|
||||
// grant or deny the request. Return false (0) to cancel the request
|
||||
// immediately.
|
||||
///
|
||||
int(CEF_CALLBACK* on_quota_request)(struct _cef_request_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
const cef_string_t* origin_url,
|
||||
int64 new_size,
|
||||
struct _cef_request_callback_t* callback);
|
||||
struct _cef_callback_t* callback);
|
||||
|
||||
///
|
||||
// Called on the UI thread to handle requests for URLs with an invalid SSL
|
||||
// certificate. Return true (1) and call cef_request_callback_t::cont() either
|
||||
// in this function or at a later time to continue or cancel the request.
|
||||
// Return false (0) to cancel the request immediately. If
|
||||
// certificate. Return true (1) and call cef_callback_t functions either in
|
||||
// this function or at a later time to continue or cancel the request. Return
|
||||
// false (0) to cancel the request immediately. If
|
||||
// CefSettings.ignore_certificate_errors is set all invalid certificates will
|
||||
// be accepted without calling this function.
|
||||
///
|
||||
int(CEF_CALLBACK* on_certificate_error)(
|
||||
struct _cef_request_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
cef_errorcode_t cert_error,
|
||||
const cef_string_t* request_url,
|
||||
struct _cef_sslinfo_t* ssl_info,
|
||||
struct _cef_request_callback_t* callback);
|
||||
int(CEF_CALLBACK* on_certificate_error)(struct _cef_request_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
cef_errorcode_t cert_error,
|
||||
const cef_string_t* request_url,
|
||||
struct _cef_sslinfo_t* ssl_info,
|
||||
struct _cef_callback_t* callback);
|
||||
|
||||
///
|
||||
// Called on the UI thread when a client certificate is being requested for
|
||||
|
@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=aec52d0efc8407495fe1fc4821616673da7ed17a$
|
||||
// $hash=7276396521b8b61cf856050244f558baa3a52e04$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_REQUEST_HANDLER_CAPI_H_
|
||||
@ -42,8 +42,8 @@
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
#include "include/capi/cef_browser_capi.h"
|
||||
#include "include/capi/cef_callback_capi.h"
|
||||
#include "include/capi/cef_frame_capi.h"
|
||||
#include "include/capi/cef_request_callback_capi.h"
|
||||
#include "include/capi/cef_request_capi.h"
|
||||
#include "include/capi/cef_resource_handler_capi.h"
|
||||
#include "include/capi/cef_response_capi.h"
|
||||
@ -87,8 +87,8 @@ typedef struct _cef_resource_request_handler_t {
|
||||
// or change the resource load optionally modify |request|. Modification of
|
||||
// the request URL will be treated as a redirect. Return RV_CONTINUE to
|
||||
// continue the request immediately. Return RV_CONTINUE_ASYNC and call
|
||||
// cef_request_callback_t:: cont() at a later time to continue or cancel the
|
||||
// request asynchronously. Return RV_CANCEL to cancel the request immediately.
|
||||
// cef_callback_t functions at a later time to continue or cancel the request
|
||||
// asynchronously. Return RV_CANCEL to cancel the request immediately.
|
||||
//
|
||||
///
|
||||
cef_return_value_t(CEF_CALLBACK* on_before_resource_load)(
|
||||
@ -96,7 +96,7 @@ typedef struct _cef_resource_request_handler_t {
|
||||
struct _cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame,
|
||||
struct _cef_request_t* request,
|
||||
struct _cef_request_callback_t* callback);
|
||||
struct _cef_callback_t* callback);
|
||||
|
||||
///
|
||||
// Called on the IO thread before a resource is loaded. The |browser| and
|
||||
|
@ -42,13 +42,13 @@
|
||||
// way that may cause binary incompatibility with other builds. The universal
|
||||
// hash value will change if any platform is affected whereas the platform hash
|
||||
// values will change only if that particular platform is affected.
|
||||
#define CEF_API_HASH_UNIVERSAL "1783cba4ad54d26940bea3dab4d5210d0ebda9db"
|
||||
#define CEF_API_HASH_UNIVERSAL "7bc6f4ca51afa11542e22d0a3b1ccb796fa0aaa1"
|
||||
#if defined(OS_WIN)
|
||||
#define CEF_API_HASH_PLATFORM "4c2476c02471c6efbff092d4dc6c25dd79237e69"
|
||||
#define CEF_API_HASH_PLATFORM "b5f894040c9668ed03c19976275e0611cd24b0c0"
|
||||
#elif defined(OS_MAC)
|
||||
#define CEF_API_HASH_PLATFORM "179a654c191179792e2d38d54eacbf0ff7169db4"
|
||||
#define CEF_API_HASH_PLATFORM "539d29daac8c7aa3ed8c19fedbb2effdc58d33d2"
|
||||
#elif defined(OS_LINUX)
|
||||
#define CEF_API_HASH_PLATFORM "3766b0601ad47bef0325cde35c33f9b739f5b32a"
|
||||
#define CEF_API_HASH_PLATFORM "fe6dd0bea2361d1b5eddd10035d5aa8cd31a552c"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -1,63 +0,0 @@
|
||||
// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the names of its contributors may be used to endorse
|
||||
// or promote products derived from this software without specific prior
|
||||
// written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// The contents of this file must follow a specific format in order to
|
||||
// support the CEF translator tool. See the translator.README.txt file in the
|
||||
// tools directory for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CEF_REQUEST_CALLBACK_H_
|
||||
#define CEF_INCLUDE_CEF_REQUEST_CALLBACK_H_
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
|
||||
///
|
||||
// Callback interface used for asynchronous continuation of url requests.
|
||||
///
|
||||
/*--cef(source=library)--*/
|
||||
class CefRequestCallback : public virtual CefBaseRefCounted {
|
||||
public:
|
||||
///
|
||||
// Continue the url request. If |allow| is true the request will be continued.
|
||||
// Otherwise, the request will be canceled.
|
||||
///
|
||||
/*--cef(capi_name=cont)--*/
|
||||
virtual void Continue(bool allow) = 0;
|
||||
|
||||
///
|
||||
// Cancel the url request.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void Cancel() = 0;
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_REQUEST_CALLBACK_H_
|
@ -43,9 +43,9 @@
|
||||
#include "include/cef_auth_callback.h"
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_browser.h"
|
||||
#include "include/cef_callback.h"
|
||||
#include "include/cef_frame.h"
|
||||
#include "include/cef_request.h"
|
||||
#include "include/cef_request_callback.h"
|
||||
#include "include/cef_resource_request_handler.h"
|
||||
#include "include/cef_ssl_info.h"
|
||||
#include "include/cef_x509_certificate.h"
|
||||
@ -176,32 +176,32 @@ class CefRequestHandler : public virtual CefBaseRefCounted {
|
||||
// Called on the IO thread when JavaScript requests a specific storage quota
|
||||
// size via the webkitStorageInfo.requestQuota function. |origin_url| is the
|
||||
// origin of the page making the request. |new_size| is the requested quota
|
||||
// size in bytes. Return true to continue the request and call
|
||||
// CefRequestCallback::Continue() either in this method or at a later time to
|
||||
// grant or deny the request. Return false to cancel the request immediately.
|
||||
// size in bytes. Return true to continue the request and call CefCallback
|
||||
// methods either in this method or at a later time to grant or deny the
|
||||
// request. Return false to cancel the request immediately.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool OnQuotaRequest(CefRefPtr<CefBrowser> browser,
|
||||
const CefString& origin_url,
|
||||
int64 new_size,
|
||||
CefRefPtr<CefRequestCallback> callback) {
|
||||
CefRefPtr<CefCallback> callback) {
|
||||
return false;
|
||||
}
|
||||
|
||||
///
|
||||
// Called on the UI thread to handle requests for URLs with an invalid
|
||||
// SSL certificate. Return true and call CefRequestCallback::Continue() either
|
||||
// in this method or at a later time to continue or cancel the request. Return
|
||||
// false to cancel the request immediately. If
|
||||
// CefSettings.ignore_certificate_errors is set all invalid certificates will
|
||||
// be accepted without calling this method.
|
||||
// SSL certificate. Return true and call CefCallback methods either in this
|
||||
// method or at a later time to continue or cancel the request. Return false
|
||||
// to cancel the request immediately. If CefSettings.ignore_certificate_errors
|
||||
// is set all invalid certificates will be accepted without calling this
|
||||
// method.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool OnCertificateError(CefRefPtr<CefBrowser> browser,
|
||||
cef_errorcode_t cert_error,
|
||||
const CefString& request_url,
|
||||
CefRefPtr<CefSSLInfo> ssl_info,
|
||||
CefRefPtr<CefRequestCallback> callback) {
|
||||
CefRefPtr<CefCallback> callback) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -40,9 +40,9 @@
|
||||
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_browser.h"
|
||||
#include "include/cef_callback.h"
|
||||
#include "include/cef_frame.h"
|
||||
#include "include/cef_request.h"
|
||||
#include "include/cef_request_callback.h"
|
||||
#include "include/cef_resource_handler.h"
|
||||
#include "include/cef_response.h"
|
||||
#include "include/cef_response_filter.h"
|
||||
@ -81,18 +81,17 @@ class CefResourceRequestHandler : public virtual CefBaseRefCounted {
|
||||
// requests originating from service workers or CefURLRequest. To redirect or
|
||||
// change the resource load optionally modify |request|. Modification of the
|
||||
// request URL will be treated as a redirect. Return RV_CONTINUE to continue
|
||||
// the request immediately. Return RV_CONTINUE_ASYNC and call
|
||||
// CefRequestCallback:: Continue() at a later time to continue or cancel the
|
||||
// request asynchronously. Return RV_CANCEL to cancel the request immediately.
|
||||
// the request immediately. Return RV_CONTINUE_ASYNC and call CefCallback
|
||||
// methods at a later time to continue or cancel the request asynchronously.
|
||||
// Return RV_CANCEL to cancel the request immediately.
|
||||
//
|
||||
///
|
||||
/*--cef(optional_param=browser,optional_param=frame,
|
||||
default_retval=RV_CONTINUE)--*/
|
||||
virtual ReturnValue OnBeforeResourceLoad(
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefRequestCallback> callback) {
|
||||
virtual ReturnValue OnBeforeResourceLoad(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefCallback> callback) {
|
||||
return RV_CONTINUE;
|
||||
}
|
||||
|
||||
|
@ -292,11 +292,10 @@ class CefResourceManager
|
||||
// Called from CefRequestHandler::OnBeforeResourceLoad on the browser process
|
||||
// IO thread.
|
||||
///
|
||||
cef_return_value_t OnBeforeResourceLoad(
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefRequestCallback> callback);
|
||||
cef_return_value_t OnBeforeResourceLoad(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefCallback> callback);
|
||||
|
||||
///
|
||||
// Called from CefRequestHandler::GetResourceHandler on the browser process
|
||||
@ -327,7 +326,7 @@ class CefResourceManager
|
||||
base::WeakPtr<CefResourceManager> manager_;
|
||||
|
||||
// Callback to execute once request handling is complete.
|
||||
CefRefPtr<CefRequestCallback> callback_;
|
||||
CefRefPtr<CefCallback> callback_;
|
||||
|
||||
// Position of the currently associated ProviderEntry in the |providers_|
|
||||
// list.
|
||||
|
@ -162,7 +162,7 @@
|
||||
|
||||
namespace {
|
||||
|
||||
class CefQuotaCallbackImpl : public CefRequestCallback {
|
||||
class CefQuotaCallbackImpl : public CefCallback {
|
||||
public:
|
||||
using CallbackType = content::QuotaPermissionContext::PermissionCallback;
|
||||
|
||||
@ -181,22 +181,24 @@ class CefQuotaCallbackImpl : public CefRequestCallback {
|
||||
}
|
||||
}
|
||||
|
||||
void Continue(bool allow) override {
|
||||
void Continue() override { ContinueNow(true); }
|
||||
|
||||
void Cancel() override { ContinueNow(false); }
|
||||
|
||||
CallbackType Disconnect() WARN_UNUSED_RESULT { return std::move(callback_); }
|
||||
|
||||
private:
|
||||
void ContinueNow(bool allow) {
|
||||
if (CEF_CURRENTLY_ON_IOT()) {
|
||||
if (!callback_.is_null()) {
|
||||
RunNow(std::move(callback_), allow);
|
||||
}
|
||||
} else {
|
||||
CEF_POST_TASK(CEF_IOT, base::BindOnce(&CefQuotaCallbackImpl::Continue,
|
||||
CEF_POST_TASK(CEF_IOT, base::BindOnce(&CefQuotaCallbackImpl::ContinueNow,
|
||||
this, allow));
|
||||
}
|
||||
}
|
||||
|
||||
void Cancel() override { Continue(false); }
|
||||
|
||||
CallbackType Disconnect() WARN_UNUSED_RESULT { return std::move(callback_); }
|
||||
|
||||
private:
|
||||
static void RunNow(CallbackType callback, bool allow) {
|
||||
CEF_REQUIRE_IOT();
|
||||
std::move(callback).Run(
|
||||
@ -211,7 +213,7 @@ class CefQuotaCallbackImpl : public CefRequestCallback {
|
||||
DISALLOW_COPY_AND_ASSIGN(CefQuotaCallbackImpl);
|
||||
};
|
||||
|
||||
class CefAllowCertificateErrorCallbackImpl : public CefRequestCallback {
|
||||
class CefAllowCertificateErrorCallbackImpl : public CefCallback {
|
||||
public:
|
||||
typedef base::OnceCallback<void(content::CertificateRequestResultType)>
|
||||
CallbackType;
|
||||
@ -233,7 +235,14 @@ class CefAllowCertificateErrorCallbackImpl : public CefRequestCallback {
|
||||
}
|
||||
}
|
||||
|
||||
void Continue(bool allow) override {
|
||||
void Continue() override { ContinueNow(true); }
|
||||
|
||||
void Cancel() override { ContinueNow(false); }
|
||||
|
||||
CallbackType Disconnect() WARN_UNUSED_RESULT { return std::move(callback_); }
|
||||
|
||||
private:
|
||||
void ContinueNow(bool allow) {
|
||||
if (CEF_CURRENTLY_ON_UIT()) {
|
||||
if (!callback_.is_null()) {
|
||||
RunNow(std::move(callback_), allow);
|
||||
@ -241,16 +250,11 @@ class CefAllowCertificateErrorCallbackImpl : public CefRequestCallback {
|
||||
} else {
|
||||
CEF_POST_TASK(
|
||||
CEF_UIT,
|
||||
base::BindOnce(&CefAllowCertificateErrorCallbackImpl::Continue, this,
|
||||
allow));
|
||||
base::BindOnce(&CefAllowCertificateErrorCallbackImpl::ContinueNow,
|
||||
this, allow));
|
||||
}
|
||||
}
|
||||
|
||||
void Cancel() override { Continue(false); }
|
||||
|
||||
CallbackType Disconnect() WARN_UNUSED_RESULT { return std::move(callback_); }
|
||||
|
||||
private:
|
||||
static void RunNow(CallbackType callback, bool allow) {
|
||||
CEF_REQUIRE_UIT();
|
||||
std::move(callback).Run(
|
||||
|
@ -41,7 +41,7 @@ namespace {
|
||||
const int kLoadNoCookiesFlags =
|
||||
net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SAVE_COOKIES;
|
||||
|
||||
class RequestCallbackWrapper : public CefRequestCallback {
|
||||
class RequestCallbackWrapper : public CefCallback {
|
||||
public:
|
||||
using Callback = base::OnceCallback<void(bool /* allow */)>;
|
||||
explicit RequestCallbackWrapper(Callback callback)
|
||||
@ -56,11 +56,16 @@ class RequestCallbackWrapper : public CefRequestCallback {
|
||||
}
|
||||
}
|
||||
|
||||
void Continue(bool allow) override {
|
||||
void Continue() override { ContinueNow(true); }
|
||||
|
||||
void Cancel() override { ContinueNow(false); }
|
||||
|
||||
private:
|
||||
void ContinueNow(bool allow) {
|
||||
if (!work_thread_task_runner_->RunsTasksInCurrentSequence()) {
|
||||
work_thread_task_runner_->PostTask(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&RequestCallbackWrapper::Continue, this, allow));
|
||||
base::BindOnce(&RequestCallbackWrapper::ContinueNow, this, allow));
|
||||
return;
|
||||
}
|
||||
if (!callback_.is_null()) {
|
||||
@ -68,9 +73,6 @@ class RequestCallbackWrapper : public CefRequestCallback {
|
||||
}
|
||||
}
|
||||
|
||||
void Cancel() override { Continue(false); }
|
||||
|
||||
private:
|
||||
Callback callback_;
|
||||
|
||||
scoped_refptr<base::SequencedTaskRunner> work_thread_task_runner_;
|
||||
@ -584,8 +586,13 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler {
|
||||
init_state_->browser_, init_state_->frame_,
|
||||
state->pending_request_.get(), callbackPtr.get());
|
||||
if (retval != RV_CONTINUE_ASYNC) {
|
||||
// Continue or cancel the request immediately.
|
||||
callbackPtr->Continue(retval == RV_CONTINUE);
|
||||
if (retval == RV_CONTINUE) {
|
||||
// Continue the request immediately.
|
||||
callbackPtr->Continue();
|
||||
} else {
|
||||
// Cancel the request immediately.
|
||||
callbackPtr->Cancel();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// The scheme factory may choose to handle it.
|
||||
|
@ -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;
|
@ -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_
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -1,70 +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=9fb040d47f4b6627904cc50518d0293bfe11d25d$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/request_callback_ctocpp.h"
|
||||
#include "libcef_dll/shutdown_checker.h"
|
||||
|
||||
// VIRTUAL METHODS - Body may be edited by hand.
|
||||
|
||||
NO_SANITIZE("cfi-icall") void CefRequestCallbackCToCpp::Continue(bool allow) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_request_callback_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, cont))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
_struct->cont(_struct, allow);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall") void CefRequestCallbackCToCpp::Cancel() {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_request_callback_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, cancel))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
_struct->cancel(_struct);
|
||||
}
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefRequestCallbackCToCpp::CefRequestCallbackCToCpp() {}
|
||||
|
||||
// DESTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefRequestCallbackCToCpp::~CefRequestCallbackCToCpp() {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
}
|
||||
|
||||
template <>
|
||||
cef_request_callback_t* CefCToCppRefCounted<
|
||||
CefRequestCallbackCToCpp,
|
||||
CefRequestCallback,
|
||||
cef_request_callback_t>::UnwrapDerived(CefWrapperType type,
|
||||
CefRequestCallback* c) {
|
||||
NOTREACHED() << "Unexpected class type: " << type;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
CefWrapperType CefCToCppRefCounted<CefRequestCallbackCToCpp,
|
||||
CefRequestCallback,
|
||||
cef_request_callback_t>::kWrapperType =
|
||||
WT_REQUEST_CALLBACK;
|
@ -1,42 +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=49871b71a226d36c9c60ac06c2a242c106766d34$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_REQUEST_CALLBACK_CTOCPP_H_
|
||||
#define CEF_LIBCEF_DLL_CTOCPP_REQUEST_CALLBACK_CTOCPP_H_
|
||||
#pragma once
|
||||
|
||||
#if !defined(WRAPPING_CEF_SHARED)
|
||||
#error This file can be included wrapper-side only
|
||||
#endif
|
||||
|
||||
#include "include/capi/cef_request_callback_capi.h"
|
||||
#include "include/cef_request_callback.h"
|
||||
#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
|
||||
|
||||
// Wrap a C structure with a C++ class.
|
||||
// This class may be instantiated and accessed wrapper-side only.
|
||||
class CefRequestCallbackCToCpp
|
||||
: public CefCToCppRefCounted<CefRequestCallbackCToCpp,
|
||||
CefRequestCallback,
|
||||
cef_request_callback_t> {
|
||||
public:
|
||||
CefRequestCallbackCToCpp();
|
||||
virtual ~CefRequestCallbackCToCpp();
|
||||
|
||||
// CefRequestCallback methods.
|
||||
void Continue(bool allow) override;
|
||||
void Cancel() override;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_REQUEST_CALLBACK_CTOCPP_H_
|
@ -9,14 +9,14 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=cac9a84a4ddb5aa01e9c6fc97f5c4bcb4f4c368f$
|
||||
// $hash=73d4abe535f9bec5507447e8d8139ed0fa4b2875$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/request_handler_ctocpp.h"
|
||||
#include "libcef_dll/cpptoc/auth_callback_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/browser_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/callback_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/frame_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/request_callback_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/request_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/sslinfo_cpptoc.h"
|
||||
@ -100,14 +100,15 @@ bool CefRequestHandlerCToCpp::OnOpenURLFromTab(
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
CefRefPtr<CefResourceRequestHandler> CefRequestHandlerCToCpp::
|
||||
GetResourceRequestHandler(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
bool is_navigation,
|
||||
bool is_download,
|
||||
const CefString& request_initiator,
|
||||
bool& disable_default_handling) {
|
||||
CefRefPtr<CefResourceRequestHandler>
|
||||
CefRequestHandlerCToCpp::GetResourceRequestHandler(
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
bool is_navigation,
|
||||
bool is_download,
|
||||
const CefString& request_initiator,
|
||||
bool& disable_default_handling) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_request_handler_t* _struct = GetStruct();
|
||||
@ -194,11 +195,10 @@ bool CefRequestHandlerCToCpp::GetAuthCredentials(
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
bool CefRequestHandlerCToCpp::OnQuotaRequest(
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
const CefString& origin_url,
|
||||
int64 new_size,
|
||||
CefRefPtr<CefRequestCallback> callback) {
|
||||
bool CefRequestHandlerCToCpp::OnQuotaRequest(CefRefPtr<CefBrowser> browser,
|
||||
const CefString& origin_url,
|
||||
int64 new_size,
|
||||
CefRefPtr<CefCallback> callback) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_request_handler_t* _struct = GetStruct();
|
||||
@ -223,7 +223,7 @@ bool CefRequestHandlerCToCpp::OnQuotaRequest(
|
||||
// Execute
|
||||
int _retval = _struct->on_quota_request(
|
||||
_struct, CefBrowserCppToC::Wrap(browser), origin_url.GetStruct(),
|
||||
new_size, CefRequestCallbackCppToC::Wrap(callback));
|
||||
new_size, CefCallbackCppToC::Wrap(callback));
|
||||
|
||||
// Return type: bool
|
||||
return _retval ? true : false;
|
||||
@ -235,7 +235,7 @@ bool CefRequestHandlerCToCpp::OnCertificateError(
|
||||
cef_errorcode_t cert_error,
|
||||
const CefString& request_url,
|
||||
CefRefPtr<CefSSLInfo> ssl_info,
|
||||
CefRefPtr<CefRequestCallback> callback) {
|
||||
CefRefPtr<CefCallback> callback) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_request_handler_t* _struct = GetStruct();
|
||||
@ -265,7 +265,7 @@ bool CefRequestHandlerCToCpp::OnCertificateError(
|
||||
int _retval = _struct->on_certificate_error(
|
||||
_struct, CefBrowserCppToC::Wrap(browser), cert_error,
|
||||
request_url.GetStruct(), CefSSLInfoCppToC::Wrap(ssl_info),
|
||||
CefRequestCallbackCppToC::Wrap(callback));
|
||||
CefCallbackCppToC::Wrap(callback));
|
||||
|
||||
// Return type: bool
|
||||
return _retval ? true : false;
|
||||
|
@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=771c124f112f02314f57b5f9bd475afe6cef3242$
|
||||
// $hash=cc1503e0678dd6c15b282a3432830262f9a0d93e$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_REQUEST_HANDLER_CTOCPP_H_
|
||||
@ -64,12 +64,12 @@ class CefRequestHandlerCToCpp
|
||||
bool OnQuotaRequest(CefRefPtr<CefBrowser> browser,
|
||||
const CefString& origin_url,
|
||||
int64 new_size,
|
||||
CefRefPtr<CefRequestCallback> callback) override;
|
||||
CefRefPtr<CefCallback> callback) override;
|
||||
bool OnCertificateError(CefRefPtr<CefBrowser> browser,
|
||||
cef_errorcode_t cert_error,
|
||||
const CefString& request_url,
|
||||
CefRefPtr<CefSSLInfo> ssl_info,
|
||||
CefRefPtr<CefRequestCallback> callback) override;
|
||||
CefRefPtr<CefCallback> callback) override;
|
||||
bool OnSelectClientCertificate(
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
bool isProxy,
|
||||
|
@ -9,13 +9,13 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=a53f4f53f8063044f5c82870f2cef1ef89a91d83$
|
||||
// $hash=f2ef36943d3cb292573201d2b15b4406d9aaeab4$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/resource_request_handler_ctocpp.h"
|
||||
#include "libcef_dll/cpptoc/browser_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/callback_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/frame_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/request_callback_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/request_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/response_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/cookie_access_filter_ctocpp.h"
|
||||
@ -25,10 +25,11 @@
|
||||
// VIRTUAL METHODS - Body may be edited by hand.
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
CefRefPtr<CefCookieAccessFilter> CefResourceRequestHandlerCToCpp::
|
||||
GetCookieAccessFilter(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request) {
|
||||
CefRefPtr<CefCookieAccessFilter>
|
||||
CefResourceRequestHandlerCToCpp::GetCookieAccessFilter(
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request) {
|
||||
cef_resource_request_handler_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, get_cookie_access_filter))
|
||||
return nullptr;
|
||||
@ -52,11 +53,11 @@ CefRefPtr<CefCookieAccessFilter> CefResourceRequestHandlerCToCpp::
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
CefResourceRequestHandler::ReturnValue
|
||||
CefResourceRequestHandlerCToCpp::OnBeforeResourceLoad(
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefRequestCallback> callback) {
|
||||
CefResourceRequestHandlerCToCpp::OnBeforeResourceLoad(
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefCallback> callback) {
|
||||
cef_resource_request_handler_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, on_before_resource_load))
|
||||
return RV_CONTINUE;
|
||||
@ -76,18 +77,18 @@ CefResourceRequestHandler::ReturnValue
|
||||
// Execute
|
||||
cef_return_value_t _retval = _struct->on_before_resource_load(
|
||||
_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame),
|
||||
CefRequestCppToC::Wrap(request),
|
||||
CefRequestCallbackCppToC::Wrap(callback));
|
||||
CefRequestCppToC::Wrap(request), CefCallbackCppToC::Wrap(callback));
|
||||
|
||||
// Return type: simple
|
||||
return _retval;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
CefRefPtr<CefResourceHandler> CefResourceRequestHandlerCToCpp::
|
||||
GetResourceHandler(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request) {
|
||||
CefRefPtr<CefResourceHandler>
|
||||
CefResourceRequestHandlerCToCpp::GetResourceHandler(
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request) {
|
||||
cef_resource_request_handler_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, get_resource_handler))
|
||||
return nullptr;
|
||||
@ -171,11 +172,12 @@ bool CefResourceRequestHandlerCToCpp::OnResourceResponse(
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
CefRefPtr<CefResponseFilter> CefResourceRequestHandlerCToCpp::
|
||||
GetResourceResponseFilter(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefResponse> response) {
|
||||
CefRefPtr<CefResponseFilter>
|
||||
CefResourceRequestHandlerCToCpp::GetResourceResponseFilter(
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefResponse> response) {
|
||||
cef_resource_request_handler_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, get_resource_response_filter))
|
||||
return nullptr;
|
||||
|
@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=0168c1a4e9321014b8a0a9434ea85f89de100cc7$
|
||||
// $hash=a3d6561daffb943b551a27f1aa7fe9a58848df98$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_RESOURCE_REQUEST_HANDLER_CTOCPP_H_
|
||||
@ -39,11 +39,10 @@ class CefResourceRequestHandlerCToCpp
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request) override;
|
||||
ReturnValue OnBeforeResourceLoad(
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefRequestCallback> callback) override;
|
||||
ReturnValue OnBeforeResourceLoad(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefCallback> callback) override;
|
||||
CefRefPtr<CefResourceHandler> GetResourceHandler(
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
|
@ -324,7 +324,7 @@ struct CefResourceManager::ProviderEntry {
|
||||
CefResourceManager::RequestState::~RequestState() {
|
||||
// Always execute the callback.
|
||||
if (callback_.get())
|
||||
callback_->Continue(true);
|
||||
callback_->Continue();
|
||||
}
|
||||
|
||||
// CefResourceManager::Request implementation.
|
||||
@ -558,7 +558,7 @@ cef_return_value_t CefResourceManager::OnBeforeResourceLoad(
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefRequestCallback> callback) {
|
||||
CefRefPtr<CefCallback> callback) {
|
||||
CEF_REQUIRE_IO_THREAD();
|
||||
|
||||
// Find the first provider that is not pending deletion.
|
||||
|
@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=e09286ac977f5f06cf356eb8a5e04b48b0836523$
|
||||
// $hash=850ad8962e4c70f0c244fe79b96b8189ae9c3aa8$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_WRAPPER_TYPES_H_
|
||||
@ -106,7 +106,6 @@ enum CefWrapperType {
|
||||
WT_RENDER_HANDLER,
|
||||
WT_RENDER_PROCESS_HANDLER,
|
||||
WT_REQUEST,
|
||||
WT_REQUEST_CALLBACK,
|
||||
WT_REQUEST_CONTEXT,
|
||||
WT_REQUEST_CONTEXT_HANDLER,
|
||||
WT_REQUEST_HANDLER,
|
||||
|
@ -771,13 +771,16 @@ bool ClientHandler::GetAuthCredentials(CefRefPtr<CefBrowser> browser,
|
||||
bool ClientHandler::OnQuotaRequest(CefRefPtr<CefBrowser> browser,
|
||||
const CefString& origin_url,
|
||||
int64 new_size,
|
||||
CefRefPtr<CefRequestCallback> callback) {
|
||||
CefRefPtr<CefCallback> callback) {
|
||||
CEF_REQUIRE_IO_THREAD();
|
||||
|
||||
static const int64 max_size = 1024 * 1024 * 20; // 20mb.
|
||||
|
||||
// Grant the quota request if the size is reasonable.
|
||||
callback->Continue(new_size <= max_size);
|
||||
if (new_size <= max_size)
|
||||
callback->Continue();
|
||||
else
|
||||
callback->Cancel();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -785,13 +788,13 @@ bool ClientHandler::OnCertificateError(CefRefPtr<CefBrowser> browser,
|
||||
ErrorCode cert_error,
|
||||
const CefString& request_url,
|
||||
CefRefPtr<CefSSLInfo> ssl_info,
|
||||
CefRefPtr<CefRequestCallback> callback) {
|
||||
CefRefPtr<CefCallback> callback) {
|
||||
CEF_REQUIRE_UI_THREAD();
|
||||
|
||||
if (cert_error == ERR_CERT_AUTHORITY_INVALID &&
|
||||
request_url.ToString().find("https://www.magpcss.org/") == 0U) {
|
||||
// Allow the CEF Forum to load. It has a self-signed certificate.
|
||||
callback->Continue(true);
|
||||
callback->Continue();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -887,7 +890,7 @@ cef_return_value_t ClientHandler::OnBeforeResourceLoad(
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefRequestCallback> callback) {
|
||||
CefRefPtr<CefCallback> callback) {
|
||||
CEF_REQUIRE_IO_THREAD();
|
||||
|
||||
return resource_manager_->OnBeforeResourceLoad(browser, frame, request,
|
||||
|
@ -249,12 +249,12 @@ class ClientHandler : public CefClient,
|
||||
bool OnQuotaRequest(CefRefPtr<CefBrowser> browser,
|
||||
const CefString& origin_url,
|
||||
int64 new_size,
|
||||
CefRefPtr<CefRequestCallback> callback) override;
|
||||
CefRefPtr<CefCallback> callback) override;
|
||||
bool OnCertificateError(CefRefPtr<CefBrowser> browser,
|
||||
ErrorCode cert_error,
|
||||
const CefString& request_url,
|
||||
CefRefPtr<CefSSLInfo> ssl_info,
|
||||
CefRefPtr<CefRequestCallback> callback) override;
|
||||
CefRefPtr<CefCallback> callback) override;
|
||||
bool OnSelectClientCertificate(
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
bool isProxy,
|
||||
@ -271,7 +271,7 @@ class ClientHandler : public CefClient,
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefRequestCallback> callback) override;
|
||||
CefRefPtr<CefCallback> callback) override;
|
||||
CefRefPtr<CefResourceHandler> GetResourceHandler(
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
|
@ -2080,7 +2080,7 @@ class CookieRestartTestHandler : public RoutingTestHandler,
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefRequestCallback> callback) override {
|
||||
CefRefPtr<CefCallback> callback) override {
|
||||
EXPECT_IO_THREAD();
|
||||
before_resource_load_ct_++;
|
||||
|
||||
|
@ -388,7 +388,7 @@ class HistoryNavTestHandler : public TestHandler {
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefRequestCallback> callback) override {
|
||||
CefRefPtr<CefCallback> callback) override {
|
||||
if (IsChromeRuntimeEnabled() && request->GetResourceType() == RT_FAVICON) {
|
||||
// Ignore favicon requests.
|
||||
return RV_CANCEL;
|
||||
@ -841,7 +841,7 @@ class RedirectTestHandler : public TestHandler {
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefRequestCallback> callback) override {
|
||||
CefRefPtr<CefCallback> callback) override {
|
||||
if (IsChromeRuntimeEnabled() && request->GetResourceType() == RT_FAVICON) {
|
||||
// Ignore favicon requests.
|
||||
return RV_CANCEL;
|
||||
@ -1453,7 +1453,7 @@ class OrderNavTestHandler : public TestHandler {
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefRequestCallback> callback) override {
|
||||
CefRefPtr<CefCallback> callback) override {
|
||||
if (IsChromeRuntimeEnabled() && request->GetResourceType() == RT_FAVICON) {
|
||||
// Ignore favicon requests.
|
||||
return RV_CANCEL;
|
||||
@ -1897,7 +1897,7 @@ class LoadNavTestHandler : public TestHandler {
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefRequestCallback> callback) override {
|
||||
CefRefPtr<CefCallback> callback) override {
|
||||
if (IsChromeRuntimeEnabled() && request->GetResourceType() == RT_FAVICON) {
|
||||
// Ignore favicon requests.
|
||||
return RV_CANCEL;
|
||||
|
@ -97,7 +97,7 @@ class NetNotifyTestHandler : public TestHandler {
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefRequestCallback> callback) override {
|
||||
CefRefPtr<CefCallback> callback) override {
|
||||
EXPECT_TRUE(CefCurrentlyOn(TID_IO));
|
||||
|
||||
const std::string& url = request->GetURL();
|
||||
|
@ -245,7 +245,7 @@ class RequestSendRecvTestHandler : public TestHandler {
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefRequestCallback> callback) override {
|
||||
CefRefPtr<CefCallback> callback) override {
|
||||
EXPECT_IO_THREAD();
|
||||
|
||||
request_id_ = request->GetIdentifier();
|
||||
@ -572,7 +572,7 @@ class TypeTestHandler : public TestHandler {
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefRequestCallback> callback) override {
|
||||
CefRefPtr<CefCallback> callback) override {
|
||||
load_expectations_.GotRequest(request);
|
||||
|
||||
return RV_CONTINUE;
|
||||
|
@ -91,7 +91,7 @@ class ResourceManagerTestHandler : public RoutingTestHandler {
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefRequestCallback> callback) override {
|
||||
CefRefPtr<CefCallback> callback) override {
|
||||
if (IsChromeRuntimeEnabled() && request->GetResourceType() == RT_FAVICON) {
|
||||
// Ignore favicon requests.
|
||||
return RV_CANCEL;
|
||||
|
@ -612,7 +612,7 @@ class BasicResponseTest : public TestHandler {
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefRequestCallback> callback) override {
|
||||
CefRefPtr<CefCallback> callback) override {
|
||||
EXPECT_IO_THREAD();
|
||||
if (IsChromeRuntimeEnabled() && request->GetResourceType() == RT_FAVICON) {
|
||||
// Ignore favicon requests.
|
||||
@ -1382,7 +1382,7 @@ class BasicResponseTest : public TestHandler {
|
||||
int resource_handler_destroyed_ct_ = 0;
|
||||
|
||||
// Used with INCOMPLETE_BEFORE_RESOURCE_LOAD.
|
||||
CefRefPtr<CefRequestCallback> incomplete_callback_;
|
||||
CefRefPtr<CefCallback> incomplete_callback_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(BasicResponseTest);
|
||||
IMPLEMENT_REFCOUNTING(BasicResponseTest);
|
||||
@ -1658,7 +1658,7 @@ class SubresourceResponseTest : public RoutingTestHandler {
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefRequestCallback> callback) override {
|
||||
CefRefPtr<CefCallback> callback) override {
|
||||
EXPECT_IO_THREAD();
|
||||
|
||||
if (IsChromeRuntimeEnabled() && request->GetResourceType() == RT_FAVICON) {
|
||||
@ -2578,7 +2578,7 @@ class SubresourceResponseTest : public RoutingTestHandler {
|
||||
int resource_handler_destroyed_ct_ = 0;
|
||||
|
||||
// Used with INCOMPLETE_BEFORE_RESOURCE_LOAD.
|
||||
CefRefPtr<CefRequestCallback> incomplete_callback_;
|
||||
CefRefPtr<CefCallback> incomplete_callback_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(SubresourceResponseTest);
|
||||
IMPLEMENT_REFCOUNTING(SubresourceResponseTest);
|
||||
@ -3040,7 +3040,7 @@ class RedirectResponseTest : public TestHandler {
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefRequestCallback> callback) override {
|
||||
CefRefPtr<CefCallback> callback) override {
|
||||
EXPECT_IO_THREAD();
|
||||
|
||||
if (IsChromeRuntimeEnabled() &&
|
||||
@ -3272,7 +3272,7 @@ class BeforeResourceLoadTest : public TestHandler {
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefRequestCallback> callback) override {
|
||||
CefRefPtr<CefCallback> callback) override {
|
||||
EXPECT_IO_THREAD();
|
||||
|
||||
if (IsChromeRuntimeEnabled() && request->GetResourceType() == RT_FAVICON) {
|
||||
@ -3301,11 +3301,14 @@ class BeforeResourceLoadTest : public TestHandler {
|
||||
if (test_mode_ == CANCEL_NAV) {
|
||||
// Cancel the request by navigating to a new URL.
|
||||
browser->GetMainFrame()->LoadURL(kResourceTestHtml2);
|
||||
} else if (test_mode_ == CONTINUE_ASYNC) {
|
||||
// Continue asynchronously.
|
||||
CefPostTask(TID_UI,
|
||||
base::BindOnce(&CefCallback::Continue, callback.get()));
|
||||
} else {
|
||||
// Continue or cancel asynchronously.
|
||||
CefPostTask(TID_UI, base::BindOnce(&CefRequestCallback::Continue,
|
||||
callback.get(),
|
||||
test_mode_ == CONTINUE_ASYNC));
|
||||
// Cancel asynchronously.
|
||||
CefPostTask(TID_UI,
|
||||
base::BindOnce(&CefCallback::Cancel, callback.get()));
|
||||
}
|
||||
return RV_CONTINUE_ASYNC;
|
||||
}
|
||||
|
@ -144,7 +144,7 @@ class TestSchemeHandler : public TestHandler {
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefRequestCallback> callback) override {
|
||||
CefRefPtr<CefCallback> callback) override {
|
||||
if (IsChromeRuntimeEnabled() && request->GetResourceType() == RT_FAVICON) {
|
||||
// Ignore favicon requests.
|
||||
return RV_CANCEL;
|
||||
|
@ -2978,11 +2978,10 @@ class RequestTestHandler : public TestHandler {
|
||||
}
|
||||
}
|
||||
|
||||
ReturnValue OnBeforeResourceLoad(
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefRequestCallback> callback) override {
|
||||
ReturnValue OnBeforeResourceLoad(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefCallback> callback) override {
|
||||
if (test_running_ && test_frame_method_) {
|
||||
EXPECT_TRUE(frame);
|
||||
EXPECT_EQ(test_frame_->GetIdentifier(), frame->GetIdentifier());
|
||||
|
Loading…
x
Reference in New Issue
Block a user