1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:27:45 +00:00

LibWeb: Move event listeners, handlers and callbacks to the GC heap

This patch moves the following things to being GC-allocated:
- Bindings::CallbackType
- HTML::EventHandler
- DOM::IDLEventListener
- DOM::DOMEventListener
- DOM::NodeFilter

Note that we only use PlatformObject for things that might be exposed
to web content. Anything that is only used internally inherits directly
from JS::Cell instead, making them a bit more lightweight.
This commit is contained in:
Andreas Kling 2022-08-08 14:12:01 +02:00
parent 967a3e5a45
commit 8cda70c892
57 changed files with 425 additions and 345 deletions

View file

@ -61,7 +61,7 @@ public:
void alert(String const&);
bool confirm(String const&);
String prompt(String const&, String const&);
i32 request_animation_frame(NonnullOwnPtr<Bindings::CallbackType> js_callback);
i32 request_animation_frame(Bindings::CallbackType& js_callback);
void cancel_animation_frame(i32);
bool has_animation_frame_callbacks() const { return m_animation_frame_callback_driver.has_callbacks(); }
@ -70,7 +70,7 @@ public:
void clear_timeout(i32);
void clear_interval(i32);
void queue_microtask(NonnullOwnPtr<Bindings::CallbackType> callback);
void queue_microtask(Bindings::CallbackType& callback);
int inner_width() const;
int inner_height() const;
@ -123,7 +123,7 @@ public:
void start_an_idle_period();
u32 request_idle_callback(NonnullOwnPtr<Bindings::CallbackType> callback);
u32 request_idle_callback(Bindings::CallbackType& callback);
void cancel_idle_callback(u32);
AnimationFrameCallbackDriver& animation_frame_callback_driver() { return m_animation_frame_callback_driver; }