mirror of
https://github.com/servo/servo
synced 2026-04-25 17:15:48 +02:00
Add the Storage Standard WebIDL for NavigatorStorage and StorageManager, wire navigator.storage on Window and Worker, and implement persisted(), persist(), and estimate(). Testing: covered by WP test. part of #39100 fixes #39101 --------- Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
30 lines
802 B
Plaintext
30 lines
802 B
Plaintext
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
|
|
// https://storage.spec.whatwg.org/#api
|
|
|
|
[SecureContext]
|
|
interface mixin NavigatorStorage {
|
|
[SameObject, Pref="dom_storage_manager_api_enabled"] readonly attribute StorageManager storage;
|
|
};
|
|
Navigator includes NavigatorStorage;
|
|
WorkerNavigator includes NavigatorStorage;
|
|
|
|
[SecureContext, Exposed=(Window,Worker)]
|
|
interface StorageManager {
|
|
[NewObject]
|
|
Promise<boolean> persisted();
|
|
|
|
[Exposed=Window, NewObject]
|
|
Promise<boolean> persist();
|
|
|
|
[NewObject]
|
|
Promise<StorageEstimate> estimate();
|
|
};
|
|
|
|
dictionary StorageEstimate {
|
|
unsigned long long usage;
|
|
unsigned long long quota;
|
|
};
|