• Home
  • Raw
  • Download

Lines Matching full:feature

24 // Specifies whether a given feature is enabled or disabled by default.
30 // The Feature struct is used to define the default state for a feature. See
32 // for a given feature name - generally defined as a constant global variable or
35 struct BASE_EXPORT Feature { struct
36 // The name of the feature. This should be unique to each feature and is used
38 // It is strongly recommended to use CamelCase style for feature names, e.g.
42 // The default state (i.e. enabled or disabled) for this feature.
48 // not, via a DcheckIsFatal feature. We define the Feature here since it is argument
50 extern BASE_EXPORT const Feature kDCheckIsFatalFeature;
53 // The FeatureList class is used to determine whether a given feature is on or
57 // The basic use case is for any feature that can be toggled (e.g. through
58 // command-line or an experiment) to have a defined Feature struct, e.g.:
60 // const base::Feature kMyGreatFeature {
64 // Then, client code that wishes to query the state of the feature would check:
67 // // Feature code goes here.
71 // flags to enable or disable the feature, any experiments that may control it
73 // whether the feature is on.
76 // separated feature names via the following command-line flags:
97 // Initializes feature overrides via command-line flags |enable_features| and
99 // enable or disable, respectively. If a feature appears on both lists, then
101 // then this initialization will also associate the feature state override
102 // with the named field trial, if it exists. If a feature name is prefixed
110 // Initializes feature overrides through the field trial allocator, which
111 // we're using to store the feature names, their override state, and the name
115 // Specifies whether a feature override enables or disables the feature.
128 // command-line setting the feature state to |for_overridden_state|. The trial
129 // will be activated when the state of the feature is first queried. This
137 // feature to |override_state|. Command-line overrides still take precedence
138 // over field trials, so this will have no effect if the feature is being
140 // activated when the feature state for this feature is queried. This should
147 // Loops through feature overrides and serializes them all into |allocator|.
150 // Returns comma-separated lists of feature names (in the same format that is
166 // Returns whether the given |feature| is enabled. Must only be called after
168 // a feature with a given name must only have a single corresponding Feature
170 static bool IsEnabled(const Feature& feature);
172 // Returns the field trial associated with the given |feature|. Must only be
174 static FieldTrial* GetFieldTrial(const Feature& feature);
176 // Splits a comma-separated string containing feature names into a vector. The
181 // Initializes and sets an instance of FeatureList with feature overrides via
193 // Registers the given |instance| to be the singleton feature list for this
205 // Sets a given (initialized) |instance| to be the singleton feature list,
218 // The overridden enable (on/off) state of the feature.
222 // state of the feature is queried for the first time. Weak pointer to the
226 // Specifies whether the feature's state is overridden by |field_trial|.
242 // singleton feature list that is being registered.
245 // Returns whether the given |feature| is enabled. This is invoked by the
248 bool IsFeatureEnabled(const Feature& feature);
250 // Returns the field trial associated with the given |feature|. This is
254 base::FieldTrial* GetAssociatedFieldTrial(const Feature& feature);
256 // For each feature name in comma-separated list of strings |feature_list|,
263 // Registers an override for feature |feature_name|. The override specifies
264 // whether the feature should be on or off (via |overridden_state|), which
265 // will take precedence over the feature's default state. If |field_trial| is
267 // the feature, which will activate the field trial when the feature state is
268 // queried. If an override is already registered for the given feature, it
281 // Verifies that there's only a single definition of a Feature struct for a
282 // given feature name. Keeps track of the first seen Feature struct for each
283 // feature. Returns false when called on a Feature struct with a different
284 // address than the first one it saw for that feature name. Used only from
286 bool CheckFeatureIdentity(const Feature& feature);
288 // Map from feature name to an OverrideEntry struct for the feature, if it
292 // Locked map that keeps track of seen features, to ensure a single feature is
296 std::map<std::string, const Feature*> feature_identity_tracker_;