Commit 88f4468b authored by Reilly Grant's avatar Reilly Grant Committed by Commit Bot

Enable Origin Trial for the Wake Lock API

This change configures the WakeLock feature as an Origin Trial. Since
the Origin Trial and Runtime Feature infrastructure has been merged
generation of feature_policy_helper.cc needs to depend on
runtime_enabled_features.json5 to avoid incremental build failures.

Bug: 257511
Change-Id: Ifd8ad0053b88b6701bb5ba3e58a93490fef49d48
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1797825Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695787}
parent 6b2c94c2
...@@ -869,6 +869,7 @@ blink_python_runner("make_core_generated_feature_policy_helper") { ...@@ -869,6 +869,7 @@ blink_python_runner("make_core_generated_feature_policy_helper") {
inputs = scripts_for_json5_files + [ inputs = scripts_for_json5_files + [
"../build/scripts/make_feature_policy_helper.py", "../build/scripts/make_feature_policy_helper.py",
"./feature_policy/feature_policy_features.json5", "./feature_policy/feature_policy_features.json5",
"../platform/runtime_enabled_features.json5",
"../build/scripts/templates/feature_policy_helper.cc.tmpl", "../build/scripts/templates/feature_policy_helper.cc.tmpl",
] ]
outputs = [ outputs = [
......
...@@ -149,7 +149,8 @@ PermissionDescriptorPtr ParsePermission(ScriptState* script_state, ...@@ -149,7 +149,8 @@ PermissionDescriptorPtr ParsePermission(ScriptState* script_state,
return CreatePermissionDescriptor(PermissionName::PERIODIC_BACKGROUND_SYNC); return CreatePermissionDescriptor(PermissionName::PERIODIC_BACKGROUND_SYNC);
} }
if (name == "wake-lock") { if (name == "wake-lock") {
if (!RuntimeEnabledFeatures::WakeLockEnabled()) { if (!RuntimeEnabledFeatures::WakeLockEnabled(
ExecutionContext::From(script_state))) {
exception_state.ThrowTypeError("Wake Lock is not enabled."); exception_state.ThrowTypeError("Wake Lock is not enabled.");
return nullptr; return nullptr;
} }
......
...@@ -1702,6 +1702,7 @@ ...@@ -1702,6 +1702,7 @@
}, },
{ {
name: "WakeLock", name: "WakeLock",
origin_trial_feature_name: "WakeLock",
status: "experimental", status: "experimental",
}, },
{ {
......
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