Skip to content

Commit

Permalink
fixup! Spec: Define per-context contribution limits
Browse files Browse the repository at this point in the history
  • Loading branch information
dmcardle committed Jan 7, 2025
1 parent c0e5bf4 commit ff6bee4
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,8 @@ steps. They return a [=boolean=]:
not null, return true.
1. If |preSpecifiedParams|' [=pre-specified report parameters/filtering ID max
bytes=] is not the [=default filtering ID max bytes=], return true.
1. If |preSpecifiedParams|' [=pre-specified report parameters/requested max
contributions=] is not null, return true.
1. Return false.

Note: If a context ID or non-default filtering ID max bytes was specified, a
Expand Down Expand Up @@ -735,8 +737,8 @@ null |timeout|:
1. [=iteration/Break=].
1. If |hasProcessedContribution| is false, [=list/append=] |contribution| to
|mergedContributions|.
1. Let |effectiveMaxContributions| be the result of [=determining the effective
max contributions=] with |preSpecifiedParams| and |api|.
1. Let |effectiveMaxContributions| be the result of [=determining the max
contributions=] with |preSpecifiedParams| and |api|.
1. Let |truncatedContributions| be a new [=list=].
1. If |mergedContributions| has a [=list/size=] greater than
|effectiveMaxContributions|:
Expand Down Expand Up @@ -819,7 +821,7 @@ perform the following steps. They return an [=aggregatable report=].
:: |preSpecifiedParams|' [=pre-specified report parameters/filtering ID max
bytes=]
: [=aggregatable report/max contributions=]
:: The result of [=determining the effective max contributions=] with
:: The result of [=determining the max contributions=] with
|preSpecifiedParams| and |api|.
: [=aggregatable report/queued=]
:: false
Expand All @@ -844,14 +846,14 @@ They return a [=moment=].
</div>

<div algorithm>
To <dfn>determine the effective max contributions</dfn> given a [=pre-specified
report parameters=] |preSpecifiedParams| and a [=context type=] |api|, perform
the following steps. They return a positive integer that is [=set/contained=] in
the [=valid maxContributions range=].
1. Let |defaultMaxContributions| be [=default maxContributions by API=][|api|].
To <dfn>determine the max contributions</dfn> given a [=pre-specified report
parameters=] |preSpecifiedParams| and a [=context type=] |api|, perform the
following steps. They return a positive integer that is [=set/contained=] in the
[=valid maxContributions range=].
1. Let |requestedMaxContributions| be |preSpecifiedParams|' [=pre-specified
report parameters/requested max contributions=].
1. If |requestedMaxContributions| is null, return |defaultMaxContributions|.
1. If |requestedMaxContributions| is null, return [=default maxContributions by
API=][|api|].
1. If |requestedMaxContributions| is greater than [=maximum maxContributions=],
return [=maximum maxContributions=].
1. Return |requestedMaxContributions|.
Expand Down

0 comments on commit ff6bee4

Please sign in to comment.