mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-24 18:02:20 +00:00
LibWeb/IDB: Implement IDBObjectStore::name
This commit is contained in:
parent
2e02b62126
commit
3879391fa6
Notes:
github-actions[bot]
2025-03-27 15:49:10 +00:00
Author: https://github.com/stelar7
Commit: 3879391fa6
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4077
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/gmta ✅
6 changed files with 80 additions and 13 deletions
|
@ -12,9 +12,26 @@ GC_DEFINE_ALLOCATOR(ObjectStore);
|
|||
|
||||
ObjectStore::~ObjectStore() = default;
|
||||
|
||||
GC::Ref<ObjectStore> ObjectStore::create(JS::Realm& realm, String name, bool auto_increment, Optional<KeyPath> const& key_path)
|
||||
GC::Ref<ObjectStore> ObjectStore::create(JS::Realm& realm, GC::Ref<Database> database, String name, bool auto_increment, Optional<KeyPath> const& key_path)
|
||||
{
|
||||
return realm.create<ObjectStore>(name, auto_increment, key_path);
|
||||
return realm.create<ObjectStore>(database, name, auto_increment, key_path);
|
||||
}
|
||||
|
||||
ObjectStore::ObjectStore(GC::Ref<Database> database, String name, bool auto_increment, Optional<KeyPath> const& key_path)
|
||||
: m_database(database)
|
||||
, m_name(move(name))
|
||||
, m_key_path(key_path)
|
||||
{
|
||||
database->add_object_store(*this);
|
||||
|
||||
if (auto_increment)
|
||||
m_key_generator = KeyGenerator {};
|
||||
}
|
||||
|
||||
void ObjectStore::visit_edges(Visitor& visitor)
|
||||
{
|
||||
Base::visit_edges(visitor);
|
||||
visitor.visit(m_database);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue