Skip to content

Commit 7122d3f

Browse files
committed
Limit reporting api under saveData
1 parent 77f637b commit 7122d3f

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

index.src.html

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ <h1>Reporting API</h1>
129129
text: session; url: dfn-session
130130
text: success; url: dfn-success
131131
text: trying; url: dfn-try
132+
spec: netinfo; urlPrefix: https://wicg.github.io/netinfo
133+
type: dfn
134+
text: saveData; url: savedata-attribute
132135
</pre>
133136
<pre class="biblio">
134137
{
@@ -651,15 +654,8 @@ <h3 id="queue-report" algorithm>
651654
(|endpoint group|), an <a>environment settings object</a> (|settings|), and an
652655
optional {{URL}} (|url|), the following algorithm will create a <a>report</a>,
653656
and add it to <a>reporting cache</a>'s queue for future delivery.
654-
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.
661657

662-
3. Let |report| be a new <a>report</a> object with its values initialized as
658+
1. Let |report| be a new <a>report</a> object with its values initialized as
663659
follows:
664660

665661
: [=report/body=]
@@ -675,22 +671,30 @@ <h3 id="queue-report" algorithm>
675671
: [=report/attempts=]
676672
:: 0
677673

678-
4. If |url| was not provided by the caller, let |url| be |settings|'s
674+
2. Let |environment| be |settings|'s <a>realm execution context</a>'s
675+
<a spec=ecmascript>realm</a>'s <a spec=ecmascript lt=realm>ECMAScript
676+
global environment</a>.
677+
678+
3. Execute [[#notify-observers]] with |environment| and |report|.
679+
680+
4. If |settings|'s <a>report count</a> contains an entry
681+
with <a spec=infra>key</a> |type|, then increment that entry. Otherwise,
682+
create an entry in |settings|'s <a>report count</a>
683+
with <a spec=infra>key</a> |type| and <a spec=infra>value</a> 1.
684+
685+
5. If |settings|'s <a>report count</a>[|type|] is greater than 100 and the
686+
current <a spec="netinfo">saveData</a> preference is true, return.
687+
688+
6. If |url| was not provided by the caller, let |url| be |settings|'s
679689
<a>creation URL</a>.
680690

681-
5. Set |url|'s {{URL/username}} to the empty string, and its {{URL/password}}
691+
7. Set |url|'s {{URL/username}} to the empty string, and its {{URL/password}}
682692
to `null`.
683693

684-
6. Set |report|'s [=report/url=] to the result of executing the <a>URL
694+
8. Set |report|'s [=report/url=] to the result of executing the <a>URL
685695
serializer</a> on |url| with the <em>exclude fragment flag</em> set.
686696

687-
7. Append |report| to the <a>reporting cache</a>.
688-
689-
8. Let |environment| be |settings|'s <a>realm execution context</a>'s
690-
<a spec=ecmascript>realm</a>'s <a spec=ecmascript lt=realm>ECMAScript
691-
global environment</a>.
692-
693-
9. Execute [[#notify-observers]] with |environment| and |report|.
697+
9. Append |report| to the <a>reporting cache</a>.
694698

695699
Note: <a>reporting observers</a> can only observe reports from the
696700
same <a>environment settings object</a>.

0 commit comments

Comments
 (0)