Commit 0c7cc698 authored by Ayu Ishii's avatar Ayu Ishii Committed by Commit Bot

[idle] Implement kill switch for IdleDetection

IdleDetection allows sites to observe user idle status. Before launching
this feature, we want to add a kill switch that can be set from
server side that lets us turn off the feature in case where there is a
security or privacy problem.


Bug: 947707
Change-Id: Ic44fcaf6ed2ce5f5ae5026fc8040be1b51dac26f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1548035Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Reviewed-by: default avatarPhilip Jägenstedt <foolip@chromium.org>
Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Ayu Ishii <ayui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#649192}
parent be974130
...@@ -481,6 +481,9 @@ void SetIndividualRuntimeFeatures( ...@@ -481,6 +481,9 @@ void SetIndividualRuntimeFeatures(
WebRuntimeFeatures::EnableSignedExchangeSubresourcePrefetch( WebRuntimeFeatures::EnableSignedExchangeSubresourcePrefetch(
base::FeatureList::IsEnabled( base::FeatureList::IsEnabled(
features::kSignedExchangeSubresourcePrefetch)); features::kSignedExchangeSubresourcePrefetch));
if (!base::FeatureList::IsEnabled(features::kIdleDetection))
WebRuntimeFeatures::EnableIdleDetection(false);
} }
} // namespace } // namespace
......
...@@ -188,6 +188,12 @@ const base::Feature kHeapCompaction{"HeapCompaction", ...@@ -188,6 +188,12 @@ const base::Feature kHeapCompaction{"HeapCompaction",
const base::Feature kHistoryManipulationIntervention{ const base::Feature kHistoryManipulationIntervention{
"HistoryManipulationIntervention", base::FEATURE_ENABLED_BY_DEFAULT}; "HistoryManipulationIntervention", base::FEATURE_ENABLED_BY_DEFAULT};
// This is intended as a kill switch for the Idle Detection feature. To enable
// this feature,the experimental web platform features flag should be set,
// or the site should obtain an Origin Trial token.
const base::Feature kIdleDetection{"IdleDetection",
base::FEATURE_ENABLED_BY_DEFAULT};
// This flag is used to set field parameters to choose predictor we use when // This flag is used to set field parameters to choose predictor we use when
// kResamplingInputEvents is disabled. It's used for gatherig accuracy metrics // kResamplingInputEvents is disabled. It's used for gatherig accuracy metrics
// on finch and also for choosing predictor type for predictedEvents API without // on finch and also for choosing predictor type for predictedEvents API without
......
...@@ -51,6 +51,7 @@ CONTENT_EXPORT extern const base::Feature kFreezeFramesOnVisibility; ...@@ -51,6 +51,7 @@ CONTENT_EXPORT extern const base::Feature kFreezeFramesOnVisibility;
CONTENT_EXPORT extern const base::Feature kGuestViewCrossProcessFrames; CONTENT_EXPORT extern const base::Feature kGuestViewCrossProcessFrames;
CONTENT_EXPORT extern const base::Feature kHeapCompaction; CONTENT_EXPORT extern const base::Feature kHeapCompaction;
CONTENT_EXPORT extern const base::Feature kHistoryManipulationIntervention; CONTENT_EXPORT extern const base::Feature kHistoryManipulationIntervention;
CONTENT_EXPORT extern const base::Feature kIdleDetection;
CONTENT_EXPORT extern const base::Feature kInputPredictorTypeChoice; CONTENT_EXPORT extern const base::Feature kInputPredictorTypeChoice;
CONTENT_EXPORT extern const base::Feature kIsolateOrigins; CONTENT_EXPORT extern const base::Feature kIsolateOrigins;
CONTENT_EXPORT extern const char kIsolateOriginsFieldTrialParamName[]; CONTENT_EXPORT extern const char kIsolateOriginsFieldTrialParamName[];
......
...@@ -234,6 +234,7 @@ class WebRuntimeFeatures { ...@@ -234,6 +234,7 @@ class WebRuntimeFeatures {
BLINK_PLATFORM_EXPORT static void EnableHTMLImports(bool); BLINK_PLATFORM_EXPORT static void EnableHTMLImports(bool);
BLINK_PLATFORM_EXPORT static void EnableSignedExchangeSubresourcePrefetch( BLINK_PLATFORM_EXPORT static void EnableSignedExchangeSubresourcePrefetch(
bool); bool);
BLINK_PLATFORM_EXPORT static void EnableIdleDetection(bool);
private: private:
WebRuntimeFeatures(); WebRuntimeFeatures();
......
...@@ -648,4 +648,8 @@ void WebRuntimeFeatures::EnableSignedExchangeSubresourcePrefetch(bool enable) { ...@@ -648,4 +648,8 @@ void WebRuntimeFeatures::EnableSignedExchangeSubresourcePrefetch(bool enable) {
RuntimeEnabledFeatures::SetSignedExchangeSubresourcePrefetchEnabled(enable); RuntimeEnabledFeatures::SetSignedExchangeSubresourcePrefetchEnabled(enable);
} }
void WebRuntimeFeatures::EnableIdleDetection(bool enable) {
RuntimeEnabledFeatures::SetIdleDetectionEnabled(enable);
}
} // namespace blink } // namespace blink
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