diff options
author | Andreas Kling <kling@serenityos.org> | 2022-09-03 19:44:37 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-09-06 00:27:09 +0200 |
commit | 2ac8e3db3a9f47b8f36ff9e61d02fa14e1017662 (patch) | |
tree | 5e05e27fbd61a929d33c49eba2e08d6d6d7f4fc9 /Userland/Libraries/LibWeb/HTML/Storage.h | |
parent | d7c6298d8b7ef04ced85e80fd0e15be931814e74 (diff) | |
download | serenity-2ac8e3db3a9f47b8f36ff9e61d02fa14e1017662.zip |
LibWeb: Make Storage GC-allocated
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/Storage.h')
-rw-r--r-- | Userland/Libraries/LibWeb/HTML/Storage.h | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/Storage.h b/Userland/Libraries/LibWeb/HTML/Storage.h index c8ad3f99f9..c6dbee2bff 100644 --- a/Userland/Libraries/LibWeb/HTML/Storage.h +++ b/Userland/Libraries/LibWeb/HTML/Storage.h @@ -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) |