LibWeb: Change Storage{Bottle,Bucket,Shelf} to be GC-allocated

In upcoming changes StorageBottle will own pointers to GC-allocated
objects, so it needs to be a GC-allocated object itself to avoid
introducing more GC roots.
This commit is contained in:
Aliaksandr Kalenik 2025-06-11 18:51:22 +02:00 committed by Alexander Kalenik
parent 70a29f36c6
commit f53559cb55
Notes: github-actions[bot] 2025-06-12 15:06:02 +00:00
12 changed files with 117 additions and 44 deletions

View file

@ -471,7 +471,7 @@ WebIDL::ExceptionOr<GC::Ref<Storage>> Window::local_storage()
return WebIDL::SecurityError::create(realm, "localStorage is not available"_string);
// 4. Let storage be a new Storage object whose map is map.
auto storage = Storage::create(realm, Storage::Type::Session, map.release_nonnull());
auto storage = Storage::create(realm, Storage::Type::Session, *map);
// 5. Set this's associated Document's local storage holder to storage.
associated_document.set_local_storage_holder(storage);
@ -498,7 +498,7 @@ WebIDL::ExceptionOr<GC::Ref<Storage>> Window::session_storage()
return WebIDL::SecurityError::create(realm, "sessionStorage is not available"_string);
// 4. Let storage be a new Storage object whose map is map.
auto storage = Storage::create(realm, Storage::Type::Session, map.release_nonnull());
auto storage = Storage::create(realm, Storage::Type::Session, *map);
// 5. Set this's associated Document's session storage holder to storage.
associated_document.set_session_storage_holder(storage);