mirror of
https://github.com/servo/servo.git
synced 2025-10-04 02:29:12 +01:00
46 lines
1 KiB
Text
46 lines
1 KiB
Text
|
|
enum LockMode { "shared", "exclusive" };
|
|
|
|
dictionary LockOptions {
|
|
LockMode mode = "exclusive";
|
|
boolean ifAvailable = false;
|
|
};
|
|
|
|
callback LockGrantedCallback = any (Lock lock);
|
|
|
|
[Exposed=Window]
|
|
partial interface Navigator {
|
|
[SecureContext] readonly attribute LockManager locks;
|
|
};
|
|
|
|
[Exposed=Worker]
|
|
partial interface WorkerNavigator {
|
|
[SecureContext] readonly attribute LockManager locks;
|
|
};
|
|
|
|
[Exposed=(Window,Worker), SecureContext]
|
|
interface LockManager {
|
|
Promise<any> request(DOMString name,
|
|
LockGrantedCallback callback);
|
|
Promise<any> request(DOMString name,
|
|
LockOptions options,
|
|
LockGrantedCallback callback);
|
|
|
|
Promise<LockManagerSnapshot> query();
|
|
};
|
|
|
|
[Exposed=(Window,Worker), SecureContext]
|
|
interface Lock {
|
|
readonly attribute DOMString name;
|
|
readonly attribute LockMode mode;
|
|
};
|
|
|
|
dictionary LockManagerSnapshot {
|
|
sequence<LockInfo> pending;
|
|
sequence<LockInfo> held;
|
|
};
|
|
|
|
dictionary LockInfo {
|
|
DOMString name;
|
|
LockMode mode;
|
|
};
|