LibWeb: Make HTML::ImageRequest GC allocated

This commit is contained in:
Aliaksandr Kalenik
2023-08-18 12:56:21 +02:00
committed by Andreas Kling
parent 333949894e
commit bbfedf2e5a
4 changed files with 27 additions and 15 deletions

View File

@@ -19,9 +19,9 @@
namespace Web::HTML {
ErrorOr<NonnullRefPtr<ImageRequest>> ImageRequest::create(Page& page)
JS::NonnullGCPtr<ImageRequest> ImageRequest::create(JS::Realm& realm, Page& page)
{
return adopt_nonnull_ref_or_enomem(new (nothrow) ImageRequest(page));
return realm.heap().allocate<ImageRequest>(realm, page);
}
ImageRequest::ImageRequest(Page& page)