File: featured.proto

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (126 lines) | stat: -rw-r--r-- 5,211 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
// Copyright 2022 The ChromiumOS Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

syntax = "proto3";

option optimize_for = LITE_RUNTIME;

// This file defines messages necessary for early boot experimentation
package featured;

option go_package = "go.chromium.org/chromiumos/system_api/featured_proto";

// Defines the key and value of a feature's parameter.
message Param {
  // Key of an experiment's parameter.
  string key = 1;
  // Value of an experiment's parameter.
  string value = 2;
}

// Specifies whether a feature override enables or disables the feature. This
// enum is based off the OverrideState enum in chromium's base/feature_list.h.
enum OverrideState {
  OVERRIDE_USE_DEFAULT = 0;
  OVERRIDE_DISABLE_FEATURE = 1;
  OVERRIDE_ENABLE_FEATURE = 2;
}

// Defines a chrome://flags entry that can override a feature's state determined
// by the evaluate_seed binary.
message FeatureOverride {
  // Name of the feature, always starting with "CrOSEarlyBoot"
  string name = 1;
  // True if the feature is enabled, and false otherwise.
  // NOTE: This field is *deprecated* and will eventually be replaced by the
  // |override_state| field. This field will be deleted after all existing
  // references to it are removed. Future code should *not* use this field.
  bool enabled = 2;
  // If the feature is enabled AND has parameters associated with it,
  // they'll appear here.
  repeated Param params = 3;
  // Name of the field trial (study).
  string trial_name = 4;
  // Name of the experiment group the device is enrolled in.
  string group_name = 5;
  // A tri-state value indicating if the feature is enabled, disabled, or uses
  // default state.
  OverrideState override_state = 6;
}

// Information about the last known "safe" seed.
// Keep in sync with featured::SeedsEqual when adding new fields.
message SeedDetails {
  // The active client locale that was successfully used in association with the
  // last known "safe" seed.
  string locale = 4;
  // Milestone with which the last known "safe" seed was fetched.
  int32 milestone = 5;
  // String form of pair <Chrome version string, country code string> (eg.
  // "106.0.5249.119,us") representing the country used for filtering permanent
  // consistency studies until the next time Chrome is updated.
  string permanent_consistency_country = 6;
  // A country code string representing the country used for evaluating session
  // consistency studies.
  string session_consistency_country = 7;
  // Base64-encoded digital signature of the last known "safe" seed's binary
  // data. Empty if there is no known "safe" seed.
  string signature = 8;
  // The serialized base::Time used for safe seed expiry checks. This is usually
  // the time at which the last known "safe" seed was received; however, it
  // could be a build timestamp if the received date is unknown. An empty
  // (default-constructed) base::Time if there is no known "safe" seed. This is
  // a server-provided timestamp in milliseconds.
  int64 date = 9;
  // The serialized base::Time from the fetch corresponding to the last known
  // "safe" seed. This is a client timestamp in milliseconds.
  int64 fetch_time = 10;
  // Last known "safe" seed represented as the base64-encoded compressed
  // serialized form of the variations.VariationsSeed protobuf.
  bytes b64_compressed_data = 11;

  // Tags 1, 2, and 3 are reserved since they have been deleted.
  // Tag 1 was the last known "safe" seed represented as the serialized form of
  // the variations.VariationsSeed protobuf. Despite the name, it was
  // decompressed data that came from VariationsSeedStore::LoadSeed.
  // Tags 2 and 3 were used for older versions of the date and fetch_time
  // fields, which were both of type google.protobuf.Timestamp. Importing
  // google.protobuf.Timestamp is not supported in Chromium's
  // third_party/cros_system_api, so both fields were changed to type int64 (the
  // same data type finch protos use for dates).
  reserved 1, 2, 3;
}

// Message containing all the chrome://flags overrides.
message OverridesSet {
  repeated FeatureOverride overrides = 1;
}

// Encapsulates information necessary for platform disaster recovery.
message Store {
  // Number of platform reboots since receiving a Chrome dbus call indicating
  // successful seed fetch.
  uint32 boot_attempts_since_last_seed_update = 1;
  // Data associated with the last known "safe" seed.
  SeedDetails last_good_seed = 2;
  // chrome://flags overrides, as a serialized OverridesSet.
  bytes overrides = 4;
  // HMAC of |overrides|.
  bytes overrides_hmac = 5;

  // The repeated FeatureOverride overrides was a member of this message
  // directly, but we need to wrap it in a message so we can separately
  // serialize and HMAC it.
  reserved 3;
}

// ComputedState is evaluate_seed's output, including both the evaluated state
// of each feature in the seed as well as the seed that was used to generate
// that state.
message ComputedState {
  // Computed state for each experiment in a seed.
  repeated FeatureOverride overrides = 1;
  // Which seed was used to generate the overrides?
  SeedDetails used_seed = 2;
}