diff --git a/shell/browser/api/atom_api_app.cc b/shell/browser/api/atom_api_app.cc index 50d5ddcb1b6d..4f4ab66906ea 100644 --- a/shell/browser/api/atom_api_app.cc +++ b/shell/browser/api/atom_api_app.cc @@ -9,6 +9,7 @@ #include #include +#include "base/callback_helpers.h" #include "base/command_line.h" #include "base/environment.h" #include "base/files/file_path.h" @@ -698,15 +699,17 @@ void App::AllowCertificateError( bool is_main_frame_request, bool strict_enforcement, base::OnceCallback callback) { + auto adapted_callback = base::AdaptCallbackForRepeating(std::move(callback)); v8::Locker locker(isolate()); v8::HandleScope handle_scope(isolate()); - bool prevent_default = Emit( - "certificate-error", WebContents::FromOrCreate(isolate(), web_contents), - request_url, net::ErrorToString(cert_error), ssl_info.cert, callback); + bool prevent_default = + Emit("certificate-error", + WebContents::FromOrCreate(isolate(), web_contents), request_url, + net::ErrorToString(cert_error), ssl_info.cert, adapted_callback); // Deny the certificate by default. if (!prevent_default) - std::move(callback).Run(content::CERTIFICATE_REQUEST_RESULT_TYPE_DENY); + adapted_callback.Run(content::CERTIFICATE_REQUEST_RESULT_TYPE_DENY); } base::OnceClosure App::SelectClientCertificate(