mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-24 09:52:31 +00:00
Everywhere: Implement persistence of localStorage using sqlite
This change follows the pattern of our cookies persistence implementation: the "browser" process is responsible for interacting with the sqlite database, and WebContent communicates all storage operations via IPC. The new database table uses (storage_endpoint, storage_key, bottle_key) as the primary key. This design follows concepts from the https://storage.spec.whatwg.org/ and is intended to support reuse of the persistence layer for other APIs (e.g., CacheStorage, IndexedDB). For now, `storage_endpoint` is always "localStorage", `storage_key` is the website's origin, and `bottle_key` is the name of the localStorage key.
This commit is contained in:
parent
f53559cb55
commit
84b9224121
Notes:
github-actions[bot]
2025-06-12 15:05:54 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 84b9224121
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5052
Reviewed-by: https://github.com/shannonbooth ✅
Reviewed-by: https://github.com/trflynn89
24 changed files with 694 additions and 118 deletions
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2024-2025, Shannon Booth <shannon@serenityos.org>
|
||||
* Copyright (c) 2025, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -12,11 +13,11 @@ ReadonlySpan<StorageEndpoint> StorageEndpoint::registered_endpoints()
|
|||
{
|
||||
// https://storage.spec.whatwg.org/#registered-storage-endpoints
|
||||
static auto const endpoints = to_array<StorageEndpoint>({
|
||||
{ "caches"_string, StorageType::Local, {} },
|
||||
{ "indexedDB"_string, StorageType::Local, {} },
|
||||
{ "localStorage"_string, StorageType::Local, 5 * MiB },
|
||||
{ "serviceWorkerRegistrations"_string, StorageType::Local, {} },
|
||||
{ "sessionStorage"_string, StorageType::Session, 5 * MiB },
|
||||
{ StorageEndpointType::Caches, StorageType::Local, {} },
|
||||
{ StorageEndpointType::IndexedDB, StorageType::Local, {} },
|
||||
{ StorageEndpointType::LocalStorage, StorageType::Local, LOCAL_STORAGE_QUOTA },
|
||||
{ StorageEndpointType::ServiceWorkerRegistrations, StorageType::Local, {} },
|
||||
{ StorageEndpointType::SessionStorage, StorageType::Session, SESSION_STORAGE_QUOTA },
|
||||
});
|
||||
return endpoints;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue