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

Unified Diff: base/feature_list.cc

Issue 1471693007: Make FeatureList override state be plumbed to renderer processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Match function order in header file. Created 5 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
« 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 050c5aa2d161c302f74b9a3b839df3cece050673..c06ba8b3bfdf6be87e55321f08b52a8c71d2bac9 100644
--- a/base/feature_list.cc
+++ b/base/feature_list.cc
@@ -49,20 +49,6 @@ bool FeatureList::IsFeatureOverriddenFromCommandLine(
!it->second.overridden_by_field_trial;
}
-void FeatureList::RegisterFieldTrialOverride(const std::string& feature_name,
- OverrideState override_state,
- FieldTrial* field_trial) {
- DCHECK(field_trial);
- DCHECK(!ContainsKey(overrides_, feature_name) ||
- !overrides_.find(feature_name)->second.field_trial)
- << "Feature " << feature_name
- << " has conflicting field trial overrides: "
- << overrides_.find(feature_name)->second.field_trial->trial_name()
- << " / " << field_trial->trial_name();
-
- RegisterOverride(feature_name, override_state, field_trial);
-}
-
void FeatureList::AssociateReportingFieldTrial(
const std::string& feature_name,
OverrideState for_overridden_state,
@@ -83,6 +69,43 @@ void FeatureList::AssociateReportingFieldTrial(
entry->field_trial = field_trial;
}
+void FeatureList::RegisterFieldTrialOverride(const std::string& feature_name,
+ OverrideState override_state,
+ FieldTrial* field_trial) {
+ DCHECK(field_trial);
+ DCHECK(!ContainsKey(overrides_, feature_name) ||
+ !overrides_.find(feature_name)->second.field_trial)
+ << "Feature " << feature_name
+ << " has conflicting field trial overrides: "
+ << overrides_.find(feature_name)->second.field_trial->trial_name()
+ << " / " << field_trial->trial_name();
+
+ RegisterOverride(feature_name, override_state, field_trial);
+}
+
+void FeatureList::GetFeatureOverrides(std::string* enable_overrides,
+ std::string* disable_overrides) {
+ DCHECK(initialized_);
+
+ enable_overrides->clear();
+ disable_overrides->clear();
+
+ for (const auto& entry : overrides_) {
+ switch (entry.second.overridden_state) {
+ case OVERRIDE_ENABLE_FEATURE:
+ if (!enable_overrides->empty())
+ enable_overrides->push_back(',');
+ enable_overrides->append(entry.first);
+ break;
+ case OVERRIDE_DISABLE_FEATURE:
+ if (!disable_overrides->empty())
+ disable_overrides->push_back(',');
+ disable_overrides->append(entry.first);
+ break;
+ }
+ }
+}
+
// static
bool FeatureList::IsEnabled(const Feature& feature) {
return GetInstance()->IsFeatureEnabled(feature);
« 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