Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wake lock: Implement new proposed API. #19600

Merged
merged 1 commit into from Oct 14, 2019

Conversation

@chromium-wpt-export-bot
Copy link
Collaborator

chromium-wpt-export-bot commented Oct 9, 2019

This is another big update to the implementation, which now follows the
API proposed in w3c/wake-lock#226.

From a Blink/Chromium internals perspective, things have not changed much,
and we still perform the same permission checks and connect to the wake lock
service via WakeLockStateRecord. The biggest change is that WakeLockController
was merged into WakeLock itself.

From an end-user perspective, though, the API now looks like a mix of the
old, navigator-based API and the one we implemented a few months ago:

  • The main idea is that WakeLock.request() no longer returns a promise that
    does not resolve while the lock is held, as that is not very intuitive.
    Instead, it returns a new WakeLockSentinel object.
  • WakeLockSentinel is a new interface that can release() a lock and receive
    "release" events.
  • We do go back to a Navigator-based API, but we also support
    WorkerNavigator.
  • There is no WakeLockRequest interface or state tracking in the WakeLock
    interface.
  • WakeLock.requestPermission() was removed.
  • Consequently, we now have a WakeLockEvent interface.

The changes to the spec still need to land, but there is some rough
consensus on what the API should look like, and we do not want to miss the
M79 branch cut.

Bug: 257511, 1010162
Change-Id: If1baed914ccd9eb7103a1bb71a40529976777ec2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1849683
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@{#705632}

Copy link
Collaborator

wpt-pr-bot left a comment

Already reviewed downstream.

@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-1849683 branch 6 times, most recently from 7afdf78 to a186be2 Oct 10, 2019
This is another big update to the implementation, which now follows the
API proposed in w3c/wake-lock#226.

From a Blink/Chromium internals perspective, things have not changed much,
and we still perform the same permission checks and connect to the wake lock
service via WakeLockStateRecord. The biggest change is that WakeLockController
was merged into WakeLock itself.

From an end-user perspective, though, the API now looks like a mix of the
old, navigator-based API and the one we implemented a few months ago:

* The main idea is that WakeLock.request() no longer returns a promise that
  does not resolve while the lock is held, as that is not very intuitive.
  Instead, it returns a new WakeLockSentinel object.
* WakeLockSentinel is a new interface that can release() a lock and receive
  "release" events.
* We do go back to a Navigator-based API, but we also support
  WorkerNavigator.
* There is no WakeLockRequest interface or state tracking in the WakeLock
  interface.
* WakeLock.requestPermission() was removed.
* Consequently, we now have a WakeLockEvent interface.

The changes to the spec still need to land, but there is some rough
consensus on what the API should look like, and we do not want to miss the
M79 branch cut.

Bug: 257511, 1010162
Change-Id: If1baed914ccd9eb7103a1bb71a40529976777ec2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1849683
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@{#705632}
@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-1849683 branch from a186be2 to 7d08fd3 Oct 14, 2019
@chromium-wpt-export-bot chromium-wpt-export-bot merged commit 1a69ff8 into master Oct 14, 2019
13 checks passed
13 checks passed
staging.wpt.fyi - chrome[experimental] Chrome results
Details
wpt.fyi - chrome[experimental] Chrome results
Details
Azure Pipelines Build #20191014.90 succeeded
Details
Azure Pipelines (./wpt test-jobs) ./wpt test-jobs succeeded
Details
Azure Pipelines (affected tests without changes: Safari Technology Preview) affected tests without changes: Safari Technology Preview succeeded
Details
Azure Pipelines (affected tests: Safari Technology Preview) affected tests: Safari Technology Preview succeeded
Details
Azure Pipelines (wpt.fyi hook: safari-preview-affected-tests) wpt.fyi hook: safari-preview-affected-tests succeeded
Details
Azure Pipelines (wpt.fyi hook: safari-preview-affected-tests-without-changes) wpt.fyi hook: safari-preview-affected-tests-without-changes succeeded
Details
Taskcluster (pull_request) TaskGroup: success
Details
staging.wpt.fyi - firefox[experimental] Firefox results
Details
staging.wpt.fyi - safari[experimental] Safari results
Details
wpt.fyi - firefox[experimental] Firefox results
Details
wpt.fyi - safari[experimental] Safari results
Details
@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-cl-1849683 branch Oct 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.