Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp

Issue 2492623002: Implementation for feature policy - vibrate. (Closed)
Patch Set: Added layout tests for vibrate with runtime flag turned on Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp b/third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp
index b9501d6dd842674d51aa2b6b71fbbbf25caae1fb..6c0590a17eef60774116bb35d06414cfb113a1ce 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp
@@ -76,7 +76,9 @@ bool isFeatureEnabledInFrame(const FeaturePolicy::Feature& feature,
const LocalFrame* frame) {
// If there is no frame, or if feature policy is disabled, use defaults.
bool enabledByDefault =
- (feature.defaultPolicy != FeaturePolicy::FeatureDefault::DisableForAll);
+ (feature.defaultPolicy == FeaturePolicy::FeatureDefault::EnableForAll ||
raymes 2016/11/21 03:58:04 nit: outer brackets not needed
+ (feature.defaultPolicy == FeaturePolicy::FeatureDefault::EnableForSelf &&
+ !frame->isCrossOriginSubframe()));
if (!RuntimeEnabledFeatures::featurePolicyEnabled() || !frame)
return enabledByDefault;
FeaturePolicy* featurePolicy = frame->securityContext()->getFeaturePolicy();

Powered by Google App Engine
This is Rietveld 408576698