mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 19:45:12 +00:00
LibWeb/IDB: Implement KeyGenerator
This commit is contained in:
parent
8af5f25dd0
commit
c276c212a0
Notes:
github-actions[bot]
2025-03-27 15:50:07 +00:00
Author: https://github.com/stelar7 Commit: https://github.com/LadybirdBrowser/ladybird/commit/c276c212a0f Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4077 Reviewed-by: https://github.com/AtkinsSJ Reviewed-by: https://github.com/gmta ✅
1 changed files with 24 additions and 0 deletions
24
Libraries/LibWeb/IndexedDB/Internal/KeyGenerator.h
Normal file
24
Libraries/LibWeb/IndexedDB/Internal/KeyGenerator.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* Copyright (c) 2025, stelar7 <dudedbz@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Types.h>
|
||||
|
||||
namespace Web::IndexedDB {
|
||||
|
||||
// https://w3c.github.io/IndexedDB/#key-generator-construct
|
||||
class KeyGenerator {
|
||||
public:
|
||||
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.
|
||||
u64 current_number { 1 };
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue