mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb: Make Storage GC-allocated
This commit is contained in:
parent
d7c6298d8b
commit
2ac8e3db3a
Notes:
sideshowbarker
2024-07-17 07:25:48 +09:00
Author: https://github.com/awesomekling
Commit: 2ac8e3db3a
Pull-request: https://github.com/SerenityOS/serenity/pull/14816
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/linusg ✅
7 changed files with 32 additions and 37 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue