From c0a45394a94ed7ced49fe7dc24009430368b68cc Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Mon, 4 Nov 2024 15:20:08 -0500 Subject: [PATCH] LibWeb: Make the completion callbacks for dismissing dialogs required All callers have been made async, i.e. they now all provide a completion callback. Let's make the callback required to discourage any future sync usage. --- Userland/Libraries/LibWeb/Page/Page.cpp | 4 ++-- Userland/Libraries/LibWeb/Page/Page.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibWeb/Page/Page.cpp b/Userland/Libraries/LibWeb/Page/Page.cpp index 0e2f1eb0e0e..d14bfc957ea 100644 --- a/Userland/Libraries/LibWeb/Page/Page.cpp +++ b/Userland/Libraries/LibWeb/Page/Page.cpp @@ -338,7 +338,7 @@ void Page::prompt_closed(Optional response) } } -void Page::dismiss_dialog(JS::GCPtr> on_dialog_closed) +void Page::dismiss_dialog(JS::NonnullGCPtr> on_dialog_closed) { m_on_pending_dialog_closed = on_dialog_closed; @@ -355,7 +355,7 @@ void Page::dismiss_dialog(JS::GCPtr> on_dialog_closed) } } -void Page::accept_dialog(JS::GCPtr> on_dialog_closed) +void Page::accept_dialog(JS::NonnullGCPtr> on_dialog_closed) { m_on_pending_dialog_closed = on_dialog_closed; diff --git a/Userland/Libraries/LibWeb/Page/Page.h b/Userland/Libraries/LibWeb/Page/Page.h index c41d0bfec61..8e6547d04e3 100644 --- a/Userland/Libraries/LibWeb/Page/Page.h +++ b/Userland/Libraries/LibWeb/Page/Page.h @@ -148,8 +148,8 @@ public: bool has_pending_dialog() const { return m_pending_dialog != PendingDialog::None; } PendingDialog pending_dialog() const { return m_pending_dialog; } Optional const& pending_dialog_text() const { return m_pending_dialog_text; } - void dismiss_dialog(JS::GCPtr> on_dialog_closed = nullptr); - void accept_dialog(JS::GCPtr> on_dialog_closed = nullptr); + void dismiss_dialog(JS::NonnullGCPtr> on_dialog_closed); + void accept_dialog(JS::NonnullGCPtr> on_dialog_closed); void did_request_color_picker(WeakPtr target, Color current_color); void color_picker_update(Optional picked_color, HTML::ColorPickerUpdateState state);