chromium/third_party/blink/renderer/modules/locks/lock_manager.idl

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// https://w3c.github.io/web-locks/#callbackdef-lockgrantedcallback
callback LockGrantedCallback = any (Lock? lock);

// https://w3c.github.io/web-locks/#lockmanager
[
    SecureContext,
    Exposed=(Window,Worker)
] interface LockManager {
    [CallWith=ScriptState, RaisesException, Measure] Promise<any> request(
        DOMString name,
        LockGrantedCallback callback);
    [CallWith=ScriptState, RaisesException, Measure] Promise<any> request(
        DOMString name,
        LockOptions options,
        LockGrantedCallback callback);

    [CallWith=ScriptState, RaisesException, Measure] Promise<LockManagerSnapshot> query();
};