• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1syntax = "proto2";
2
3package org.chromium.net.httpflags;
4
5option java_package = "org.chromium.net.httpflags";
6option java_multiple_files = true;
7option optimize_for = LITE_RUNTIME;  // crbug/800281
8
9// Describes a set of overrides for `base::Feature` flags.
10message BaseFeatureOverrides {
11  // Describes the state of a given base::Feature.
12  //
13  // Note that currently this doesn't support customizing the name of the fake
14  // field trial (a.k.a study) and group (a.k.a experiment) that will be
15  // associated with the base::Feature. It is highly unlikely you'd need to do
16  // this, though.
17  message FeatureState {
18    // If set, the feature will be overridden to the enabled state (true) or the
19    // disabled state (false). If unset, the feature state will not be
20    //  overridden.
21    optional bool enabled = 1;
22
23    // The set of Feature Params that will be associated with the feature, as
24    // key-value pairs. (More specifically: the set of params that will be
25    // associated with the "fake" field trial and group that the feature is
26    // associated with.)
27    //
28    // The usual Feature Params APIs will return an empty params map for
29    // disabled features. It is possible to work around this limitation, but
30    // typical code wouldn't, so you almost certainly want to explicitly enable
31    // the feature by setting the `enabled` field above to `true` if you want
32    // this field to have any effect.
33    //
34    // Behind the scenes, feature params are always string-valued, which is why
35    // this map is string-valued as well (actually bytes-valued, to hedge
36    // against the remote possibility that someone might want to stuff binary or
37    // non-UTF-8 data in there). The non-string variants of the
38    // base::FeatureParam API (int, float, etc.) are really just convenience
39    // string parsers.
40    //
41    // The base::FeatureParam API will return the param default value if there
42    // is no entry for the corresponding param name, OR if the value is the
43    // empty string. Crucially, this means it is NOT possible to override a
44    // base::FeatureParam to the empty string. This limitation does not apply to
45    // lower-level APIs such as base::GetFieldTrialParamsByFeature().
46    //
47    // If this field is empty, no param map will be associated with the feature.
48    // Note that this is subtly different from an empty param map as that
49    // affects the return value of low-level APIs such as
50    // base::GetFieldTrialParamsByFeature(). The high-level base::FeatureParam
51    // API will not surface that difference, though. This proto does not
52    // currently provide a way to associate an empty map.
53    map<string, bytes> params = 2;
54  }
55
56  // The key is the name of the base::Feature.
57  map<string, FeatureState> feature_states = 1;
58}
59