File: registration.mojom

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 (304 lines) | stat: -rw-r--r-- 10,373 bytes parent folder | download | duplicates (5)
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

module attribution_reporting.mojom;

import "components/attribution_reporting/source_registration_time_config.mojom";
import "components/attribution_reporting/trigger_data_matching.mojom";
import "components/attribution_reporting/debug_types.mojom";
import "mojo/public/mojom/base/int128.mojom";
import "mojo/public/mojom/base/time.mojom";
import "services/network/public/mojom/schemeful_site.mojom";
import "url/mojom/origin.mojom";
import "url/mojom/url.mojom";

// Encapsulates a potentially trustworthy origin. Equivalent to
// attribution_reporting::SuitableOrigin.
struct SuitableOrigin {
  url.mojom.Origin origin;
};

// Filter data for selectively matching attribution sources and triggers.
// See https://github.com/WICG/attribution-reporting-api/blob/main/EVENT.md#optional-attribution-filters
// for details.
struct FilterData {
  // Map of filter name to a possibly empty set of values. Must not contain
  // `source_type` or `_lookback_window` keys.
  map<string, array<string>> filter_values;
};

// Internal structure to support the lookback window implementation.
struct FilterConfig {
  mojo_base.mojom.TimeDelta? lookback_window;
  map<string, array<string>> filter_values;
};

// Filters for selectively matching attribution sources and triggers.
// See https://github.com/WICG/attribution-reporting-api/blob/main/EVENT.md#optional-attribution-filters
// for details.
struct FilterPair {
  // If non-empty, this trigger will be ignored unless the attributed source's
  // filter data matches.
  array<FilterConfig> positive;

  // If non-empty, this trigger will be ignored unless the attributed source's
  // filter data does *NOT* match.
  array<FilterConfig> negative;
};

// See https://github.com/WICG/attribution-reporting-api/blob/main/AGGREGATE.md#attribution-source-registration
// for details.
struct AggregationKeys {
  map<string, mojo_base.mojom.Uint128> keys;
};

// Struct containing the trigger-side aggregatable data.
struct AggregatableTriggerData {
  mojo_base.mojom.Uint128 key_piece;
  array<string> source_keys;
  FilterPair filters;
};

// Target site(s) where a source can be attributed.
struct DestinationSet {
  array<network.mojom.SchemefulSite> destinations;
};

// Reporting configuration that controls the early reporting time windows for a
// source.
struct EventReportWindows {
  mojo_base.mojom.TimeDelta start_time;
  array<mojo_base.mojom.TimeDelta> end_times;
};

// https://wicg.github.io/attribution-reporting-api/#trigger-data-set
struct TriggerDataSet {
  array<uint32> trigger_data;
};

// Aggregatable contribution for aggregatable debug types.
struct AggregatableDebugReportingContribution {
  mojo_base.mojom.Uint128 key_piece;
  uint32 value;
};

// Configuration for aggregatable debug reporting.
struct AggregatableDebugReportingConfig {
  mojo_base.mojom.Uint128 key_piece;
  map<DebugDataType,
      AggregatableDebugReportingContribution> debug_data;
  SuitableOrigin? aggregation_coordinator_origin;
};

// Configuration for source-side aggregatable debug reporting.
struct SourceAggregatableDebugReportingConfig {
  int32 budget;
  AggregatableDebugReportingConfig config;
};

// Target identifiers used for pre-attribution filtering.
struct AttributionScopesSet {
  array<string> scopes;
};

// Configuration for attribution scopes.
struct AttributionScopesData {
  AttributionScopesSet attribution_scopes_set;

  // Represents the number of distinct attribution scopes allowed per
  // destination for a source's reporting origin.
  uint32 attribution_scope_limit;

  // Represents the maximum number of trigger states for an event source type
  // sources per destination for a source's reporting origin.
  uint32 max_event_states;
};

// Defines aggregatable names and their associated budget for a trigger to
// selectively contribute to.
struct AggregatableNamedBudgetDefs {
  map<string, int32> budgets;
};

struct SourceRegistration {
  DestinationSet destinations;

  // Data that will be sent in attribution reports to identify this source.
  uint64 source_event_id = 0;

  // Specifies how long this source is eligible for attribution.
  mojo_base.mojom.TimeDelta expiry;

  TriggerDataSet trigger_data;

  EventReportWindows event_report_windows;

  // Specifies how many event-level reports can be generated across all trigger
  // specs for the source.
  int32 max_event_level_reports;

  // Specifies how long after source registration an aggregatable
  // report can be generated with this source.
  mojo_base.mojom.TimeDelta aggregatable_report_window;

  // Priority for this source.
  int64 priority = 0;

  // A key that is propagated through the Attribution Reporting API for
  // debugging purposes.
  uint64? debug_key;

  FilterData filter_data;

  AggregationKeys aggregation_keys;

