LibWeb: Make Storage GC-allocated

This commit is contained in:
Andreas Kling 2022-09-03 19:44:37 +02:00
commit 2ac8e3db3a
Notes: sideshowbarker 2024-07-17 07:25:48 +09:00
7 changed files with 32 additions and 37 deletions

View file

@ -6,15 +6,20 @@
#include <AK/String.h>
#include <LibWeb/HTML/Storage.h>
#include <LibWeb/HTML/Window.h>
namespace Web::HTML {
NonnullRefPtr<Storage> Storage::create()
JS::NonnullGCPtr<Storage> Storage::create(HTML::Window& window)
{
return adopt_ref(*new Storage);
return *window.heap().allocate<Storage>(window.realm(), window);
}
Storage::Storage() = default;
Storage::Storage(HTML::Window& window)
: PlatformObject(window.realm())
{
set_prototype(&window.cached_web_prototype("Storage"));
}
Storage::~Storage() = default;