mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
- Allow asynchronous continuation of OnBeforeResourceLoad (issue #1593).
- Use CefRequestCallback for most asynchronous CefRequestHandler methods.
This commit is contained in:
@ -1,35 +0,0 @@
|
||||
// Copyright (c) 2015 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.
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/allow_certificate_error_callback_ctocpp.h"
|
||||
|
||||
|
||||
// VIRTUAL METHODS - Body may be edited by hand.
|
||||
|
||||
void CefAllowCertificateErrorCallbackCToCpp::Continue(bool allow) {
|
||||
if (CEF_MEMBER_MISSING(struct_, cont))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
struct_->cont(struct_,
|
||||
allow);
|
||||
}
|
||||
|
||||
|
||||
#ifndef NDEBUG
|
||||
template<> base::AtomicRefCount CefCToCpp<CefAllowCertificateErrorCallbackCToCpp,
|
||||
CefAllowCertificateErrorCallback,
|
||||
cef_allow_certificate_error_callback_t>::DebugObjCt = 0;
|
||||
#endif
|
||||
|
@ -1,44 +0,0 @@
|
||||
// Copyright (c) 2015 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.
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_ALLOW_CERTIFICATE_ERROR_CALLBACK_CTOCPP_H_
|
||||
#define CEF_LIBCEF_DLL_CTOCPP_ALLOW_CERTIFICATE_ERROR_CALLBACK_CTOCPP_H_
|
||||
#pragma once
|
||||
|
||||
#ifndef USING_CEF_SHARED
|
||||
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
|
||||
#else // USING_CEF_SHARED
|
||||
|
||||
#include "include/cef_request_handler.h"
|
||||
#include "include/capi/cef_request_handler_capi.h"
|
||||
#include "libcef_dll/ctocpp/ctocpp.h"
|
||||
|
||||
// Wrap a C structure with a C++ class.
|
||||
// This class may be instantiated and accessed wrapper-side only.
|
||||
class CefAllowCertificateErrorCallbackCToCpp
|
||||
: public CefCToCpp<CefAllowCertificateErrorCallbackCToCpp,
|
||||
CefAllowCertificateErrorCallback,
|
||||
cef_allow_certificate_error_callback_t> {
|
||||
public:
|
||||
explicit CefAllowCertificateErrorCallbackCToCpp(
|
||||
cef_allow_certificate_error_callback_t* str)
|
||||
: CefCToCpp<CefAllowCertificateErrorCallbackCToCpp,
|
||||
CefAllowCertificateErrorCallback,
|
||||
cef_allow_certificate_error_callback_t>(str) {}
|
||||
|
||||
// CefAllowCertificateErrorCallback methods
|
||||
virtual void Continue(bool allow) OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // USING_CEF_SHARED
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_ALLOW_CERTIFICATE_ERROR_CALLBACK_CTOCPP_H_
|
||||
|
@ -10,12 +10,12 @@
|
||||
// for more information.
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/quota_callback_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/request_callback_ctocpp.h"
|
||||
|
||||
|
||||
// VIRTUAL METHODS - Body may be edited by hand.
|
||||
|
||||
void CefQuotaCallbackCToCpp::Continue(bool allow) {
|
||||
void CefRequestCallbackCToCpp::Continue(bool allow) {
|
||||
if (CEF_MEMBER_MISSING(struct_, cont))
|
||||
return;
|
||||
|
||||
@ -26,7 +26,7 @@ void CefQuotaCallbackCToCpp::Continue(bool allow) {
|
||||
allow);
|
||||
}
|
||||
|
||||
void CefQuotaCallbackCToCpp::Cancel() {
|
||||
void CefRequestCallbackCToCpp::Cancel() {
|
||||
if (CEF_MEMBER_MISSING(struct_, cancel))
|
||||
return;
|
||||
|
||||
@ -38,7 +38,7 @@ void CefQuotaCallbackCToCpp::Cancel() {
|
||||
|
||||
|
||||
#ifndef NDEBUG
|
||||
template<> base::AtomicRefCount CefCToCpp<CefQuotaCallbackCToCpp,
|
||||
CefQuotaCallback, cef_quota_callback_t>::DebugObjCt = 0;
|
||||
template<> base::AtomicRefCount CefCToCpp<CefRequestCallbackCToCpp,
|
||||
CefRequestCallback, cef_request_callback_t>::DebugObjCt = 0;
|
||||
#endif
|
||||
|
@ -10,8 +10,8 @@
|
||||
// for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_QUOTA_CALLBACK_CTOCPP_H_
|
||||
#define CEF_LIBCEF_DLL_CTOCPP_QUOTA_CALLBACK_CTOCPP_H_
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_REQUEST_CALLBACK_CTOCPP_H_
|
||||
#define CEF_LIBCEF_DLL_CTOCPP_REQUEST_CALLBACK_CTOCPP_H_
|
||||
#pragma once
|
||||
|
||||
#ifndef USING_CEF_SHARED
|
||||
@ -24,19 +24,19 @@
|
||||
|
||||
// Wrap a C structure with a C++ class.
|
||||
// This class may be instantiated and accessed wrapper-side only.
|
||||
class CefQuotaCallbackCToCpp
|
||||
: public CefCToCpp<CefQuotaCallbackCToCpp, CefQuotaCallback,
|
||||
cef_quota_callback_t> {
|
||||
class CefRequestCallbackCToCpp
|
||||
: public CefCToCpp<CefRequestCallbackCToCpp, CefRequestCallback,
|
||||
cef_request_callback_t> {
|
||||
public:
|
||||
explicit CefQuotaCallbackCToCpp(cef_quota_callback_t* str)
|
||||
: CefCToCpp<CefQuotaCallbackCToCpp, CefQuotaCallback,
|
||||
cef_quota_callback_t>(str) {}
|
||||
explicit CefRequestCallbackCToCpp(cef_request_callback_t* str)
|
||||
: CefCToCpp<CefRequestCallbackCToCpp, CefRequestCallback,
|
||||
cef_request_callback_t>(str) {}
|
||||
|
||||
// CefQuotaCallback methods
|
||||
// CefRequestCallback methods
|
||||
virtual void Continue(bool allow) OVERRIDE;
|
||||
virtual void Cancel() OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // USING_CEF_SHARED
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_QUOTA_CALLBACK_CTOCPP_H_
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_REQUEST_CALLBACK_CTOCPP_H_
|
||||
|
@ -10,12 +10,11 @@
|
||||
// for more information.
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/allow_certificate_error_callback_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/auth_callback_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/browser_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/frame_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/quota_callback_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/request_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/request_callback_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/sslinfo_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/web_plugin_info_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/request_handler_ctocpp.h"
|
||||
@ -56,35 +55,40 @@ bool CefRequestHandlerCToCpp::OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
bool CefRequestHandlerCToCpp::OnBeforeResourceLoad(
|
||||
CefRequestHandler::ReturnValue CefRequestHandlerCToCpp::OnBeforeResourceLoad(
|
||||
CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request) {
|
||||
CefRefPtr<CefRequest> request, CefRefPtr<CefRequestCallback> callback) {
|
||||
if (CEF_MEMBER_MISSING(struct_, on_before_resource_load))
|
||||
return false;
|
||||
return RV_CONTINUE;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: browser; type: refptr_diff
|
||||
DCHECK(browser.get());
|
||||
if (!browser.get())
|
||||
return false;
|
||||
return RV_CONTINUE;
|
||||
// Verify param: frame; type: refptr_diff
|
||||
DCHECK(frame.get());
|
||||
if (!frame.get())
|
||||
return false;
|
||||
return RV_CONTINUE;
|
||||
// Verify param: request; type: refptr_diff
|
||||
DCHECK(request.get());
|
||||
if (!request.get())
|
||||
return false;
|
||||
return RV_CONTINUE;
|
||||
// Verify param: callback; type: refptr_diff
|
||||
DCHECK(callback.get());
|
||||
if (!callback.get())
|
||||
return RV_CONTINUE;
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->on_before_resource_load(struct_,
|
||||
cef_return_value_t _retval = struct_->on_before_resource_load(struct_,
|
||||
CefBrowserCppToC::Wrap(browser),
|
||||
CefFrameCppToC::Wrap(frame),
|
||||
CefRequestCppToC::Wrap(request));
|
||||
CefRequestCppToC::Wrap(request),
|
||||
CefRequestCallbackCppToC::Wrap(callback));
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
// Return type: simple
|
||||
return _retval;
|
||||
}
|
||||
|
||||
CefRefPtr<CefResourceHandler> CefRequestHandlerCToCpp::GetResourceHandler(
|
||||
@ -194,7 +198,7 @@ bool CefRequestHandlerCToCpp::GetAuthCredentials(CefRefPtr<CefBrowser> browser,
|
||||
|
||||
bool CefRequestHandlerCToCpp::OnQuotaRequest(CefRefPtr<CefBrowser> browser,
|
||||
const CefString& origin_url, int64 new_size,
|
||||
CefRefPtr<CefQuotaCallback> callback) {
|
||||
CefRefPtr<CefRequestCallback> callback) {
|
||||
if (CEF_MEMBER_MISSING(struct_, on_quota_request))
|
||||
return false;
|
||||
|
||||
@ -218,7 +222,7 @@ bool CefRequestHandlerCToCpp::OnQuotaRequest(CefRefPtr<CefBrowser> browser,
|
||||
CefBrowserCppToC::Wrap(browser),
|
||||
origin_url.GetStruct(),
|
||||
new_size,
|
||||
CefQuotaCallbackCppToC::Wrap(callback));
|
||||
CefRequestCallbackCppToC::Wrap(callback));
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
@ -255,8 +259,7 @@ void CefRequestHandlerCToCpp::OnProtocolExecution(CefRefPtr<CefBrowser> browser,
|
||||
|
||||
bool CefRequestHandlerCToCpp::OnCertificateError(CefRefPtr<CefBrowser> browser,
|
||||
cef_errorcode_t cert_error, const CefString& request_url,
|
||||
CefRefPtr<CefSSLInfo> ssl_info,
|
||||
CefRefPtr<CefAllowCertificateErrorCallback> callback) {
|
||||
CefRefPtr<CefSSLInfo> ssl_info, CefRefPtr<CefRequestCallback> callback) {
|
||||
if (CEF_MEMBER_MISSING(struct_, on_certificate_error))
|
||||
return false;
|
||||
|
||||
@ -285,7 +288,7 @@ bool CefRequestHandlerCToCpp::OnCertificateError(CefRefPtr<CefBrowser> browser,
|
||||
cert_error,
|
||||
request_url.GetStruct(),
|
||||
CefSSLInfoCppToC::Wrap(ssl_info),
|
||||
CefAllowCertificateErrorCallbackCppToC::Wrap(callback));
|
||||
CefRequestCallbackCppToC::Wrap(callback));
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
|
@ -35,8 +35,9 @@ class CefRequestHandlerCToCpp
|
||||
// CefRequestHandler methods
|
||||
bool OnBeforeBrowse(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request, bool is_redirect) override;
|
||||
bool OnBeforeResourceLoad(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;
|
||||
CefRefPtr<CefResourceHandler> GetResourceHandler(
|
||||
CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request) override;
|
||||
@ -49,13 +50,13 @@ class CefRequestHandlerCToCpp
|
||||
CefRefPtr<CefAuthCallback> callback) override;
|
||||
bool OnQuotaRequest(CefRefPtr<CefBrowser> browser,
|
||||
const CefString& origin_url, int64 new_size,
|
||||
CefRefPtr<CefQuotaCallback> callback) override;
|
||||
CefRefPtr<CefRequestCallback> callback) override;
|
||||
void OnProtocolExecution(CefRefPtr<CefBrowser> browser, const CefString& url,
|
||||
bool& allow_os_execution) override;
|
||||
bool OnCertificateError(CefRefPtr<CefBrowser> browser,
|
||||
cef_errorcode_t cert_error, const CefString& request_url,
|
||||
CefRefPtr<CefSSLInfo> ssl_info,
|
||||
CefRefPtr<CefAllowCertificateErrorCallback> callback) override;
|
||||
CefRefPtr<CefRequestCallback> callback) override;
|
||||
bool OnBeforePluginLoad(CefRefPtr<CefBrowser> browser, const CefString& url,
|
||||
const CefString& policy_url, CefRefPtr<CefWebPluginInfo> info) override;
|
||||
void OnPluginCrashed(CefRefPtr<CefBrowser> browser,
|
||||
|
Reference in New Issue
Block a user