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:
Shannon Booth 2024-12-23 22:32:49 +13:00 committed by Andreas Kling
commit bbf4739c8e
Notes: github-actions[bot] 2025-01-02 10:39:40 +00:00
3 changed files with 18 additions and 7 deletions

View file

@ -15,13 +15,14 @@ namespace Web::HTML {
GC_DEFINE_ALLOCATOR(Storage);
GC::Ref<Storage> Storage::create(JS::Realm& realm, u64 quota_bytes)
GC::Ref<Storage> Storage::create(JS::Realm& realm, Type type, u64 quota_bytes)
{
return realm.create<Storage>(realm, quota_bytes);
return realm.create<Storage>(realm, type, quota_bytes);
}
Storage::Storage(JS::Realm& realm, u64 quota_bytes)
Storage::Storage(JS::Realm& realm, Type type, u64 quota_bytes)
: Bindings::PlatformObject(realm)
, m_type(type)
, m_quota_bytes(quota_bytes)
{
m_legacy_platform_object_flags = LegacyPlatformObjectFlags {