mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:37:37 +00:00
LibWeb: Make Storage GC-allocated
This commit is contained in:
parent
d7c6298d8b
commit
2ac8e3db3a
7 changed files with 32 additions and 37 deletions
|
@ -7,20 +7,16 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/RefCounted.h>
|
||||
#include <LibWeb/Bindings/Wrappable.h>
|
||||
#include <LibWeb/Bindings/PlatformObject.h>
|
||||
#include <LibWeb/DOM/ExceptionOr.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
class Storage
|
||||
: public RefCounted<Storage>
|
||||
, public Bindings::Wrappable {
|
||||
public:
|
||||
using WrapperType = Bindings::StorageWrapper;
|
||||
class Storage : public Bindings::PlatformObject {
|
||||
WEB_PLATFORM_OBJECT(Storage, Bindings::PlatformObject);
|
||||
|
||||
static NonnullRefPtr<Storage> create();
|
||||
public:
|
||||
static JS::NonnullGCPtr<Storage> create(HTML::Window&);
|
||||
~Storage();
|
||||
|
||||
size_t length() const;
|
||||
|
@ -37,7 +33,7 @@ public:
|
|||
void dump() const;
|
||||
|
||||
private:
|
||||
Storage();
|
||||
explicit Storage(HTML::Window&);
|
||||
|
||||
void reorder();
|
||||
void broadcast(String const& key, String const& old_value, String const& new_value);
|
||||
|
@ -47,8 +43,4 @@ private:
|
|||
|
||||
}
|
||||
|
||||
namespace Web::Bindings {
|
||||
|
||||
StorageWrapper* wrap(JS::Realm&, HTML::Storage&);
|
||||
|
||||
}
|
||||
WRAPPER_HACK(Storage, Web::HTML)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue