mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-13 04:21:54 +00:00
LibWeb/IDB: Implement IDBDatabase::createObjectStore
This commit is contained in:
parent
3c5578cc87
commit
1057c88fdd
Notes:
github-actions[bot]
2025-03-27 15:49:41 +00:00
Author: https://github.com/stelar7
Commit: 1057c88fdd
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4077
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/gmta ✅
7 changed files with 102 additions and 10 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue