mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 19:29:16 +00:00
LibWeb: Make Storage GC-allocated
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user