mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 10:01:13 +09: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:
parent
967a3e5a45
commit
8cda70c892
Notes:
sideshowbarker
2024-07-17 07:28:35 +09:00
Author: https://github.com/awesomekling
Commit: 8cda70c892
Pull-request: https://github.com/SerenityOS/serenity/pull/14816
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/linusg ✅
57 changed files with 425 additions and 345 deletions
|
@ -324,14 +324,14 @@ JS::Object* Worker::create_wrapper(JS::Realm& realm)
|
|||
}
|
||||
|
||||
#undef __ENUMERATE
|
||||
#define __ENUMERATE(attribute_name, event_name) \
|
||||
void Worker::set_##attribute_name(Optional<Bindings::CallbackType> value) \
|
||||
{ \
|
||||
set_event_handler_attribute(event_name, move(value)); \
|
||||
} \
|
||||
Bindings::CallbackType* Worker::attribute_name() \
|
||||
{ \
|
||||
return event_handler_attribute(event_name); \
|
||||
#define __ENUMERATE(attribute_name, event_name) \
|
||||
void Worker::set_##attribute_name(Bindings::CallbackType* value) \
|
||||
{ \
|
||||
set_event_handler_attribute(event_name, move(value)); \
|
||||
} \
|
||||
Bindings::CallbackType* Worker::attribute_name() \
|
||||
{ \
|
||||
return event_handler_attribute(event_name); \
|
||||
}
|
||||
ENUMERATE_WORKER_EVENT_HANDLERS(__ENUMERATE)
|
||||
#undef __ENUMERATE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue