LibWeb: Put setting object's promise's in WindowOrWorkerGlobalScope

This aligns with an update to the HTML specification which instead
stores these promises on the global object instead of the settings
object.

It also makes progress towards implementing the ShadowRealm proposal
as these promises are not present in the 'synthetic' realm for that
proposal.
This commit is contained in:
Shannon Booth 2024-10-23 18:59:19 +13:00 committed by Andrew Kaster
commit 1096b64936
Notes: github-actions[bot] 2024-10-23 17:30:50 +00:00
6 changed files with 129 additions and 119 deletions

View file

@ -101,18 +101,6 @@ public:
void prepare_to_run_callback();
void clean_up_after_running_callback();
void push_onto_outstanding_rejected_promises_weak_set(JS::Promise*);
// Returns true if removed, false otherwise.
bool remove_from_outstanding_rejected_promises_weak_set(JS::Promise*);
void push_onto_about_to_be_notified_rejected_promises_list(JS::NonnullGCPtr<JS::Promise>);
// Returns true if removed, false otherwise.
bool remove_from_about_to_be_notified_rejected_promises_list(JS::NonnullGCPtr<JS::Promise>);
void notify_about_rejected_promises(Badge<EventLoop>);
bool is_scripting_enabled() const;
bool is_scripting_disabled() const;
@ -138,13 +126,6 @@ private:
JS::GCPtr<EventLoop> m_responsible_event_loop;
// https://html.spec.whatwg.org/multipage/webappapis.html#outstanding-rejected-promises-weak-set
// The outstanding rejected promises weak set must not create strong references to any of its members, and implementations are free to limit its size, e.g. by removing old entries from it when new ones are added.
Vector<JS::GCPtr<JS::Promise>> m_outstanding_rejected_promises_weak_set;
// https://html.spec.whatwg.org/multipage/webappapis.html#about-to-be-notified-rejected-promises-list
Vector<JS::Handle<JS::Promise>> m_about_to_be_notified_rejected_promises_list;
// https://fetch.spec.whatwg.org/#concept-fetch-record
// A fetch group holds an ordered list of fetch records
Vector<JS::NonnullGCPtr<Fetch::Infrastructure::FetchRecord>> m_fetch_group;