mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb: Replace MarkedVector with Vector in AudioTrackList
There's no need to make the m_audio_tracks entries heap roots, we can visit them instead.
This commit is contained in:
parent
270e0d4b58
commit
46ad9d51df
Notes:
sideshowbarker
2024-07-16 22:14:49 +09:00
Author: https://github.com/IdanHo
Commit: 46ad9d51df
Pull-request: https://github.com/SerenityOS/serenity/pull/23854
Issue: https://github.com/SerenityOS/serenity/issues/23848
Reviewed-by: https://github.com/mattco98 ✅
Reviewed-by: https://github.com/trflynn89
4 changed files with 10 additions and 2 deletions
|
@ -119,4 +119,11 @@ WebIDL::CallbackType* AudioTrackList::onremovetrack()
|
|||
return event_handler_attribute(HTML::EventNames::removetrack);
|
||||
}
|
||||
|
||||
void AudioTrackList::visit_edges(JS::Cell::Visitor& visitor)
|
||||
{
|
||||
Base::visit_edges(visitor);
|
||||
for (auto const& track : m_audio_tracks)
|
||||
visitor.visit(track);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -49,6 +49,8 @@ public:
|
|||
private:
|
||||
explicit AudioTrackList(JS::Realm&);
|
||||
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual JS::ThrowCompletionOr<Optional<JS::PropertyDescriptor>> internal_get_own_property(JS::PropertyKey const& property_name) const override;
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@ JS_DEFINE_ALLOCATOR(VideoTrackList);
|
|||
|
||||
VideoTrackList::VideoTrackList(JS::Realm& realm)
|
||||
: DOM::EventTarget(realm, MayInterfereWithIndexedPropertyAccess::Yes)
|
||||
, m_video_tracks(realm.heap())
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ private:
|
|||
virtual void initialize(JS::Realm&) override;
|
||||
virtual JS::ThrowCompletionOr<Optional<JS::PropertyDescriptor>> internal_get_own_property(JS::PropertyKey const& property_name) const override;
|
||||
|
||||
JS::MarkedVector<JS::NonnullGCPtr<VideoTrack>> m_video_tracks;
|
||||
Vector<JS::NonnullGCPtr<VideoTrack>> m_video_tracks;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue