Index: content/common/feature_policy/feature_policy.cc |
diff --git a/content/common/feature_policy/feature_policy.cc b/content/common/feature_policy/feature_policy.cc |
index c96e59aaa30bb9f1b05eeaafd2bb8e0383e5827c..da219e1f91aa627687cca6d4eeeb89ba5ad9d853 100644 |
--- a/content/common/feature_policy/feature_policy.cc |
+++ b/content/common/feature_policy/feature_policy.cc |
@@ -42,6 +42,12 @@ ParsedFeaturePolicyDeclaration::ParsedFeaturePolicyDeclaration( |
ParsedFeaturePolicyDeclaration::~ParsedFeaturePolicyDeclaration() {} |
+bool operator==(const ParsedFeaturePolicyDeclaration& lhs, |
+ const ParsedFeaturePolicyDeclaration& rhs) { |
+ return std::tie(lhs.feature, lhs.matches_all_origins, lhs.origins) == |
+ std::tie(rhs.feature, rhs.matches_all_origins, rhs.origins); |
+} |
+ |
FeaturePolicy::Whitelist::Whitelist() : matches_all_origins_(false) {} |
FeaturePolicy::Whitelist::Whitelist(const Whitelist& rhs) = default; |
@@ -112,9 +118,8 @@ bool FeaturePolicy::IsFeatureEnabledForOrigin( |
auto whitelist = whitelists_.find(feature); |
if (whitelist != whitelists_.end()) |
return whitelist->second->Contains(origin); |
- if (default_policy == FeaturePolicy::FeatureDefault::EnableForAll) { |
+ if (default_policy == FeaturePolicy::FeatureDefault::EnableForAll) |
return true; |
- } |
if (default_policy == FeaturePolicy::FeatureDefault::EnableForSelf) { |
// TODO(iclelland): Remove the pointer equality check once it is possible to |
// compare opaque origins successfully against themselves. |