LibWeb: Add fetch group from the fetch spec

Add fetch group concept from the '2.4. Fetch groups' in
the fetch specs to the environment settings object.
This commit is contained in:
mobounya 2024-07-16 19:31:31 +01:00 committed by Andrew Kaster
parent 8d38a1326e
commit 9e223f6dae
Notes: github-actions[bot] 2024-07-20 20:10:51 +00:00
2 changed files with 8 additions and 0 deletions

View file

@ -8,6 +8,7 @@
#include <LibWeb/Bindings/MainThreadVM.h>
#include <LibWeb/DOM/Document.h>
#include <LibWeb/Fetch/Infrastructure/FetchRecord.h>
#include <LibWeb/HTML/PromiseRejectionEvent.h>
#include <LibWeb/HTML/Scripting/Environments.h>
#include <LibWeb/HTML/Scripting/ExceptionReporter.h>
@ -54,6 +55,7 @@ void EnvironmentSettingsObject::visit_edges(Cell::Visitor& visitor)
visitor.visit(m_module_map);
visitor.ignore(m_outstanding_rejected_promises_weak_set);
m_realm_execution_context->visit_edges(visitor);
visitor.visit(m_fetch_group);
}
JS::ExecutionContext& EnvironmentSettingsObject::realm_execution_context()

View file

@ -9,6 +9,7 @@
#include <LibJS/Forward.h>
#include <LibURL/URL.h>
#include <LibWeb/Forward.h>
#include <LibWeb/HTML/EventLoop/EventLoop.h>
#include <LibWeb/HTML/Origin.h>
#include <LibWeb/HTML/Scripting/ModuleMap.h>
@ -89,6 +90,7 @@ public:
JS::Realm& realm();
JS::Object& global_object();
EventLoop& responsible_event_loop();
Vector<JS::NonnullGCPtr<Fetch::Infrastructure::FetchRecord>>& fetch_group() { return m_fetch_group; }
RunScriptDecision can_run_script();
void prepare_to_run_script();
@ -135,6 +137,10 @@ private:
// 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;
};
EnvironmentSettingsObject& incumbent_settings_object();