mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb/IDB: Implement IDBObjectStore::createIndex
This commit is contained in:
parent
a235dd4300
commit
3367352991
Notes:
github-actions[bot]
2025-04-09 17:50:46 +00:00
Author: https://github.com/stelar7
Commit: 3367352991
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4178
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/AtkinsSJ
7 changed files with 88 additions and 14 deletions
|
@ -25,7 +25,7 @@ Index::Index(GC::Ref<ObjectStore> store, String name, KeyPath const& key_path, b
|
|||
, m_multi_entry(multi_entry)
|
||||
, m_key_path(key_path)
|
||||
{
|
||||
store->add_index(*this);
|
||||
store->index_set().set(name, *this);
|
||||
}
|
||||
|
||||
void Index::visit_edges(Visitor& visitor)
|
||||
|
@ -39,4 +39,13 @@ void Index::visit_edges(Visitor& visitor)
|
|||
}
|
||||
}
|
||||
|
||||
void Index::set_name(String name)
|
||||
{
|
||||
// NOTE: Update the key in the map so it still matches the name
|
||||
auto old_value = m_object_store->index_set().take(m_name).release_value();
|
||||
m_object_store->index_set().set(name, old_value);
|
||||
|
||||
m_name = move(name);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue