| // 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. |
| |
| enum WakeLockType { |
| "screen", |
| "system" |
| }; |
| |
| // https://w3c.github.io/wake-lock/#the-wakelock-interface |
| [ |
| SecureContext, |
| Exposed=(DedicatedWorker,Window), |
| RuntimeEnabled=WakeLock |
| ] interface WakeLock { |
| [CallWith=ScriptState, Exposed=Window] static Promise<PermissionState> requestPermission(WakeLockType type); |
| [CallWith=ScriptState] static Promise<void> request(WakeLockType type, optional WakeLockRequestOptions options); |
| }; |