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.
This commit is contained in:
Timothy Flynn 2024-11-04 15:20:08 -05:00 committed by Tim Flynn
commit c0a45394a9
Notes: github-actions[bot] 2024-11-04 21:17:43 +00:00
2 changed files with 4 additions and 4 deletions

View file

@ -338,7 +338,7 @@ void Page::prompt_closed(Optional<String> response)
}
}
void Page::dismiss_dialog(JS::GCPtr<JS::HeapFunction<void()>> on_dialog_closed)
void Page::dismiss_dialog(JS::NonnullGCPtr<JS::HeapFunction<void()>> on_dialog_closed)
{
m_on_pending_dialog_closed = on_dialog_closed;
@ -355,7 +355,7 @@ void Page::dismiss_dialog(JS::GCPtr<JS::HeapFunction<void()>> on_dialog_closed)
}
}
void Page::accept_dialog(JS::GCPtr<JS::HeapFunction<void()>> on_dialog_closed)
void Page::accept_dialog(JS::NonnullGCPtr<JS::HeapFunction<void()>> on_dialog_closed)
{
m_on_pending_dialog_closed = on_dialog_closed;

View file

@ -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<String> const& pending_dialog_text() const { return m_pending_dialog_text; }
void dismiss_dialog(JS::GCPtr<JS::HeapFunction<void()>> on_dialog_closed = nullptr);
void accept_dialog(JS::GCPtr<JS::HeapFunction<void()>> on_dialog_closed = nullptr);
void dismiss_dialog(JS::NonnullGCPtr<JS::HeapFunction<void()>> on_dialog_closed);
void accept_dialog(JS::NonnullGCPtr<JS::HeapFunction<void()>> on_dialog_closed);
void did_request_color_picker(WeakPtr<HTML::HTMLInputElement> target, Color current_color);
void color_picker_update(Optional<Color> picked_color, HTML::ColorPickerUpdateState state);