mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibWeb/IDB: Implement IDBDatabase::createObjectStore
This commit is contained in:
parent
3c5578cc87
commit
1057c88fdd
Notes:
github-actions[bot]
2025-03-27 15:49:41 +00:00
Author: https://github.com/stelar7
Commit: 1057c88fdd
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4077
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/gmta ✅
7 changed files with 102 additions and 10 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2024, stelar7 <dudedbz@gmail.com>
|
||||
* Copyright (c) 2024-2025, stelar7 <dudedbz@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -8,21 +8,30 @@
|
|||
|
||||
#include <LibGC/Heap.h>
|
||||
#include <LibWeb/Bindings/PlatformObject.h>
|
||||
#include <LibWeb/IndexedDB/IDBTransaction.h>
|
||||
#include <LibWeb/IndexedDB/Internal/ObjectStore.h>
|
||||
|
||||
namespace Web::IndexedDB {
|
||||
|
||||
// https://w3c.github.io/IndexedDB/#object-store-interface
|
||||
// https://w3c.github.io/IndexedDB/#object-store-handle-construct
|
||||
class IDBObjectStore : public Bindings::PlatformObject {
|
||||
WEB_PLATFORM_OBJECT(IDBObjectStore, Bindings::PlatformObject);
|
||||
GC_DECLARE_ALLOCATOR(IDBObjectStore);
|
||||
|
||||
public:
|
||||
virtual ~IDBObjectStore() override;
|
||||
[[nodiscard]] static GC::Ref<IDBObjectStore> create(JS::Realm&);
|
||||
[[nodiscard]] static GC::Ref<IDBObjectStore> create(JS::Realm&, GC::Ref<ObjectStore>, GC::Ref<IDBTransaction>);
|
||||
|
||||
protected:
|
||||
explicit IDBObjectStore(JS::Realm&);
|
||||
explicit IDBObjectStore(JS::Realm&, GC::Ref<ObjectStore>, GC::Ref<IDBTransaction>);
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Visitor& visitor) override;
|
||||
|
||||
private:
|
||||
// An object store handle has an associated object store and an associated transaction.
|
||||
GC::Ref<ObjectStore> m_store;
|
||||
GC::Ref<IDBTransaction> m_transaction;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue