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