Commit 45df6580 authored by Reilly Grant's avatar Reilly Grant Committed by Commit Bot

[wakelock] Only expose in workers when system locks are enabled

This is a follow-up to r746546 which uses the new SystemWakeLock feature
flag to only enable the wake lock interface in dedicated workers when
system wake locks are enabled. Screen wake locks are not supported in
workers.

Bug: 257511
Change-Id: I3c4147b7e40621b11a11d9676c4201c62f9e495f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2090722
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Reviewed-by: default avatarBen Kelly <wanderview@chromium.org>
Cr-Commit-Position: refs/heads/master@{#749963}
parent a564437e
...@@ -10,8 +10,7 @@ enum WakeLockType { ...@@ -10,8 +10,7 @@ enum WakeLockType {
// https://w3c.github.io/wake-lock/#the-wakelock-interface // https://w3c.github.io/wake-lock/#the-wakelock-interface
[ [
SecureContext, SecureContext,
Exposed=(DedicatedWorker,Window), Exposed(DedicatedWorker SystemWakeLock, Window WakeLock)
RuntimeEnabled=WakeLock
] interface WakeLock { ] interface WakeLock {
[CallWith=ScriptState, RaisesException] Promise<WakeLockSentinel> request(WakeLockType type); [CallWith=ScriptState, RaisesException] Promise<WakeLockSentinel> request(WakeLockType type);
}; };
...@@ -6,8 +6,7 @@ ...@@ -6,8 +6,7 @@
[ [
ActiveScriptWrappable, ActiveScriptWrappable,
Exposed=(DedicatedWorker,Window), Exposed(DedicatedWorker SystemWakeLock, Window WakeLock),
RuntimeEnabled=WakeLock,
SecureContext SecureContext
] interface WakeLockSentinel : EventTarget { ] interface WakeLockSentinel : EventTarget {
attribute EventHandler onrelease; attribute EventHandler onrelease;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
[ [
ImplementedAs=WorkerNavigatorWakeLock, ImplementedAs=WorkerNavigatorWakeLock,
RuntimeEnabled=WakeLock, RuntimeEnabled=SystemWakeLock,
SecureContext SecureContext
] partial interface WorkerNavigator { ] partial interface WorkerNavigator {
[CallWith=ScriptState, SameObject] readonly attribute WakeLock wakeLock; [CallWith=ScriptState, SameObject] readonly attribute WakeLock wakeLock;
......
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