W3C home > Mailing lists > Public > public-device-apis-log@w3.org > May 2019

Re: [wake-lock] Losing reference to a WakeLock object is a bug or intended behavior (#199)

From: Kenneth Rohde Christiansen via GitHub <sysbot+gh@w3.org>
Date: Wed, 01 May 2019 08:56:05 +0000
To: public-device-apis-log@w3.org
Message-ID: <issue_comment.created-488238555-1556700964-sysbot+gh@w3.org>
I think that might work, so let's have that discussion now before implementation proceeds :-)

```webidl
enum WakeLockType { "screen", "system" };

dictionary WakeLockRequestOptions {
  AbortSignal? signal = null;
};

[SecureContext, Exposed=(DedicatedWorker, Window)]
interface WakeLockManager {
  [Exposed=Window] static Promise<PermissionState> requestPermission(WakeLockType type);

  // Promise never resolves, so will fail or be aborted
  // In the future it could resolve if a timeout is set as part of options
  static Promise<void> request(WakeLockType type, optional WakeLockRequestOptions options);
};
```

What do people think? @rakuco @marcoscaceres @domenic @reillyeon @jakearchibald 

-- 
GitHub Notification of comment by kenchris
Please view or discuss this issue at https://github.com/w3c/wake-lock/issues/199#issuecomment-488238555 using your GitHub account
Received on Wednesday, 1 May 2019 08:56:06 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 1 May 2019 08:56:07 UTC