mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-22 02:09:24 +00:00
LibWeb/IDB: Add internal Index object
This commit is contained in:
parent
8beade51e0
commit
9321ad04c0
Notes:
github-actions[bot]
2025-04-09 17:50:57 +00:00
Author: https://github.com/stelar7
Commit: 9321ad04c0
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4178
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/AtkinsSJ
6 changed files with 119 additions and 0 deletions
|
@ -15,6 +15,7 @@
|
|||
#include <LibJS/Runtime/Realm.h>
|
||||
#include <LibWeb/IndexedDB/Internal/Algorithms.h>
|
||||
#include <LibWeb/IndexedDB/Internal/Database.h>
|
||||
#include <LibWeb/IndexedDB/Internal/Index.h>
|
||||
#include <LibWeb/IndexedDB/Internal/KeyGenerator.h>
|
||||
|
||||
namespace Web::IndexedDB {
|
||||
|
@ -39,6 +40,9 @@ public:
|
|||
|
||||
GC::Ref<Database> database() const { return m_database; }
|
||||
|
||||
void add_index(GC::Ref<Index> index) { m_indexes.append(index); }
|
||||
ReadonlySpan<GC::Ref<Index>> index_set() const { return m_indexes; }
|
||||
|
||||
protected:
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
|
@ -48,6 +52,9 @@ private:
|
|||
// AD-HOC: An ObjectStore needs to know what Database it belongs to...
|
||||
GC::Ref<Database> m_database;
|
||||
|
||||
// AD-HOC: An Index has referenced ObjectStores, we also need the reverse mapping
|
||||
Vector<GC::Ref<Index>> m_indexes;
|
||||
|
||||
// An object store has a name, which is a name. At any one time, the name is unique within the database to which it belongs.
|
||||
String m_name;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue