LibWeb/IDB: Implement IDBDatabase::createObjectStore

This commit is contained in:
stelar7 2025-03-24 20:43:12 +01:00 committed by Jelle Raaijmakers
parent 3c5578cc87
commit 1057c88fdd
Notes: github-actions[bot] 2025-03-27 15:49:41 +00:00
7 changed files with 102 additions and 10 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2024, stelar7 <dudedbz@gmail.com>
* Copyright (c) 2024-2025, stelar7 <dudedbz@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -15,14 +15,16 @@ GC_DEFINE_ALLOCATOR(IDBObjectStore);
IDBObjectStore::~IDBObjectStore() = default;
IDBObjectStore::IDBObjectStore(JS::Realm& realm)
IDBObjectStore::IDBObjectStore(JS::Realm& realm, GC::Ref<ObjectStore> store, GC::Ref<IDBTransaction> transaction)
: PlatformObject(realm)
, m_store(store)
, m_transaction(transaction)
{
}
GC::Ref<IDBObjectStore> IDBObjectStore::create(JS::Realm& realm)
GC::Ref<IDBObjectStore> IDBObjectStore::create(JS::Realm& realm, GC::Ref<ObjectStore> store, GC::Ref<IDBTransaction> transaction)
{
return realm.create<IDBObjectStore>(realm);
return realm.create<IDBObjectStore>(realm, store, transaction);
}
void IDBObjectStore::initialize(JS::Realm& realm)
@ -31,4 +33,11 @@ void IDBObjectStore::initialize(JS::Realm& realm)
WEB_SET_PROTOTYPE_FOR_INTERFACE(IDBObjectStore);
}
void IDBObjectStore::visit_edges(Visitor& visitor)
{
Base::visit_edges(visitor);
visitor.visit(m_store);
visitor.visit(m_transaction);
}
}