1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 22:48:11 +00:00

LibWeb: Remove unecessary dependence on Window from Fetch, XHR, FileAPI

These classes only needed Window to get at its realm. Pass a realm
directly to construct Fetch, XMLHttpRequest and FileAPI classes.
This commit is contained in:
Andrew Kaster 2022-09-25 18:08:29 -06:00 committed by Linus Groh
parent 6a10352712
commit 4878a18ee7
17 changed files with 144 additions and 169 deletions

View file

@ -23,10 +23,8 @@ class ProgressEvent final : public DOM::Event {
WEB_PLATFORM_OBJECT(ProgressEvent, DOM::Event);
public:
static ProgressEvent* create(HTML::Window&, FlyString const& event_name, ProgressEventInit const& event_init);
static ProgressEvent* create_with_global_object(HTML::Window&, FlyString const& event_name, ProgressEventInit const& event_init);
ProgressEvent(HTML::Window&, FlyString const& event_name, ProgressEventInit const& event_init);
static ProgressEvent* create(JS::Realm&, FlyString const& event_name, ProgressEventInit const& event_init);
static ProgressEvent* construct_impl(JS::Realm&, FlyString const& event_name, ProgressEventInit const& event_init);
virtual ~ProgressEvent() override;
@ -35,6 +33,8 @@ public:
u64 total() const { return m_total; }
private:
ProgressEvent(JS::Realm&, FlyString const& event_name, ProgressEventInit const& event_init);
bool m_length_computable { false };
u64 m_loaded { 0 };
u64 m_total { 0 };