mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-02 04:27:12 +02:00
LibWeb/IDB: Implement generate_a_key
This commit is contained in:
Notes:
github-actions[bot]
2025-04-23 18:37:33 +00:00
Author: https://github.com/stelar7 Commit: https://github.com/LadybirdBrowser/ladybird/commit/dbe0db0cabb Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4317 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/kennethmyhra ✅
@@ -13,13 +13,16 @@ namespace Web::IndexedDB {
|
||||
// https://w3c.github.io/IndexedDB/#key-generator-construct
|
||||
class KeyGenerator {
|
||||
public:
|
||||
[[nodiscard]] u64 current_number() const { return m_current_number; }
|
||||
void increment(u64 amount) { m_current_number += amount; }
|
||||
void set(u64 value) { m_current_number = value; }
|
||||
|
||||
private:
|
||||
// A key generator has a current number.
|
||||
// The current number is always a positive integer less than or equal to 2^53 (9007199254740992) + 1.
|
||||
// The initial value of a key generator's current number is 1, set when the associated object store is created.
|
||||
// The current number is incremented as keys are generated, and may be updated to a specific value by using explicit keys.
|
||||
// FIXME: Implement support for KeyGenerator in ObjectStore.
|
||||
[[maybe_unused]] u64 current_number { 1 };
|
||||
u64 m_current_number { 1 };
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user