  // Specifies whether to enable verbose debug reporting.
  bool debug_reporting = false;

  // Controls how trigger data is matched against the source's trigger specs.
  TriggerDataMatching trigger_data_matching;

  // Controls the epsilon parameter used for obtaining a randomized response for
  // the containing source registration. Must be greater than or equal to 0.
  // https://wicg.github.io/attribution-reporting-api/#obtain-a-randomized-source-response
  double event_level_epsilon;

  // Specifies aggregatable debug reporting configuration.
  SourceAggregatableDebugReportingConfig aggregatable_debug_reporting_config;

  // Specifies the priority of the destination in regards to source destination
  // limit.
  int64 destination_limit_priority;

  // Controls the scopes the source can be attributed to along with the amount
  // limit of scopes and the max number of event states. Logic pertaining to
  // scopes are ignored if this field is null.
  AttributionScopesData? attribution_scopes_data;

  // Specifies how the aggregatable budget should be allocated across specified
  // names for triggers to selectively contribute to.
  AggregatableNamedBudgetDefs aggregatable_named_budget_defs;
};

// Mojo representation of the trigger configuration provided by a reporting
// origin. This data is provided arbitrarily by certain subresources on a
// page which invoke Attribution Reporting.
struct EventTriggerData {
  // Value which identifies this trigger in attribution reports, determined by
  // reporting origin.
  uint64 data = 0;

  // Priority of this trigger relative to other attributed triggers for a
  // source. Reports created with high priority triggers will be reported over
  // lower priority ones.
  int64 priority = 0;

  // Key which allows deduplication against existing attributions for the same
  // source.
  uint64? dedup_key;

  FilterPair filters;
};

struct AggregatableDedupKey {
  // Key which allows deduplication against existing attributions for the same
  // source.
  uint64? dedup_key;

  FilterPair filters;
};

struct AggregatableValuesValue {
  uint32 value;
  uint64 filtering_id;
};

struct AggregatableValues {
  // A map of aggregation key identifier and the corresponding aggregatable
  // values value.
  map<string, AggregatableValuesValue> values;

  FilterPair filters;
};

struct AggregatableNamedBudgetCandidate {
  // Name to allocate budget towards as specified by the source registration. If
  // no name is provided the trigger's contribution will subtract from the total
  // budget.
  string? name;

  FilterPair filters;
};

// Represents a request from a reporting origin to trigger attribution on a
// given site. See:
// https://github.com/WICG/attribution-reporting-api/blob/main/EVENT.md#triggering-attribution
struct TriggerRegistration {
  // List of all event trigger data objects declared by the event trigger
  // header. This data is arbitrarily set by the reporting origin.
  array<EventTriggerData> event_triggers;

  FilterPair filters;

  // List of all aggregatable trigger data objects declared by the trigger
  // header.
  array<AggregatableTriggerData> aggregatable_trigger_data;

  // List of all aggregatable values for matching a contribution value with a
  // source's aggregation key.
  array<AggregatableValues> aggregatable_values;

  // A key that is propagated through the Attribution Reporting API for
  // debugging purposes.
  uint64? debug_key;

  // List of all aggregatable dedup keys for deduplication against existing
  // aggregatable reports for the same source.
  array<AggregatableDedupKey> aggregatable_dedup_keys;

  // Specifies whether to enable verbose debug reporting.
  bool debug_reporting = false;

  // Specifies the deployment option for the aggregation service. The default
  // deployment will be used if not set.
  SuitableOrigin? aggregation_coordinator_origin;

  // Specifies whether to include source registration time in aggregatable
  // reports.
  SourceRegistrationTimeConfig source_registration_time_config;

  // Specifies the context ID associated with the trigger. The context ID
  // cannot be empty or longer than 64 bytes.
  string? trigger_context_id;

  // Specifies the maximum size of filtering ids within `aggregatable_values`.
  uint8 aggregatable_filtering_id_max_bytes;

  // Specifies the aggregatable debug reporting configuration.
  AggregatableDebugReportingConfig aggregatable_debug_reporting_config;

  // Specifies the scopes that this trigger can attribute to.
  AttributionScopesSet attribution_scopes;

  // List of all aggregatable named budgets for matching with source side
  // budgets to contribute to.
  array<AggregatableNamedBudgetCandidate> aggregatable_named_budget_candidates;
};

// Represents a source or trigger registration item that will be passed to the OS, if supported.
struct OsRegistrationItem {
  // The URL to which the OS will make a request in order to retrieve the actual
  // source or trigger registration.
  url.mojom.Url url;
  // Specifies whether to enable verbose debug reporting.
  bool debug_reporting;
};

// Represents a source or trigger registration that will be passed to the OS, if supported.
// A registration may contain multiple registration items.
struct OsRegistration {
  // The registrations to which the OS will make a request in order to retrieve the actual
  // source or trigger registration.
  array<OsRegistrationItem> items;
};