Skip to content

Commit

Permalink
minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
csharrison committed Jun 22, 2023
1 parent 160bccf commit 0d23885
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1602,29 +1602,38 @@ a [=moment=] |sourceTime|, and a [=duration=] |eventReportWindow|:
1. Let |lastEnd| be |deadline|.
1. Return |windows|.

To <dfn>parse report windows</dfn> given an [=ordered map=] |map| and a [=list=] [=event-level report windows=] |default|:
To <dfn>parse report windows</dfn> given an [=ordered map=] |map|, a [=moment=] |sourceTime|,
and a [=list=] [=event-level report windows=] |default|:

1. Let |defaultEnd| be the [=event-level report window/end=] of the last element of |default|.
1. If |map|["`event_report_windows`"] does not [=map/exist=], return |default|.
1. Let |values| be |map|["`event_report_windows`"].
1. If |values| is not a [=map=], return null.
1. Let |start| be 0.
1. If |values| is not a [=map=], return error.
1. Let |startTime| be |sourceTime|.
1. If |values|["`start_time`"] [=map/exists=]:
1. Set |start| to the result of applying the <a spec="html">rules for parsing integers</a> with |values|["`start_time`"].
1. If |values|["`end_times`"] does not [=map/exist=], return null.
1. If |start| is an error, return error.
1. Set |startTime| to be |start| seconds.
1. If |startTime| is greater than |defaultEnd|, return error.
1. If |values|["`end_times`"] does not [=map/exist=], return error.
1. Let |endTimes| be |values|["`end_times`"].
1. If the [=list/size=] of |endTimes| is greater than 5, return null.
1. If the [=list/size=] of |endTimes| is greater than 5, return error.
1. Let |windows| be an [=list/is empty=] [=list=].
1. [=list/iterate|For each=] |elt| of |values|:
1. Let |end| be the result of applying the <a spec="html">rules for parsing integers</a> to |elt|.
1. If |end| <= |start|, return null.
1. If |end| is an error, return error
1. Let |endTime| be |end| seconds.
1. If |endTime| is greater than |defaultEnd|, set |end| to |defaultEnd|.
1. If |endTime| <= |start|, return error.
1. Let |window| be a new [=event-level report window=] whose items are

: [=event-level report window/start=]
:: |start|
:: |startTime|
: [=event-level report window/end=]
:: |end|
:: |endTime|

1. [=list/append=] |window| to |windows|.
1. Set |start| to |end|.
1. Set |startTime| to |endTime|.
1. Return |windows|

To <dfn noexport>parse source-registration JSON</dfn> given a [=byte sequence=]
Expand Down Expand Up @@ -1673,6 +1682,7 @@ To <dfn noexport>parse source-registration JSON</dfn> given a [=byte sequence=]
1. Let |maxAttributionsPerSource| be the result of running
[=parse an optional 64-bit signed integer=] with |value|, "`max_event_level_reports`", and
[=default event-level attributions per source=][|sourceType|].
1. If |maxAttributionsPerSource| is an error, return null.
1. If |maxAttributionsPerSource| is greater than 20, return null.
1. Let |eventReportWindow| be the result of running [=parse an expiry=] with
|value|, "`event_report_window`", and |expiry|.
Expand All @@ -1684,8 +1694,10 @@ To <dfn noexport>parse source-registration JSON</dfn> given a [=byte sequence=]
1. If |value|["`debug_reporting`"] [=map/exists=] and is a [=boolean=], set
|debugReportingEnabled| to |value|["`debug_reporting`"].

1. Let |defaultEventReportWindows| be the result of [=obtaining default effective windows=] given |sourceType|, |sourceTime|, and |eventReportWindow|.
1. Let |eventReportWindows| be the result of [=parsing report windows=] with |value|, |defaultEventReportWindows|.
1. Let |eventReportWindows| be the result of [=obtaining default effective windows=] given |sourceType|, |sourceTime|, and |eventReportWindow|.
1. If |value|["`event_report_window`"] does not [=map/exist=]:
1. Let |eventReportWindows| be the result of [=parsing report windows=] with |value|, |sourceTime|, and |eventReportWindows|.
1. If |eventReportWindows| is an error, return null.

1. Let |randomizedResponseConfig| be a new [=randomized response output configuration=] whose items are:

Expand Down

0 comments on commit 0d23885

Please sign in to comment.