mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-06 00:51:51 +00:00
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:
parent
70a29f36c6
commit
f53559cb55
Notes:
github-actions[bot]
2025-06-12 15:06:02 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: f53559cb55
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5052
Reviewed-by: https://github.com/shannonbooth ✅
Reviewed-by: https://github.com/trflynn89
12 changed files with 117 additions and 44 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue