| |
| 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; |
| }; |