summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML/Storage.cpp
diff options
context:
space:
mode:
authorAndrew Kaster <akaster@serenityos.org>2022-09-25 16:38:21 -0600
committerLinus Groh <mail@linusgroh.de>2022-10-01 21:05:32 +0100
commitf0c5f77f99801441db1d8e99c14dae2ab1357b47 (patch)
tree4c96ecfef6414f247421a8abf52168592fd0ab92 /Userland/Libraries/LibWeb/HTML/Storage.cpp
parenta2ccb00e1da76b9b80fe1a804b5cbf87af91770f (diff)
downloadserenity-f0c5f77f99801441db1d8e99c14dae2ab1357b47.zip
LibWeb: Remove unecessary dependence on Window from HTML classes
These classes only needed Window to get at its realm. Pass a realm directly to construct HTML classes.
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/Storage.cpp')
-rw-r--r--Userland/Libraries/LibWeb/HTML/Storage.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/Storage.cpp b/Userland/Libraries/LibWeb/HTML/Storage.cpp
index 7db1d4a554..5641331365 100644
--- a/Userland/Libraries/LibWeb/HTML/Storage.cpp
+++ b/Userland/Libraries/LibWeb/HTML/Storage.cpp
@@ -5,20 +5,20 @@
*/
#include <AK/String.h>
+#include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/HTML/Storage.h>
-#include <LibWeb/HTML/Window.h>
namespace Web::HTML {
-JS::NonnullGCPtr<Storage> Storage::create(HTML::Window& window)
+JS::NonnullGCPtr<Storage> Storage::create(JS::Realm& realm)
{
- return *window.heap().allocate<Storage>(window.realm(), window);
+ return *realm.heap().allocate<Storage>(realm, realm);
}
-Storage::Storage(HTML::Window& window)
- : PlatformObject(window.realm())
+Storage::Storage(JS::Realm& realm)
+ : PlatformObject(realm)
{
- set_prototype(&window.cached_web_prototype("Storage"));
+ set_prototype(&Bindings::cached_web_prototype(realm, "Storage"));
}
Storage::~Storage() = default;