1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:28:12 +00:00

LibWeb: Use JS::HeapFunction for callbacks in SharedImageRequest

If a function that captures a GC-allocated object is owned by another
GC-allocated object, it is more preferable to use JS::HeapFunction.
This is because JS::HeapFunction is visited, unlike introducing a new
heap root as JS::SafeFunction does.
This commit is contained in:
Aliaksandr Kalenik 2023-09-25 14:27:11 +02:00 committed by Andreas Kling
parent 4f488f7e07
commit df86e52d75
4 changed files with 21 additions and 10 deletions

View file

@ -55,7 +55,7 @@ public:
void prepare_for_presentation(HTMLImageElement&);
void fetch_image(JS::Realm&, JS::NonnullGCPtr<Fetch::Infrastructure::Request>);
void add_callbacks(JS::SafeFunction<void()> on_finish, JS::SafeFunction<void()> on_fail);
void add_callbacks(Function<void()> on_finish, Function<void()> on_fail);
SharedImageRequest const* shared_image_request() const { return m_shared_image_request; }