mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 00:25: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:
committed by
Andreas Kling
parent
4f488f7e07
commit
df86e52d75
@@ -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; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user