Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 31e5c7e

Browse files
committedSep 11, 2024
Use increasing integers instead of unique strings for internal IDs
This will make it easier to address WICG#1405, but is beneficial in itself because it indicates the scope of the uniqueness that was previously implicit for strings.
1 parent 21d1eee commit 31e5c7e

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed
 

‎index.bs

+13-7
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ An attribution source is a [=struct=] with the following items:
790790

791791
<dl dfn-for="attribution source">
792792
: <dfn>internal ID</dfn>
793-
:: A [=string=].
793+
:: An [=internal ID=].
794794
: <dfn>source origin</dfn>
795795
:: A [=suitable origin=].
796796
: <dfn>event ID</dfn>
@@ -1011,7 +1011,7 @@ An attribution report is a [=struct=] with the following items:
10111011
: <dfn>external ID</dfn>
10121012
:: A UUID formatted as a [=string=].
10131013
: <dfn>internal ID</dfn>
1014-
:: A [=string=].
1014+
:: An [=internal ID=].
10151015

10161016
</dl>
10171017

@@ -1302,6 +1302,12 @@ shared among all [=environment settings objects=].
13021302
Note: This would ideally use <a spec=storage>storage bottles</a> to provide access to the attribution caches.
13031303
However attribution data is inherently cross-site, and operations on storage would need to span across all storage bottle maps.
13041304

1305+
An <dfn>internal ID</dfn> is an integer.
1306+
1307+
To <dfn>get the next internal ID</dfn>, return an [=internal ID=] strictly
1308+
greater than any previously returned by this algorithm. The user agent MAY reset
1309+
this sequence when no [=attribution cache=] entry contains an [=internal ID=].
1310+
13051311
# Constants # {#constants}
13061312

13071313
<dfn>Valid source expiry range</dfn> is a 2-tuple of positive [=durations=] that controls the
@@ -2273,7 +2279,7 @@ an [=aggregation coordinator=] |aggregationCoordinator|, and a [=moment=] |now|:
22732279
: [=aggregatable debug report/external ID=]
22742280
:: The result of [=generating a random UUID=]
22752281
: [=aggregatable debug report/internal ID=]
2276-
:: A new unique [=string=]
2282+
:: The result of [=getting the next internal ID=]
22772283
: [=aggregatable debug report/contributions=]
22782284
:: |contributions|
22792285
: [=aggregatable debug report/aggregation coordinator=]
@@ -2804,7 +2810,7 @@ To <dfn noexport>parse source-registration JSON</dfn> given a [=byte sequence=]
28042810
1. Let |source| be a new [=attribution source=] struct whose items are:
28052811

28062812
: [=attribution source/internal ID=]
2807-
:: A new unique [=string=]
2813+
:: The result of [=getting the next internal ID=]
28082814
: [=attribution source/source origin=]
28092815
:: |sourceOrigin|
28102816
: [=attribution source/event ID=]
@@ -4400,7 +4406,7 @@ a 64-bit integer priority |priority|, and a [=trigger spec map=] [=map/entry=]
44004406
: [=event-level report/external ID=]
44014407
:: The result of [=generating a random UUID=].
44024408
: [=event-level report/internal ID=]
4403-
:: A new unique [=string=]
4409+
:: The result of [=getting the next internal ID=]
44044410
: [=event-level report/attribution debug info=]
44054411
:: (|source|'s [=attribution source/debug key=], |triggerDebugKey|).
44064412
1. Return |report|.
@@ -4430,7 +4436,7 @@ an [=attribution trigger=] |trigger|:
44304436
: [=aggregatable attribution report/external ID=]
44314437
:: The result of [=generating a random UUID=].
44324438
: [=aggregatable attribution report/internal ID=]
4433-
: A new unique [=string=]
4439+
:: The result of [=getting the next internal ID=]
44344440
: [=aggregatable attribution report/attribution debug info=]
44354441
:: (|source|'s [=attribution source/debug key=], |trigger|'s [=attribution trigger/debug key=]).
44364442
: [=aggregatable attribution report/contributions=]
@@ -4465,7 +4471,7 @@ To <dfn>obtain a null attribution report</dfn> given an [=attribution trigger=]
44654471
: [=aggregatable attribution report/external ID=]
44664472
:: The result of [=generating a random UUID=]
44674473
: [=aggregatable attribution report/internal ID=]
4468-
: A new unique [=string=]
4474+
:: The result of [=getting the next internal ID=]
44694475
: [=aggregatable attribution report/attribution debug info=]
44704476
:: (null, |trigger|'s [=attribution trigger/debug key=])
44714477
: [=aggregatable attribution report/contributions=]

0 commit comments

Comments
 (0)
Please sign in to comment.