Always pass callback object to CefRequestHandler::OnCertificateError (issue #1795)

This commit is contained in:
Marshall Greenblatt
2016-01-27 12:57:48 -05:00
parent 63d313de76
commit c3d80a5658
3 changed files with 9 additions and 12 deletions

View File

@ -229,10 +229,9 @@ typedef struct _cef_request_handler_t {
// Called on the UI thread to handle requests for URLs with an invalid SSL
// certificate. Return true (1) and call cef_request_tCallback::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 |callback| is NULL
// the error cannot be recovered from and the request will be canceled
// automatically. If CefSettings.ignore_certificate_errors is set all invalid
// certificates will be accepted without calling this function.
// 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,

View File

@ -265,10 +265,9 @@ class CefRequestHandler : public virtual CefBase {
// 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 |callback| is empty the error
// cannot be recovered from and the request will be canceled automatically.
// If CefSettings.ignore_certificate_errors is set all invalid certificates
// will be accepted without calling this method.
// 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(

View File

@ -710,14 +710,13 @@ void CefContentBrowserClient::AllowCertificateError(
CefRefPtr<CefSSLInfo> cef_ssl_info = new CefSSLInfoImpl(ssl_info);
CefRefPtr<CefAllowCertificateErrorCallbackImpl> callbackImpl;
if (overridable && !strict_enforcement)
callbackImpl = new CefAllowCertificateErrorCallbackImpl(callback);
CefRefPtr<CefAllowCertificateErrorCallbackImpl> callbackImpl(
new CefAllowCertificateErrorCallbackImpl(callback));
bool proceed = handler->OnCertificateError(
browser.get(), static_cast<cef_errorcode_t>(cert_error),
request_url.spec(), cef_ssl_info, callbackImpl.get());
if (!proceed && callbackImpl.get())
if (!proceed)
callbackImpl->Disconnect();
*result = proceed ? content::CERTIFICATE_REQUEST_RESULT_TYPE_CONTINUE :