blob: 2e34af83b913a7765fef8669af141623eec07804 [file] [log] [blame]
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[RuntimeEnabled=DisplayLocking, ActiveScriptWrappable]
interface DisplayLockContext {
// Acquires a display lock (possibly asynchronously) with the given options.
// Returns a promise that resolves when the lock is acquired.
[CallWith=ScriptState] Promise<any> acquire(optional DisplayLockOptions options);
// Causes co-operative updates to happen on the locked subtree.
// Returns a promise that resolves when the update is finished.
[CallWith=ScriptState] Promise<any> update();
// Commits the locked subtree, which releases the lock and updates any
// necessary lifecycle phases.
// Returns a promise that resolves when the commit is finished.
[CallWith=ScriptState] Promise<any> commit();
};