mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
LibWeb: Add missing visits in MessageEvent
Also change a Vector<Handle> to a Vector<NonnullGCPtr> while we're here, since there's no need to use handles for members of a cell. Fixes an ASAN error on the HTML/Window-postMessage.html test.
This commit is contained in:
parent
413eb19579
commit
b84056c05b
Notes:
sideshowbarker
2024-07-16 21:45:42 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/b84056c05b Pull-request: https://github.com/SerenityOS/serenity/pull/22916
2 changed files with 9 additions and 2 deletions
|
@ -28,8 +28,12 @@ MessageEvent::MessageEvent(JS::Realm& realm, FlyString const& event_name, Messag
|
|||
, m_origin(event_init.origin)
|
||||
, m_last_event_id(event_init.last_event_id)
|
||||
, m_source(event_init.source)
|
||||
, m_ports(event_init.ports)
|
||||
{
|
||||
m_ports.ensure_capacity(event_init.ports.size());
|
||||
for (auto& port : event_init.ports) {
|
||||
VERIFY(port);
|
||||
m_ports.unchecked_append(*port);
|
||||
}
|
||||
}
|
||||
|
||||
MessageEvent::~MessageEvent() = default;
|
||||
|
@ -44,6 +48,9 @@ void MessageEvent::visit_edges(Cell::Visitor& visitor)
|
|||
{
|
||||
Base::visit_edges(visitor);
|
||||
visitor.visit(m_data);
|
||||
visitor.visit(m_ports_array);
|
||||
for (auto& port : m_ports)
|
||||
visitor.visit(port);
|
||||
}
|
||||
|
||||
Variant<JS::Handle<WindowProxy>, JS::Handle<MessagePort>, Empty> MessageEvent::source() const
|
||||
|
|
|
@ -48,7 +48,7 @@ private:
|
|||
String m_origin;
|
||||
String m_last_event_id;
|
||||
Optional<MessageEventSource> m_source;
|
||||
Vector<JS::Handle<JS::Object>> m_ports;
|
||||
Vector<JS::NonnullGCPtr<JS::Object>> m_ports;
|
||||
mutable JS::GCPtr<JS::Array> m_ports_array;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue