@@ -639,6 +639,13 @@ <h3 id="media-type">Media Type</h3>
639
639
The media type used when POSTing reports to a specified endpoint is
640
640
`application/reports+json`.
641
641
642
+ < h3 id ="report-count "> Report Count</ h3 >
643
+
644
+ Each < a > environment settings object</ a > has a < dfn > report count</ dfn > , which
645
+ is a < a spec =infra > map</ a > from < a > report type</ a > (string) to non-negative
646
+ integer. < a > report count</ a > is used to track how many < a > reports</ a > of
647
+ each < a > report type</ a > have been generated in the current page.
648
+
642
649
< h3 id ="queue-report " algorithm >
643
650
Queue |data| as |type| for |endpoint group| on |settings|
644
651
</ h3 >
@@ -648,7 +655,14 @@ <h3 id="queue-report" algorithm>
648
655
optional {{URL}} (|url|), the following algorithm will create a < a > report</ a > ,
649
656
and add it to < a > reporting cache</ a > 's queue for future delivery.
650
657
651
- 1. Let |report| be a new < a > report</ a > object with its values initialized as
658
+ 1. If |settings|'s < a > report count</ a > contains an entry
659
+ with < a spec =infra > key</ a > |type|, then increment that entry. Otherwise,
660
+ create an entry in |settings|'s < a > report count</ a >
661
+ with < a spec =infra > key</ a > |type| and < a spec =infra > value</ a > 1.
662
+
663
+ 2. If |settings|'s < a > report count</ a > [|type|] is greater than 100, return.
664
+
665
+ 3. Let |report| be a new < a > report</ a > object with its values initialized as
652
666
follows:
653
667
654
668
: [=report/body=]
@@ -664,22 +678,22 @@ <h3 id="queue-report" algorithm>
664
678
: [=report/attempts=]
665
679
:: 0
666
680
667
- 2 . If |url| was not provided by the caller, let |url| be |settings|'s
681
+ 4 . If |url| was not provided by the caller, let |url| be |settings|'s
668
682
< a > creation URL</ a > .
669
683
670
- 3 . Set |url|'s {{URL/username}} to the empty string, and its {{URL/password}}
684
+ 5 . Set |url|'s {{URL/username}} to the empty string, and its {{URL/password}}
671
685
to `null`.
672
686
673
- 4 . Set |report|'s [=report/url=] to the result of executing the < a > URL
687
+ 6 . Set |report|'s [=report/url=] to the result of executing the < a > URL
674
688
serializer</ a > on |url| with the < em > exclude fragment flag</ em > set.
675
689
676
- 5 . Append |report| to the < a > reporting cache</ a > .
690
+ 7 . Append |report| to the < a > reporting cache</ a > .
677
691
678
- 6 . Let |environment| be |settings|'s < a > realm execution context</ a > 's
692
+ 8 . Let |environment| be |settings|'s < a > realm execution context</ a > 's
679
693
< a spec =ecmascript > realm</ a > 's < a spec =ecmascript lt =realm > ECMAScript
680
694
global environment</ a > .
681
695
682
- 7 . Execute [[#notify-observers]] with |environment| and |report|.
696
+ 9 . Execute [[#notify-observers]] with |environment| and |report|.
683
697
684
698
Note: < a > reporting observers</ a > can only observe reports from the
685
699
same < a > environment settings object</ a > .
0 commit comments