refactor: remove base::AdaptCallbackForRepeating patch (#48790)

refactor: remove base::AdaptCallbackForRepeating patch

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
trop[bot]
2025-11-05 18:25:01 -05:00
committed by GitHub
parent e1dadaa6a0
commit 11191f23b1
7 changed files with 51 additions and 44 deletions

View File

@@ -62,6 +62,7 @@
#include "shell/browser/net/resolve_proxy_helper.h"
#include "shell/browser/relauncher.h"
#include "shell/common/application_info.h"
#include "shell/common/callback_util.h"
#include "shell/common/electron_command_line.h"
#include "shell/common/electron_paths.h"
#include "shell/common/gin_converters/base_converter.h"
@@ -735,7 +736,8 @@ void App::AllowCertificateError(
bool is_main_frame_request,
bool strict_enforcement,
base::OnceCallback<void(content::CertificateRequestResultType)> callback) {
auto adapted_callback = base::AdaptCallbackForRepeating(std::move(callback));
auto adapted_callback =
electron::AdaptCallbackForRepeating(std::move(callback));
v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
v8::HandleScope handle_scope(isolate);
bool prevent_default = Emit(

View File

@@ -10,6 +10,7 @@
#include "shell/browser/api/electron_api_base_window.h"
#include "shell/browser/api/electron_api_web_frame_main.h"
#include "shell/browser/native_window_views.h"
#include "shell/common/callback_util.h"
#include "ui/display/screen.h"
#include "v8/include/cppgc/allocation.h"
#include "v8/include/v8-cppgc.h"
@@ -54,7 +55,7 @@ void MenuViews::PopupAt(BaseWindow* window,
// callback, it is fine passing OnceCallback to it because we reset the
// menu runner immediately when the menu is closed.
int32_t window_id = window->weak_map_id();
auto close_callback = base::AdaptCallbackForRepeating(
auto close_callback = electron::AdaptCallbackForRepeating(
base::BindOnce(&MenuViews::OnClosed, weak_factory_.GetWeakPtr(),
window_id, std::move(callback_with_ref)));
auto& runner = menu_runners_[window_id] =