mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-10 13:18:45 +02:00
Automatic update from web-platform-testsWeb Locks API: Fix IDL glitch A callback defined in Web IDL should take a nullable argument. We don't enforce this in our bindings code and it can't be introspected from JS so this is not a testable or web-facing change, just aligning the code with a spec fix. Spec issue: https://github.com/WICG/web-locks/issues/51 Spec link: https://wicg.github.io/web-locks/#callbackdef-lockgrantedcallback Change-Id: Icc2e076f62e45629a283d0039e2be30b4a6826c4 Reviewed-on: https://chromium-review.googlesource.com/c/1294421 Commit-Queue: Joshua Bell <jsbell@chromium.org> Commit-Queue: Victor Costan <pwnall@chromium.org> Reviewed-by: Victor Costan <pwnall@chromium.org> Cr-Commit-Position: refs/heads/master@{#601716} -- wpt-commits: 5a889be7d8cb12db57ab8bf32d2640e948ba1b2d wpt-pr: 13665
45 lines
1 KiB
Text
45 lines
1 KiB
Text
[SecureContext]
|
|
interface mixin NavigatorLocks {
|
|
readonly attribute LockManager locks;
|
|
};
|
|
Navigator includes NavigatorLocks;
|
|
WorkerNavigator includes NavigatorLocks;
|
|
|
|
[SecureContext, Exposed=(Window,Worker)]
|
|
interface LockManager {
|
|
Promise<any> request(DOMString name,
|
|
LockGrantedCallback callback);
|
|
Promise<any> request(DOMString name,
|
|
LockOptions options,
|
|
LockGrantedCallback callback);
|
|
|
|
Promise<LockManagerSnapshot> query();
|
|
};
|
|
|
|
callback LockGrantedCallback = Promise<any> (Lock? lock);
|
|
|
|
enum LockMode { "shared", "exclusive" };
|
|
|
|
dictionary LockOptions {
|
|
LockMode mode = "exclusive";
|
|
boolean ifAvailable = false;
|
|
boolean steal = false;
|
|
AbortSignal signal;
|
|
};
|
|
|
|
dictionary LockManagerSnapshot {
|
|
sequence<LockInfo> held;
|
|
sequence<LockInfo> pending;
|
|
};
|
|
|
|
dictionary LockInfo {
|
|
DOMString name;
|
|
LockMode mode;
|
|
DOMString clientId;
|
|
};
|
|
|
|
[SecureContext, Exposed=(Window,Worker)]
|
|
interface Lock {
|
|
readonly attribute DOMString name;
|
|
readonly attribute LockMode mode;
|
|
};
|