mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-28 02:27:19 +02:00
LibWeb/IDB: Implement delete_records_from_an_object_store
This commit is contained in:
Notes:
github-actions[bot]
2025-04-23 18:37:14 +00:00
Author: https://github.com/stelar7 Commit: https://github.com/LadybirdBrowser/ladybird/commit/afe7951af4e Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4317 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/kennethmyhra ✅
@@ -23,6 +23,12 @@ namespace Web::IndexedDB {
|
||||
|
||||
using KeyPath = Variant<String, Vector<String>>;
|
||||
|
||||
// https://w3c.github.io/IndexedDB/#object-store-record
|
||||
struct Record {
|
||||
GC::Ref<Key> key;
|
||||
HTML::SerializationRecord value;
|
||||
};
|
||||
|
||||
// https://w3c.github.io/IndexedDB/#object-store-construct
|
||||
class ObjectStore : public JS::Cell {
|
||||
GC_CELL(ObjectStore, JS::Cell);
|
||||
@@ -42,6 +48,8 @@ public:
|
||||
|
||||
GC::Ref<Database> database() const { return m_database; }
|
||||
|
||||
void remove_records_in_range(GC::Ref<IDBKeyRange> range);
|
||||
|
||||
protected:
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
@@ -62,6 +70,9 @@ private:
|
||||
|
||||
// An object store optionally has a key generator.
|
||||
Optional<KeyGenerator> m_key_generator;
|
||||
|
||||
// An object store has a list of records
|
||||
Vector<Record> m_records;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user