diff --git a/index.html b/index.html index ae04d86..c6a5e9a 100644 --- a/index.html +++ b/index.html @@ -119,7 +119,7 @@

Introduction

and be notified of new performance metrics and, optionally, previously buffered performance metrics of specified type, via the PerformanceObserver interface.

-

The PerformanceObserver interface was added +

The PerformanceObserver interface was added and is designed to address limitations of the buffer-based approach shown in the first example. By using the PerformanceObserver interface, the application can:

@@ -247,14 +247,13 @@

Performance Timeline

  • An integer dropped entries count that is initially 0.
  • -
  • An integer last performance entry id that is initially set - to a random integer between 100 and 10000. +
  • An integer current navigation id, which is initially 0.
  • Each Document has:

    In order to get the relevant performance entry tuple, given @@ -314,12 +313,11 @@

    The PerformanceEntry interface

           [Exposed=(Window,Worker)]
           interface PerformanceEntry {
    -        readonly    attribute unsigned long long  id;
             readonly    attribute DOMString           name;
             readonly    attribute DOMString           entryType;
             readonly    attribute DOMHighResTimeStamp startTime;
             readonly    attribute DOMHighResTimeStamp duration;
    -        readonly    attribute unsigned long long  navigationId;
    +        readonly    attribute unsigned long       navigationId;
             [Default] object toJSON();
           };
    @@ -332,9 +330,8 @@

    The PerformanceEntry interface

    This attribute must return the value it is initialized to. -

    All `entryType` values are defined in the - relevantregistry. +

    All `entryType` values are defined in the relevant + registry. Examples include: "mark" and "measure" [[USER-TIMING-2]], "navigation" [[NAVIGATION-TIMING-2]], and "resource" [[RESOURCE-TIMING-2]].

    @@ -684,30 +681,25 @@

    Queue a PerformanceEntry

    To queue a PerformanceEntry (newEntry), run these steps:

      -
    1. If newEntry's {{PerformanceEntry/id}} is unset: -
        -
      1. Let id be the result of running generate an id for newEntry.
      2. -
      3. Set newEntry's {{PerformanceEntry/id}} to id.
      4. -
      -
    2. Let interested observers be an initially empty set of PerformanceObserver objects.
    3. -
    4. Let entryType be newEntry’s Let entryType be newEntry's entryType value.
    5. Let relevantGlobal be newEntry's relevant global object.
    6. -
    7. If relevantGlobal has an [=associated document=]: -
        -
      1. Set newEntry's navigationId to the value of - relevantGlobal's [=associated document=]'s [=most recent navigation=]'s {{PerformanceEntry/id}}.
      2. -
      +
    8. If the PerformanceEntry to be queued is a navigation + entry (in other words, entryType=='navigation'), then + let navigationId be the result of running + generate a navigation id.
    9. -
    10. Otherwise, set newEntry's navigationId to null.
    11. +
    12. Otherwise, let navigationId + be the relevantGlobal’s current navigation id. +
    13. +
    14. Set newEntry's navigationId to navigationId.
    15. For each registered performance observer regObs in relevantGlobal's list of registered performance observer objects:
        @@ -753,25 +745,6 @@

        Queue a PerformanceEntry

      -
      -

      Queue a navigation PerformanceEntry

      -

      To queue a navigation PerformanceEntry (newEntry), run - these steps:

      -
        -
      1. Let id be the result of running generate an id for newEntry.
      2. -
      3. Let relevantGlobal be newEntry's relevant - global object. -
      4. -
      5. Set newEntry's {{PerformanceEntry/id}} to id.
      6. -
      7. Set newEntry's {{PerformanceEntry/navigationId}} to id.
      8. -
      9. If relevantGlobal has an [=associated document=]: -
          -
        1. Set relevantGlobal's [=associated document=]'s [=most recent navigation=] to newEntry.
        2. -
        -
      10. -
      11. Queue a PerformanceEntry with newEntry as input.
      12. -
      -

      Queue the PerformanceObserver task

      When asked to queue the PerformanceObserver task, given @@ -940,26 +913,34 @@

      Determine if a performance entry buffer is full

    -

    Generate a Performance Entry id

    -

    When asked to generate an id for a - PerformanceEntry entry, run the following steps:

    +

    Generate a Navigation id

    +

    When asked to generate a navigation id for a navigation + PerformanceEntry entry, run the following steps:

    1. Let relevantGlobal be entry's relevant - global object. -
    2. Increase relevantGlobal's last performance entry - id by a small number chosen by the user agent.
    3. -
    4. Return relevantGlobal's last performance entry id. + global object. +
    5. Let relevantDoc be relevantGlobal's [=associated document=], or null. +
    6. If relevantGlobal's [=current navigation id=] is 0 (the initial value), + of if relevantDoc is null, + or if relevantDoc is not null and relevantGlobal's + [=current navigation id=] differs from doc's [=current document navigation id=], + then let navigationId be a random integer between 100 and 10000000. +
    7. Otherwise, let navigationId be the sum of relevantGlobal's + [=current navigation id=] and a small integer. +
    8. Set relevantGlobal's [=current navigation id=] to navigationId. +
    9. If relevantDoc is not null, set relevantDoc's [=current document navigation id=] + to navigationId. +
    10. Return navigationId.
    -

    A user agent may choose to increase the last performance entry - idit by a small random integer every time. A user agent must not pick - a single global random integer and increase the last performance entry - id of all global objects by that amount because this could introduce - cross origin leaks. -

    -

    The last performance entry id has an initial random - value, and is increased by a small number chosen by the user agent instead - of 1 to discourage developers from considering it as a counter of the - number of entries that have been generated in the web application.

    +

    Sequences of navigation ids that are associated with + the same document can be used to establish order, by sorting by + navigation id.

    +

    The increcase between same-document navigation ids is + as small number as opposed to 1, to discourage developers from considering + navigation ids as a counter of the number of entries that have been generated + in the web application.

    +

    To avoid integer overflow, the same-document mechanism may revert to assign + a random integer between 10 and 10000000, but this is expected to be extremeley rare.

    @@ -969,8 +950,9 @@

    Privacy Considerations

    refer to [[HR-TIME-3]] for privacy considerations of exposing high-resoluting timing information. Each new specification introducing new performance entries should have its own privacy considerations as well.

    -

    The last performance entry id is deliberately initialized to a +

    The current navigation id is deliberately initialized to a random value, and is incremented by another small value every time a new + navigation {{PerformanceEntry}} is queued. User agents may choose to use a consistent increment for all users, or may pick a different increment for each global object, or may choose a new random increment for each