mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-04 15:19:42 +00:00
LibWeb/IDB: Implement delete_records_from_an_object_store
This commit is contained in:
parent
7fa3bd00b5
commit
afe7951af4
Notes:
github-actions[bot]
2025-04-23 18:37:14 +00:00
Author: https://github.com/stelar7
Commit: afe7951af4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4317
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/kennethmyhra ✅
4 changed files with 35 additions and 0 deletions
|
@ -4,6 +4,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/IndexedDB/IDBKeyRange.h>
|
||||
#include <LibWeb/IndexedDB/Internal/ObjectStore.h>
|
||||
|
||||
namespace Web::IndexedDB {
|
||||
|
@ -33,6 +34,17 @@ void ObjectStore::visit_edges(Visitor& visitor)
|
|||
Base::visit_edges(visitor);
|
||||
visitor.visit(m_database);
|
||||
visitor.visit(m_indexes);
|
||||
|
||||
for (auto& record : m_records) {
|
||||
visitor.visit(record.key);
|
||||
}
|
||||
}
|
||||
|
||||
void ObjectStore::remove_records_in_range(GC::Ref<IDBKeyRange> range)
|
||||
{
|
||||
m_records.remove_all_matching([&](auto const& record) {
|
||||
return range->is_in_range(record.key);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue