From ea3cbca065016fa6c2d5754ea31d64c1e5397fe5 Mon Sep 17 00:00:00 2001 From: Ilya Grigorik Date: Thu, 12 Mar 2015 07:50:18 -0700 Subject: [PATCH 1/4] first run at workerStart attribute - optional attribute because SW support is not (yet) universal - missing registration results in zero value (i.e. SW not used) - set to time when worker is run or fetch is fired at worker --- index.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 9c9092d..f247cea 100644 --- a/index.html +++ b/index.html @@ -356,6 +356,9 @@

The PerformanceResourceTiming Interface

Note that this attribute is intended to identify the network protocol in use for the fetch regardless of how it was actually negotiated; that is, even if ALPN is not used to negotiate the network protocol, this attribute still uses the ALPN Protocol ID's to indicate the protocol in use.

+
readonly attribute DOMHighResTimeStamp workerStart
+
This attribute is optional. User agents that don't have this attribute available must set it as undefined. When this attribute is supported and the current browsing or worker context's have an active worker ([[!SERVICE-WORKERS]]), it MUST return the time immediately before the user agent runs the worker required to service the request, or if the worker is available, the time immediately before the user agent fires an event named `fetch` at the active worker. Otherwise, if there is no active worker this attribute MUST return zero.
+
readonly attribute DOMHighResTimeStamp redirectStart

If there are HTTP redirects or equivalent @@ -692,8 +695,9 @@

Processing Model

  • Record the initiator of the resource in initiatorType.
  • -
  • Record the resolved URL of the requested resource in name. -
  • + +
  • Record the resolved URL of the requested resource in name. If there is an active worker ([[!SERVICE-WORKERS]]) matching the current browsing or worker context's, immediately before the user agent runs the worker record the time as workerStart, or if the worker is available, immediately before the event named `fetch` is fired at the active worker record the time as workerStart. Otherwise, if workerStart attribute is supported but there is no matching service worker registration, set the value to zero.
  • +
  • If the new resource is to be fetched using HTTP GET or equivalent, immediately before a user agent checks with the From b604b3b75f6ad9e7cec5260e968817c030e33282 Mon Sep 17 00:00:00 2001 From: Ilya Grigorik Date: Thu, 12 Mar 2015 07:58:37 -0700 Subject: [PATCH 2/4] drop HTTP GET clause in processing Unnecessary restriction and application cache check is covered by the "fetching process" algorithm already. --- index.html | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/index.html b/index.html index f247cea..1334a6c 100644 --- a/index.html +++ b/index.html @@ -698,19 +698,8 @@

    Processing Model

  • Record the resolved URL of the requested resource in name. If there is an active worker ([[!SERVICE-WORKERS]]) matching the current browsing or worker context's, immediately before the user agent runs the worker record the time as workerStart, or if the worker is available, immediately before the event named `fetch` is fired at the active worker record the time as workerStart. Otherwise, if workerStart attribute is supported but there is no matching service worker registration, set the value to zero.
  • -
  • If the new resource is to be fetched using HTTP GET or - equivalent, - immediately before a user agent checks with the - relevant application caches, record the current time as fetchStart. Otherwise, immediately - before a user agent starts the - fetching process, record the current time as - fetchStart. Let - domainLookupStart, - domainLookupEnd, - connectStart and - connectEnd be the same value as - fetchStart. -
  • +
  • Immediately before a user agent starts the fetching process, record the current time as fetchStart. Let domainLookupStart, domainLookupEnd, connectStart and connectEnd be the same value as fetchStart.
  • +
  • If the user agent is to reuse the data from another existing or completed fetch initiated from the current document, abort the remaining steps.
  • From 70adbb3c1ba5dde5d6c4c952bbc2c1cb3b448a77 Mon Sep 17 00:00:00 2001 From: Ilya Grigorik Date: Thu, 12 Mar 2015 08:03:33 -0700 Subject: [PATCH 3/4] clarify: set workerStart to zero --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 1334a6c..a855a20 100644 --- a/index.html +++ b/index.html @@ -696,7 +696,7 @@

    Processing Model

  • Record the initiator of the resource in initiatorType.
  • -
  • Record the resolved URL of the requested resource in name. If there is an active worker ([[!SERVICE-WORKERS]]) matching the current browsing or worker context's, immediately before the user agent runs the worker record the time as workerStart, or if the worker is available, immediately before the event named `fetch` is fired at the active worker record the time as workerStart. Otherwise, if workerStart attribute is supported but there is no matching service worker registration, set the value to zero.
  • +
  • Record the resolved URL of the requested resource in name. If there is an active worker ([[!SERVICE-WORKERS]]) matching the current browsing or worker context's, immediately before the user agent runs the worker record the time as workerStart, or if the worker is available, immediately before the event named `fetch` is fired at the active worker record the time as workerStart. Otherwise, if workerStart attribute is supported but there is no matching service worker registration, set workerStart value to zero.
  • Immediately before a user agent starts the fetching process, record the current time as fetchStart. Let domainLookupStart, domainLookupEnd, connectStart and connectEnd be the same value as fetchStart.
  • From 9b63c9a0b84296c471cd7250848eb0a880c348a1 Mon Sep 17 00:00:00 2001 From: Ilya Grigorik Date: Thu, 26 Mar 2015 10:49:11 -0700 Subject: [PATCH 4/4] drop optional on workerStart --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index a855a20..daa4024 100644 --- a/index.html +++ b/index.html @@ -357,7 +357,7 @@

    The PerformanceResourceTiming Interface

    readonly attribute DOMHighResTimeStamp workerStart
    -
    This attribute is optional. User agents that don't have this attribute available must set it as undefined. When this attribute is supported and the current browsing or worker context's have an active worker ([[!SERVICE-WORKERS]]), it MUST return the time immediately before the user agent runs the worker required to service the request, or if the worker is available, the time immediately before the user agent fires an event named `fetch` at the active worker. Otherwise, if there is no active worker this attribute MUST return zero.
    +
    If the current browsing or worker context's have an active worker ([[!SERVICE-WORKERS]]), this atribute MUST return the time immediately before the user agent runs the worker required to service the request, or if the worker is available, the time immediately before the user agent fires an event named `fetch` at the active worker. Otherwise, if there is no active worker this attribute MUST return zero.
    readonly attribute DOMHighResTimeStamp redirectStart
    @@ -696,7 +696,7 @@

    Processing Model

  • Record the initiator of the resource in initiatorType.
  • -
  • Record the resolved URL of the requested resource in name. If there is an active worker ([[!SERVICE-WORKERS]]) matching the current browsing or worker context's, immediately before the user agent runs the worker record the time as workerStart, or if the worker is available, immediately before the event named `fetch` is fired at the active worker record the time as workerStart. Otherwise, if workerStart attribute is supported but there is no matching service worker registration, set workerStart value to zero.
  • +
  • Record the resolved URL of the requested resource in name. If there is an active worker ([[!SERVICE-WORKERS]]) matching the current browsing or worker context's, immediately before the user agent runs the worker record the time as workerStart, or if the worker is already available, immediately before the event named `fetch` is fired at the active worker record the time as workerStart. Otherwise, if there is no matching service worker registration, set workerStart value to zero.
  • Immediately before a user agent starts the fetching process, record the current time as fetchStart. Let domainLookupStart, domainLookupEnd, connectStart and connectEnd be the same value as fetchStart.