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

Unified Diff: base/feature_list.cc

Issue 1809633003: Allow trials to associate without overriding a feature. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a comment. Created 4 years, 9 months 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
« no previous file with comments | « base/feature_list.h ('k') | base/feature_list_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/feature_list.cc
diff --git a/base/feature_list.cc b/base/feature_list.cc
index d10c60bd4c5a1c165f42ea0e65dc2bde9017e44d..089da644e061cd7ac1b3945ab2791f3ccc84f333 100644
--- a/base/feature_list.cc
+++ b/base/feature_list.cc
@@ -108,6 +108,8 @@ void FeatureList::GetFeatureOverrides(std::string* enable_overrides,
case OVERRIDE_DISABLE_FEATURE:
target_list = disable_overrides;
break;
+ case OVERRIDE_USE_DEFAULT:
+ continue;
}
if (!target_list->empty())
@@ -177,7 +179,10 @@ bool FeatureList::IsFeatureEnabled(const Feature& feature) {
entry.field_trial->group();
// TODO(asvitkine) Expand this section as more support is added.
- return entry.overridden_state == OVERRIDE_ENABLE_FEATURE;
+
+ // If marked as OVERRIDE_USE_DEFAULT, simply return the default state below.
+ if (entry.overridden_state != OVERRIDE_USE_DEFAULT)
+ return entry.overridden_state == OVERRIDE_ENABLE_FEATURE;
}
// Otherwise, return the default state.
return feature.default_state == FEATURE_ENABLED_BY_DEFAULT;
« no previous file with comments | « base/feature_list.h ('k') | base/feature_list_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698