mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-11 20:16:02 +00:00
LibWeb/IDB: Implement IDBDatabase::transaction()
This commit is contained in:
parent
a05be67e4a
commit
61384473ca
Notes:
github-actions[bot]
2025-04-28 09:33:04 +00:00
Author: https://github.com/stelar7
Commit: 61384473ca
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4476
Reviewed-by: https://github.com/gmta ✅
5 changed files with 62 additions and 1 deletions
|
@ -7,9 +7,11 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibGC/Ptr.h>
|
||||
#include <LibWeb/Bindings/IDBDatabasePrototype.h>
|
||||
#include <LibWeb/DOM/EventTarget.h>
|
||||
#include <LibWeb/HTML/DOMStringList.h>
|
||||
#include <LibWeb/IndexedDB/IDBRequest.h>
|
||||
#include <LibWeb/IndexedDB/IDBTransaction.h>
|
||||
#include <LibWeb/IndexedDB/Internal/Database.h>
|
||||
#include <LibWeb/IndexedDB/Internal/ObjectStore.h>
|
||||
#include <LibWeb/StorageAPI/StorageKey.h>
|
||||
|
@ -24,6 +26,11 @@ struct IDBObjectStoreParameters {
|
|||
bool auto_increment { false };
|
||||
};
|
||||
|
||||
// https://w3c.github.io/IndexedDB/#dictdef-idbtransactionoptions
|
||||
struct IDBTransactionOptions {
|
||||
Bindings::IDBTransactionDurability durability = Bindings::IDBTransactionDurability::Default;
|
||||
};
|
||||
|
||||
// FIXME: I'm not sure if this object should do double duty as both the connection and the interface
|
||||
// but the spec treats it as such...?
|
||||
// https://w3c.github.io/IndexedDB/#IDBDatabase-interface
|
||||
|
@ -66,6 +73,8 @@ public:
|
|||
WebIDL::ExceptionOr<GC::Ref<IDBObjectStore>> create_object_store(String const&, IDBObjectStoreParameters const&);
|
||||
WebIDL::ExceptionOr<void> delete_object_store(String const&);
|
||||
|
||||
WebIDL::ExceptionOr<GC::Ref<IDBTransaction>> transaction(Variant<String, Vector<String>>, Bindings::IDBTransactionMode = Bindings::IDBTransactionMode::Readonly, IDBTransactionOptions = { .durability = Bindings::IDBTransactionDurability::Default });
|
||||
|
||||
void close();
|
||||
|
||||
void set_onabort(WebIDL::CallbackType*);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue