wake lock: Adapt to the latest version of the spec (9a17e1f48) #16844
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This CL includes an implementation of the Wake Lock spec after
https://github.com/w3c/wake-lock/pull/201 and subsequent pull requests that
clear up a few points.
Specifically, this CL implements the Wake Lock spec at commit
9a17e1f48ca519090b82dddca09ace3e1773931c ('Explain why WakeLock.request()
has no "if aborted" step').
The spec has undergone significant changes since the latest update to the
implementation, and multiple features were added and removed to the spec in
the meantime.
From a Web API user perspective, the Wake Lock API surface is now pretty
small:
methods, requestPermission() and request(). requestPermission() needs
pending work on the permissions side in //content and //chrome, so this CL
only implements request().
replaced by a single call to WakeLock.request().
actually hold a WakeLock object (and all attributes and event listeners
are gone).
and rejects with either NotAllowedError or AbortError in case something
did not work or the lock was cancelled.
specs such as Fetch) for cancelling a Wake Lock.
From a Blink perspective:
delegates the act of acquiring or releasing a wake lock to
WakeLockController.
device_orientation/) and tracks per-Document wake lock state. It also does
not acquire or release wake locks itself, but rather delegates it to its
per-wake-lock-type instances of WakeLockStateRecord. It also handles
per-document visibility and activity changes.
actually requests and cancels wake locks (by talking to //content and
//services).
Major pending Wake Lock features present in the spec:
Bug: 257511
Change-Id: I3dced3a16711b720a96b1a0d5c008d49e3b38c6d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1605687
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Cr-Commit-Position: refs/heads/master@{#663207}