1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 16:15:10 +00:00

LibWeb: Make Storage GC-allocated

This commit is contained in:
Andreas Kling 2022-09-03 19:44:37 +02:00
parent d7c6298d8b
commit 2ac8e3db3a
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;