Commit e9eb0566 authored by Raphael Kubo da Costa's avatar Raphael Kubo da Costa Committed by Commit Bot

wake lock: Update all spec links.

Point to https://w3c.github.io/screen-wake-lock rather than
https://w3c.github.io/wake-lock.

While the latter redirects to the former, anchors are broken in the
redirection.

Change-Id: I2eca3e236c0105af8017a09af872935dadd43bbe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2395718
Auto-Submit: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805590}
parent 5a896790
...@@ -84,7 +84,7 @@ void WakeLockBrowserTest::NavigateToAndRespondWithScript( ...@@ -84,7 +84,7 @@ void WakeLockBrowserTest::NavigateToAndRespondWithScript(
loop.Run(); loop.Run();
} }
// https://w3c.github.io/wake-lock/#request-static-method // https://w3c.github.io/screen-wake-lock/#the-request-method
// Screen locks are never allowed from workers. // Screen locks are never allowed from workers.
IN_PROC_BROWSER_TEST_F(WakeLockBrowserTest, RequestScreenLockFromWorker) { IN_PROC_BROWSER_TEST_F(WakeLockBrowserTest, RequestScreenLockFromWorker) {
permissions::PermissionRequestObserver observer( permissions::PermissionRequestObserver observer(
......
...@@ -37,9 +37,9 @@ The rest of the implementation is found in the following directories: ...@@ -37,9 +37,9 @@ The rest of the implementation is found in the following directories:
* `chrome/browser/wake_lock` contains the Chrome-specific side of permission management for Wake Locks. When the Blink implementation needs to either query or request permission for wake locks, the request bubbles up to this directory, where the decision is made based on the wake lock type (for testing purposes, `content_shell` always grants screen wake locks and denies system wake locks in [`shell_permission_manager.cc`](/content/shell/browser/web_test/web_test_message_filter.cc)). * `chrome/browser/wake_lock` contains the Chrome-specific side of permission management for Wake Locks. When the Blink implementation needs to either query or request permission for wake locks, the request bubbles up to this directory, where the decision is made based on the wake lock type (for testing purposes, `content_shell` always grants screen wake locks and denies system wake locks in [`shell_permission_manager.cc`](/content/shell/browser/web_test/web_test_message_filter.cc)).
[Mojo interfaces]: ../../../../../services/device/public/mojom/ [Mojo interfaces]: ../../../../../services/device/public/mojom/
[Wake Lock management]: https://w3c.github.io/wake-lock/#managing-wake-locks [Wake Lock management]: https://w3c.github.io/screen-wake-lock/#managing-wake-locks
[Wake Lock specification]: https://w3c.github.io/wake-lock/ [Wake Lock specification]: https://w3c.github.io/screen-wake-lock/
[state records]: https://w3c.github.io/wake-lock/#dfn-state-record [state records]: https://w3c.github.io/screen-wake-lock/#dfn-state-record
### Testing ### Testing
...@@ -65,7 +65,7 @@ This section describes how the classes described above interact when the followi ...@@ -65,7 +65,7 @@ This section describes how the classes described above interact when the followi
const lock = await navigator.wakeLock.request("screen"); const lock = await navigator.wakeLock.request("screen");
``` ```
1. `WakeLock::request()` performs all the validation steps described in [the spec](https://w3c.github.io/wake-lock/#the-request-method). If all checks have passed, it creates a `ScriptPromiseResolver` and calls `WakeLock::DoRequest()`. 1. `WakeLock::request()` performs all the validation steps described in [the spec](https://w3c.github.io/screen-wake-lock/#the-request-method). If all checks have passed, it creates a `ScriptPromiseResolver` and calls `WakeLock::DoRequest()`.
1. `WakeLock::DoRequest()` simply forwards its arguments to `WakeLock::ObtainPermission()`. It exists as a separate method just to make writing unit tests easier, as we'd otherwise be unable to use our own `ScriptPromiseResolver`s in tests. 1. `WakeLock::DoRequest()` simply forwards its arguments to `WakeLock::ObtainPermission()`. It exists as a separate method just to make writing unit tests easier, as we'd otherwise be unable to use our own `ScriptPromiseResolver`s in tests.
1. `WakeLock::ObtainPermission()` connects to the [permission service](../../../public/mojom/permissions/permission.mojom) and asynchronously requests permission for a screen wake lock. 1. `WakeLock::ObtainPermission()` connects to the [permission service](../../../public/mojom/permissions/permission.mojom) and asynchronously requests permission for a screen wake lock.
1. In the browser process, the permission request bubbles up through `//content` and reaches `//chrome`'s [`WakeLockPermissionContext`](/chrome/browser/wake_lock/wake_lock_permission_context.cc), where `WakeLockPermissionContext::GetPermissionStatusInternal()` always grants `CONTENT_SETTINGS_TYPE_WAKE_LOCK_SCREEN` permission requests. 1. In the browser process, the permission request bubbles up through `//content` and reaches `//chrome`'s [`WakeLockPermissionContext`](/chrome/browser/wake_lock/wake_lock_permission_context.cc), where `WakeLockPermissionContext::GetPermissionStatusInternal()` always grants `CONTENT_SETTINGS_TYPE_WAKE_LOCK_SCREEN` permission requests.
...@@ -74,7 +74,7 @@ const lock = await navigator.wakeLock.request("screen"); ...@@ -74,7 +74,7 @@ const lock = await navigator.wakeLock.request("screen");
1. `WakeLockManager::AcquireWakeLock()` creates a new `WakeLockSentinel` instance, passing `this` as the `WakeLockSentinel`'s `WakeLockManager`. This new `WakeLockSentinel` is added to its set of [active locks]. 1. `WakeLockManager::AcquireWakeLock()` creates a new `WakeLockSentinel` instance, passing `this` as the `WakeLockSentinel`'s `WakeLockManager`. This new `WakeLockSentinel` is added to its set of [active locks].
1. The `ScriptPromiseResolver` created by `WakeLock::request()` is resolved with the new `WakeLockSentinel` object. 1. The `ScriptPromiseResolver` created by `WakeLock::request()` is resolved with the new `WakeLockSentinel` object.
[active locks]: https://w3c.github.io/wake-lock/#dfn-activelocks [active locks]: https://w3c.github.io/screen-wake-lock/#dfn-activelocks
### Wake Lock cancellation ### Wake Lock cancellation
...@@ -94,7 +94,7 @@ This section describes what happens when `lock.release()` is called. ...@@ -94,7 +94,7 @@ This section describes what happens when `lock.release()` is called.
1. `WakeLockManager::UnregisterSentinel()` implements the spec's [release wake lock algorithm]. If the given `WakeLockSentinel` is in `WakeLockManager`'s `wake_lock_sentinels_`, it will be removed and, if the list is empty, `WakeLockManager` will communicate with its `device::mojom::blink::WakeLock` instance and call its `CancelWakeLock()` method. 1. `WakeLockManager::UnregisterSentinel()` implements the spec's [release wake lock algorithm]. If the given `WakeLockSentinel` is in `WakeLockManager`'s `wake_lock_sentinels_`, it will be removed and, if the list is empty, `WakeLockManager` will communicate with its `device::mojom::blink::WakeLock` instance and call its `CancelWakeLock()` method.
1. Back in `WakeLockSentinel::DoRelease()`, it then clears its `manager_` member, and dispatches a `release` event with itself as a target. 1. Back in `WakeLockSentinel::DoRelease()`, it then clears its `manager_` member, and dispatches a `release` event with itself as a target.
[release wake lock algorithm]: https://w3c.github.io/wake-lock/#release-wake-lock-algorithm [release wake lock algorithm]: https://w3c.github.io/screen-wake-lock/#release-wake-lock-algorithm
## Other Wake Lock usage in Chromium ## Other Wake Lock usage in Chromium
...@@ -131,7 +131,7 @@ Example usage outside Blink includes: ...@@ -131,7 +131,7 @@ Example usage outside Blink includes:
## Permission Model ## Permission Model
The Wake Lock API spec checks for user activation in the context of [wake lock permission requests](https://w3c.github.io/wake-lock/#dfn-obtain-permission), as a result of a call to `WakeLock.request()`. If a user agent is configured to prompt a user when a wake lock is requested, user activation is required, otherwise the request will be denied. The Wake Lock API spec checks for user activation in the context of [wake lock permission requests](https://w3c.github.io/screen-wake-lock/#dfn-obtain-permission), as a result of a call to `WakeLock.request()`. If a user agent is configured to prompt a user when a wake lock is requested, user activation is required, otherwise the request will be denied.
In the Chromium implementation, there currently is no "prompt" state, and no permission UI or settings: wake lock requests are either always granted or always denied: In the Chromium implementation, there currently is no "prompt" state, and no permission UI or settings: wake lock requests are either always granted or always denied:
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// https://w3c.github.io/wake-lock/#extensions-to-the-navigator-interface // https://w3c.github.io/screen-wake-lock/#extensions-to-the-navigator-interface
[ [
ImplementedAs=NavigatorWakeLock, ImplementedAs=NavigatorWakeLock,
......
...@@ -61,7 +61,7 @@ ScriptPromise WakeLock::request(ScriptState* script_state, ...@@ -61,7 +61,7 @@ ScriptPromise WakeLock::request(ScriptState* script_state,
return ScriptPromise(); return ScriptPromise();
} }
// https://w3c.github.io/wake-lock/#the-request-method // https://w3c.github.io/screen-wake-lock/#the-request-method
auto* context = ExecutionContext::From(script_state); auto* context = ExecutionContext::From(script_state);
DCHECK(context->IsWindow() || context->IsDedicatedWorkerGlobalScope()); DCHECK(context->IsWindow() || context->IsDedicatedWorkerGlobalScope());
...@@ -162,7 +162,7 @@ ScriptPromise WakeLock::request(ScriptState* script_state, ...@@ -162,7 +162,7 @@ ScriptPromise WakeLock::request(ScriptState* script_state,
} }
void WakeLock::DoRequest(WakeLockType type, ScriptPromiseResolver* resolver) { void WakeLock::DoRequest(WakeLockType type, ScriptPromiseResolver* resolver) {
// https://w3c.github.io/wake-lock/#the-request-method // https://w3c.github.io/screen-wake-lock/#the-request-method
// 5.1. Let state be the result of awaiting obtain permission steps with type: // 5.1. Let state be the result of awaiting obtain permission steps with type:
ObtainPermission( ObtainPermission(
type, WTF::Bind(&WakeLock::DidReceivePermissionResponse, type, WTF::Bind(&WakeLock::DidReceivePermissionResponse,
...@@ -172,7 +172,7 @@ void WakeLock::DoRequest(WakeLockType type, ScriptPromiseResolver* resolver) { ...@@ -172,7 +172,7 @@ void WakeLock::DoRequest(WakeLockType type, ScriptPromiseResolver* resolver) {
void WakeLock::DidReceivePermissionResponse(WakeLockType type, void WakeLock::DidReceivePermissionResponse(WakeLockType type,
ScriptPromiseResolver* resolver, ScriptPromiseResolver* resolver,
PermissionStatus status) { PermissionStatus status) {
// https://w3c.github.io/wake-lock/#the-request-method // https://w3c.github.io/screen-wake-lock/#the-request-method
DCHECK(status == PermissionStatus::GRANTED || DCHECK(status == PermissionStatus::GRANTED ||
status == PermissionStatus::DENIED); status == PermissionStatus::DENIED);
DCHECK(resolver); DCHECK(resolver);
...@@ -203,7 +203,7 @@ void WakeLock::DidReceivePermissionResponse(WakeLockType type, ...@@ -203,7 +203,7 @@ void WakeLock::DidReceivePermissionResponse(WakeLockType type,
} }
void WakeLock::ContextDestroyed() { void WakeLock::ContextDestroyed() {
// https://w3c.github.io/wake-lock/#handling-document-loss-of-full-activity // https://w3c.github.io/screen-wake-lock/#handling-document-loss-of-full-activity
// 1. Let document be the responsible document of the current settings object. // 1. Let document be the responsible document of the current settings object.
// 2. Let screenRecord be the platform wake lock's state record associated // 2. Let screenRecord be the platform wake lock's state record associated
// with document and wake lock type "screen". // with document and wake lock type "screen".
...@@ -220,7 +220,7 @@ void WakeLock::ContextDestroyed() { ...@@ -220,7 +220,7 @@ void WakeLock::ContextDestroyed() {
} }
void WakeLock::PageVisibilityChanged() { void WakeLock::PageVisibilityChanged() {
// https://w3c.github.io/wake-lock/#handling-document-loss-of-visibility // https://w3c.github.io/screen-wake-lock/#handling-document-loss-of-visibility
// 1. Let document be the Document of the top-level browsing context. // 1. Let document be the Document of the top-level browsing context.
// 2. If document's visibility state is "visible", abort these steps. // 2. If document's visibility state is "visible", abort these steps.
if (GetPage() && GetPage()->IsPageVisible()) if (GetPage() && GetPage()->IsPageVisible())
...@@ -238,7 +238,7 @@ void WakeLock::PageVisibilityChanged() { ...@@ -238,7 +238,7 @@ void WakeLock::PageVisibilityChanged() {
void WakeLock::ObtainPermission( void WakeLock::ObtainPermission(
WakeLockType type, WakeLockType type,
base::OnceCallback<void(PermissionStatus)> callback) { base::OnceCallback<void(PermissionStatus)> callback) {
// https://w3c.github.io/wake-lock/#dfn-obtain-permission // https://w3c.github.io/screen-wake-lock/#dfn-obtain-permission
// Note we actually implement a simplified version of the "obtain permission" // Note we actually implement a simplified version of the "obtain permission"
// algorithm that essentially just calls the "request permission to use" // algorithm that essentially just calls the "request permission to use"
// algorithm from the Permissions spec (i.e. we bypass all the steps covering // algorithm from the Permissions spec (i.e. we bypass all the steps covering
......
...@@ -73,7 +73,7 @@ class MODULES_EXPORT WakeLock final : public ScriptWrappable, ...@@ -73,7 +73,7 @@ class MODULES_EXPORT WakeLock final : public ScriptWrappable,
HeapMojoWrapperMode::kWithoutContextObserver> HeapMojoWrapperMode::kWithoutContextObserver>
permission_service_; permission_service_;
// https://w3c.github.io/wake-lock/#concepts-and-state-record // https://w3c.github.io/screen-wake-lock/#concepts-and-state-record
// Each platform wake lock (one per wake lock type) has an associated state // Each platform wake lock (one per wake lock type) has an associated state
// record per responsible document [...] internal slots. // record per responsible document [...] internal slots.
Member<WakeLockManager> managers_[kWakeLockTypeCount]; Member<WakeLockManager> managers_[kWakeLockTypeCount];
......
...@@ -7,7 +7,7 @@ enum WakeLockType { ...@@ -7,7 +7,7 @@ enum WakeLockType {
"system" "system"
}; };
// https://w3c.github.io/wake-lock/#the-wakelock-interface // https://w3c.github.io/screen-wake-lock/#the-wakelock-interface
[ [
SecureContext, SecureContext,
Exposed(DedicatedWorker SystemWakeLock, Window WakeLock) Exposed(DedicatedWorker SystemWakeLock, Window WakeLock)
......
...@@ -24,7 +24,7 @@ WakeLockManager::WakeLockManager(ExecutionContext* execution_context, ...@@ -24,7 +24,7 @@ WakeLockManager::WakeLockManager(ExecutionContext* execution_context,
} }
void WakeLockManager::AcquireWakeLock(ScriptPromiseResolver* resolver) { void WakeLockManager::AcquireWakeLock(ScriptPromiseResolver* resolver) {
// https://w3c.github.io/wake-lock/#acquire-wake-lock-algorithm // https://w3c.github.io/screen-wake-lock/#acquire-wake-lock-algorithm
// 1. If the wake lock for type type is not applicable, return false. // 1. If the wake lock for type type is not applicable, return false.
// 2. Set active to true if the platform wake lock has an active wake lock for // 2. Set active to true if the platform wake lock has an active wake lock for
// type. // type.
...@@ -52,7 +52,7 @@ void WakeLockManager::AcquireWakeLock(ScriptPromiseResolver* resolver) { ...@@ -52,7 +52,7 @@ void WakeLockManager::AcquireWakeLock(ScriptPromiseResolver* resolver) {
&WakeLockManager::OnWakeLockConnectionError, WrapWeakPersistent(this))); &WakeLockManager::OnWakeLockConnectionError, WrapWeakPersistent(this)));
wake_lock_->RequestWakeLock(); wake_lock_->RequestWakeLock();
} }
// https://w3c.github.io/wake-lock/#the-request-method // https://w3c.github.io/screen-wake-lock/#the-request-method
// 5.2. Let lock be a new WakeLockSentinel object with its type attribute set // 5.2. Let lock be a new WakeLockSentinel object with its type attribute set
// to type. // to type.
// 5.4. Resolve promise with lock. // 5.4. Resolve promise with lock.
...@@ -63,7 +63,7 @@ void WakeLockManager::AcquireWakeLock(ScriptPromiseResolver* resolver) { ...@@ -63,7 +63,7 @@ void WakeLockManager::AcquireWakeLock(ScriptPromiseResolver* resolver) {
} }
void WakeLockManager::UnregisterSentinel(WakeLockSentinel* sentinel) { void WakeLockManager::UnregisterSentinel(WakeLockSentinel* sentinel) {
// https://w3c.github.io/wake-lock/#release-wake-lock-algorithm // https://w3c.github.io/screen-wake-lock/#release-wake-lock-algorithm
// 1. Let document be the responsible document of the current settings object. // 1. Let document be the responsible document of the current settings object.
// 2. Let record be the platform wake lock's state record associated with // 2. Let record be the platform wake lock's state record associated with
// document and type. // document and type.
......
...@@ -19,7 +19,7 @@ class ExecutionContext; ...@@ -19,7 +19,7 @@ class ExecutionContext;
class ScriptPromiseResolver; class ScriptPromiseResolver;
class WakeLockSentinel; class WakeLockSentinel;
// https://w3c.github.io/wake-lock/#concepts-and-state-record // https://w3c.github.io/screen-wake-lock/#concepts-and-state-record
// Per-document and per-wake lock type internal data. // Per-document and per-wake lock type internal data.
class MODULES_EXPORT WakeLockManager final class MODULES_EXPORT WakeLockManager final
: public GarbageCollected<WakeLockManager> { : public GarbageCollected<WakeLockManager> {
......
...@@ -23,7 +23,7 @@ WakeLockSentinel::WakeLockSentinel(ScriptState* script_state, ...@@ -23,7 +23,7 @@ WakeLockSentinel::WakeLockSentinel(ScriptState* script_state,
WakeLockSentinel::~WakeLockSentinel() = default; WakeLockSentinel::~WakeLockSentinel() = default;
ScriptPromise WakeLockSentinel::release(ScriptState* script_state) { ScriptPromise WakeLockSentinel::release(ScriptState* script_state) {
// https://w3c.github.io/wake-lock/#the-release-method // https://w3c.github.io/screen-wake-lock/#the-release-method
// 1. Let promise be a new promise. // 1. Let promise be a new promise.
// 2. Run the following steps in parallel: // 2. Run the following steps in parallel:
// 2.1. Run release wake lock with lock set to this object and type set to the // 2.1. Run release wake lock with lock set to this object and type set to the
...@@ -39,7 +39,7 @@ bool WakeLockSentinel::released() const { ...@@ -39,7 +39,7 @@ bool WakeLockSentinel::released() const {
} }
String WakeLockSentinel::type() const { String WakeLockSentinel::type() const {
// https://w3c.github.io/wake-lock/#dom-wakelocksentinel-type // https://w3c.github.io/screen-wake-lock/#dom-wakelocksentinel-type
// The type attribute corresponds to the WakeLockSentinel's wake lock type. // The type attribute corresponds to the WakeLockSentinel's wake lock type.
switch (type_) { switch (type_) {
case WakeLockType::kScreen: case WakeLockType::kScreen:
...@@ -78,7 +78,7 @@ void WakeLockSentinel::ContextDestroyed() { ...@@ -78,7 +78,7 @@ void WakeLockSentinel::ContextDestroyed() {
} }
void WakeLockSentinel::DoRelease() { void WakeLockSentinel::DoRelease() {
// https://w3c.github.io/wake-lock/#release-wake-lock-algorithm // https://w3c.github.io/screen-wake-lock/#release-wake-lock-algorithm
// 1. Let document be the responsible document of the current settings object. // 1. Let document be the responsible document of the current settings object.
// 2. Let record be the platform wake lock's state record associated with // 2. Let record be the platform wake lock's state record associated with
// document and type. // document and type.
...@@ -102,7 +102,7 @@ void WakeLockSentinel::DoRelease() { ...@@ -102,7 +102,7 @@ void WakeLockSentinel::DoRelease() {
} }
void WakeLockSentinel::DispatchReleaseEvent() { void WakeLockSentinel::DispatchReleaseEvent() {
// https://w3c.github.io/wake-lock/#release-wake-lock-algorithm // https://w3c.github.io/screen-wake-lock/#release-wake-lock-algorithm
// 6.1. Set lock.released to true. // 6.1. Set lock.released to true.
DCHECK(!released_); DCHECK(!released_);
released_ = true; released_ = true;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// https://w3c.github.io/wake-lock/#the-wakelocksentinel-interface // https://w3c.github.io/screen-wake-lock/#the-wakelocksentinel-interface
[ [
ActiveScriptWrappable, ActiveScriptWrappable,
......
...@@ -77,7 +77,7 @@ TEST(WakeLockTest, RequestWakeLockDenied) { ...@@ -77,7 +77,7 @@ TEST(WakeLockTest, RequestWakeLockDenied) {
EXPECT_EQ("NotAllowedError", dom_exception->name()); EXPECT_EQ("NotAllowedError", dom_exception->name());
} }
// https://w3c.github.io/wake-lock/#handling-document-loss-of-full-activity // https://w3c.github.io/screen-wake-lock/#handling-document-loss-of-full-activity
TEST(WakeLockTest, LossOfDocumentActivity) { TEST(WakeLockTest, LossOfDocumentActivity) {
MockWakeLockService wake_lock_service; MockWakeLockService wake_lock_service;
WakeLockTestingContext context(&wake_lock_service); WakeLockTestingContext context(&wake_lock_service);
...@@ -121,7 +121,7 @@ TEST(WakeLockTest, LossOfDocumentActivity) { ...@@ -121,7 +121,7 @@ TEST(WakeLockTest, LossOfDocumentActivity) {
EXPECT_FALSE(system_lock.is_acquired()); EXPECT_FALSE(system_lock.is_acquired());
} }
// https://w3c.github.io/wake-lock/#handling-document-loss-of-visibility // https://w3c.github.io/screen-wake-lock/#handling-document-loss-of-visibility
TEST(WakeLockTest, PageVisibilityHidden) { TEST(WakeLockTest, PageVisibilityHidden) {
MockWakeLockService wake_lock_service; MockWakeLockService wake_lock_service;
WakeLockTestingContext context(&wake_lock_service); WakeLockTestingContext context(&wake_lock_service);
...@@ -172,7 +172,7 @@ TEST(WakeLockTest, PageVisibilityHidden) { ...@@ -172,7 +172,7 @@ TEST(WakeLockTest, PageVisibilityHidden) {
EXPECT_TRUE(screen_lock.is_acquired()); EXPECT_TRUE(screen_lock.is_acquired());
} }
// https://w3c.github.io/wake-lock/#handling-document-loss-of-visibility // https://w3c.github.io/screen-wake-lock/#handling-document-loss-of-visibility
TEST(WakeLockTest, PageVisibilityHiddenBeforeLockAcquisition) { TEST(WakeLockTest, PageVisibilityHiddenBeforeLockAcquisition) {
MockWakeLockService wake_lock_service; MockWakeLockService wake_lock_service;
WakeLockTestingContext context(&wake_lock_service); WakeLockTestingContext context(&wake_lock_service);
......
...@@ -22,7 +22,7 @@ namespace blink { ...@@ -22,7 +22,7 @@ namespace blink {
// WakeLockType enum as a C++ enum, and for converting between WakeLockType and // WakeLockType enum as a C++ enum, and for converting between WakeLockType and
// device.mojom.WakeLockType. // device.mojom.WakeLockType.
// https://w3c.github.io/wake-lock/#the-wakelocktype-enum // https://w3c.github.io/screen-wake-lock/#the-wakelocktype-enum
enum class WakeLockType : int8_t { kScreen, kSystem, kMaxValue = kSystem }; enum class WakeLockType : int8_t { kScreen, kSystem, kMaxValue = kSystem };
// Useful for creating arrays with size N, where N is the number of different // Useful for creating arrays with size N, where N is the number of different
......
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// This was originally in
// https://w3c.github.io/wake-lock/#extensions-to-the-workernavigator-interface // https://w3c.github.io/wake-lock/#extensions-to-the-workernavigator-interface
// until System Wake Lock API was split from the Screen Wake Lock API.
[ [
ImplementedAs=WorkerNavigatorWakeLock, ImplementedAs=WorkerNavigatorWakeLock,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment