mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 14:58:46 +00:00
LibWeb/HTML: Store the type of the storage object
This will be needed by the storage broadcast implementation to perform different steps if the object is for session storage.
This commit is contained in:
parent
f3ecd23a21
commit
bbf4739c8e
Notes:
github-actions[bot]
2025-01-02 10:39:40 +00:00
Author: https://github.com/shannonbooth
Commit: bbf4739c8e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3070
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/konradekk
3 changed files with 18 additions and 7 deletions
|
@ -453,7 +453,7 @@ WebIDL::ExceptionOr<GC::Ref<Storage>> Window::local_storage()
|
|||
// FIXME: Implement according to spec.
|
||||
static HashMap<URL::Origin, GC::Root<Storage>> local_storage_per_origin;
|
||||
auto storage = local_storage_per_origin.ensure(associated_document().origin(), [this]() -> GC::Root<Storage> {
|
||||
return Storage::create(realm(), quota_bytes);
|
||||
return Storage::create(realm(), Storage::Type::Local, quota_bytes);
|
||||
});
|
||||
return GC::Ref { *storage };
|
||||
}
|
||||
|
@ -467,7 +467,7 @@ WebIDL::ExceptionOr<GC::Ref<Storage>> Window::session_storage()
|
|||
// FIXME: Implement according to spec.
|
||||
static HashMap<URL::Origin, GC::Root<Storage>> session_storage_per_origin;
|
||||
auto storage = session_storage_per_origin.ensure(associated_document().origin(), [this]() -> GC::Root<Storage> {
|
||||
return Storage::create(realm(), quota_bytes);
|
||||
return Storage::create(realm(), Storage::Type::Session, quota_bytes);
|
||||
});
|
||||
return GC::Ref { *storage };
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue