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

Unified Diff: extensions/common/feature_switch.h

Issue 1680823004: [Feature Switch][Media Router] Add required field trials to MR switch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed back to check media_router() Created 4 years, 10 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
Index: extensions/common/feature_switch.h
diff --git a/extensions/common/feature_switch.h b/extensions/common/feature_switch.h
index c170f9c2fb8f91cd74ef99130fc9630d3d1492e0..b39cc8c3cf0825ab1cb7a5a40c308f6bef7f83bb 100644
--- a/extensions/common/feature_switch.h
+++ b/extensions/common/feature_switch.h
@@ -6,6 +6,7 @@
#define EXTENSIONS_COMMON_FEATURE_SWITCH_H_
#include <string>
+#include <vector>
#include "base/macros.h"
@@ -26,8 +27,10 @@ namespace extensions {
// the finch config).
// 3. If there is a switch name, and the switch is present in the command line,
// the command line value will be used.
-// 4. If there is a finch experiment associated and applicable to the machine,
-// the finch value will be used.
+// 4. If there are field trials associated with the feature, and the machine
+// is in the "Enabled" group for all field trials, then the feature is
+// enabled. If the machine is in the "Disabled" group for any field trials,
+// the feature is disabled.
// 5. Otherwise, the default value is used.
class FeatureSwitch {
public:
@@ -72,13 +75,17 @@ class FeatureSwitch {
FeatureSwitch(const char* switch_name,
const char* field_trial_name,
DefaultValue default_value);
+ FeatureSwitch(const char* switch_name,
+ const std::vector<std::string>& required_field_trials,
+ DefaultValue default_value);
FeatureSwitch(const base::CommandLine* command_line,
const char* switch_name,
DefaultValue default_value);
FeatureSwitch(const base::CommandLine* command_line,
const char* switch_name,
- const char* field_trial_name,
+ const std::vector<std::string>& required_field_trials,
DefaultValue default_value);
+ ~FeatureSwitch();
// Consider using ScopedOverride instead.
void SetOverrideValue(OverrideValue value);
@@ -92,7 +99,7 @@ class FeatureSwitch {
const base::CommandLine* command_line_;
const char* switch_name_;
- const char* field_trial_name_;
+ std::vector<std::string> required_field_trials_;
bool default_value_;
OverrideValue override_value_;

Powered by Google App Engine
This is Rietveld 408576698