Re: Resource timing buffer

It seems that the logic described in section 4.4 does not prevent from
missing RT events:

1. If resource timing buffer current size is less than resource timing
buffer size limit, run the following substeps:
   a. Add new entry to the performance entry buffer.
   b. increase resource timing buffer current size by 1.
2. Otherwise, if the resource timing buffer full flag is false, run the
following substeps:
   a. fire a simple event named resourcetimingbufferfull at the Document,
with its bubbles attribute initialized to true, and has no default action.
   b. set the resource timing buffer full flag to true.

Algorithm should include saving of current RT entry:

1. If resource timing buffer current size is less than resource timing
buffer size limit-1, run the following substeps:
   a. Add new entry to the performance entry buffer.
   b. increase resource timing buffer current size by 1.
2. Otherwise, if the resource timing buffer full flag is false, run the
following substeps:
   a. Add new entry to the performance entry buffer.
   b. fire a simple event named resourcetimingbufferfull at the Document,
with its bubbles attribute initialized to true, and has no default action.
   c. set the resource timing buffer full flag to true.

Even simplier way:

1. If resource timing buffer current size is less than resource timing
buffer size limit, run the following substeps:
   a. Add new entry to the performance entry buffer.
   b. increase resource timing buffer current size by 1.
   c. If resource timing buffer current size is equal or greater than
resource timing buffer size limit and the resource timing buffer full flag
is false, run the following substeps:
   c1. set the resource timing buffer full flag to true.
   c2. fire a simple event named resourcetimingbufferfull at the Document,
with its bubbles attribute initialized to true, and has no default action.

And another way:
Not to change the algorythm, but to add current RT entry into arguments of
event function, so the developer gets at least one lost entry inside
callback.


Solt

Received on Wednesday, 7 March 2018 12:17:01 UTC