Skip to content

Commit cde2cbc

Browse files
Merge pull request #198 from apasel422/index-check
Reject impressions with histogramIndex >= maximum histogram size
2 parents 44864d3 + 6159fcd commit cde2cbc

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

api.bs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,6 +1338,9 @@ The <dfn method for=Attribution>saveImpression(|options|)</dfn> method steps are
13381338
[=obtain a site|obtaining a site=]
13391339
from |settings|' [=environment settings object/origin=].
13401340
1. Validate the page-supplied API inputs:
1341+
1. If |options|.{{AttributionImpressionOptions/histogramIndex}} is
1342+
greater than or equal to the [=implementation-defined=] [=maximum histogram size=],
1343+
return [=a promise rejected with=] a {{RangeError}} in |realm|.
13411344
1. If |options|.{{AttributionImpressionOptions/lifetimeDays}} is 0,
13421345
return [=a promise rejected with=] a {{RangeError}} in |realm|.
13431346
1. Clamp |options|.{{AttributionImpressionOptions/lifetimeDays}} to
@@ -1452,7 +1455,7 @@ The <dfn method for=Attribution>measureConversion(|options|)</dfn> method steps
14521455
</pre>
14531456
</div>
14541457

1455-
<div algorithm>
1458+
<div algorithm="validate AttributionConversionOptions">
14561459
To <dfn>validate {{AttributionConversionOptions}}</dfn> |options|:
14571460

14581461
1. If <a attribute for=Attribution>aggregationServices</a> does not [=map/exist|contain=]
@@ -1462,7 +1465,9 @@ To <dfn>validate {{AttributionConversionOptions}}</dfn> |options|:
14621465
is less than or equal to 0 or is greater than 4294,
14631466
throw a {{RangeError}}.
14641467
1. If |options|.{{AttributionConversionOptions/histogramSize}}
1465-
is 0 or greater than an [=implementation-defined=] maximum value,
1468+
is 0 or greater than the [=implementation-defined=] <dfn>maximum histogram size</dfn>,
1469+
or is greater than the <dfn ignore>maximum aggregation-service histogram size</dfn>,
1470+
if any, for |options|.{{AttributionConversionOptions/aggregationService}},
14661471
throw a {{RangeError}}.
14671472
1. Switch on the value of |options|.{{AttributionConversionOptions/logic}}:
14681473
<dl class="switch">

0 commit comments

Comments
 (0)