diff --git a/index.src.html b/index.src.html index fda2cad..3dd32f7 100644 --- a/index.src.html +++ b/index.src.html @@ -129,6 +129,9 @@
{ @@ -636,6 +639,13 @@Media Type
The media type used when POSTing reports to a specified endpoint is `application/reports+json`. +Report Count
+ + Each environment settings object has a report count, which + is a map from report type (string) to non-negative + integer. report count is used to track how many reports of + each report type have been generated in the current page. +Queue |data| as |type| for |endpoint group| on |settings|
@@ -644,7 +654,7 @@(|endpoint group|), an environment settings object (|settings|), and an optional {{URL}} (|url|), the following algorithm will create a report, and add it to reporting cache's queue for future delivery. - + 1. Let |report| be a new report object with its values initialized as follows: @@ -661,22 +671,30 @@
: [=report/attempts=] :: 0 - 2. If |url| was not provided by the caller, let |url| be |settings|'s + 2. Let |environment| be |settings|'s realm execution context's + realm's ECMAScript + global environment. + + 3. Execute [[#notify-observers]] with |environment| and |report|. + + 4. If |settings|'s report count contains an entry + with key |type|, then increment that entry. Otherwise, + create an entry in |settings|'s report count + with key |type| and value 1. + + 5. If |settings|'s report count[|type|] is greater than 100 and the + current saveData preference is true, return. + + 6. If |url| was not provided by the caller, let |url| be |settings|'s creation URL. - 3. Set |url|'s {{URL/username}} to the empty string, and its {{URL/password}} + 7. Set |url|'s {{URL/username}} to the empty string, and its {{URL/password}} to `null`. - 4. Set |report|'s [=report/url=] to the result of executing the URL + 8. Set |report|'s [=report/url=] to the result of executing the URL serializer on |url| with the exclude fragment flag set. - 5. Append |report| to the reporting cache. - - 6. Let |environment| be |settings|'s realm execution context's - realm's ECMAScript - global environment. - - 7. Execute [[#notify-observers]] with |environment| and |report|. + 9. Append |report| to the reporting cache. Note: reporting observers can only observe reports from the same environment settings object.