Re: [whatwg/fetch] Initial resource timing integration. (#1185)

@yoavweiss commented on this pull request.



> +  <dt><dfn for="fetch timing info">response end time</dfn> (default zero)
+  <dd>A <a for=/>DOMHighResTimeStamp</a>
+  <dt><dfn for="fetch timing info">worker start time</dfn> (default zero)
+  <dd>A <a for=/>DOMHighResTimeStamp</a>
+  <dt><dfn for="fetch timing info">transfer size</dfn> (default zero)
+  <dd>A number.
+  <dt><dfn for="fetch timing info">encoded body size</dfn> (default zero)
+  <dd>A number.
+  <dt><dfn for="fetch timing info">decoded body size</dfn> (default zero)
+  <dd>A number.
+  <dt><dfn for="fetch timing info">connection timing info</dfn> (default null)
+  <dd>A <a for=/>connection timing info</a>.
+</dl>
+
+<p>A <dfn>connection timing info</dfn> is a <a for=/>struct</a> used to maintain timing information
+pretaining to the process of obtaining a connection. It has the following <a for=struct>items</a>:

s/pretaining/pertaining/

>  </ol>
 
+<h3 id=fetch-report-resource-timing>Report Resource Timing</h3>
+<p>To <dfn>report resource timing</dfn>, given <a for=/>fetch params</a> <var>fetchParams</var> and <a for=/>response</a>
+<var>response</var>, perform the following steps:
+<ol>
+  <li>Let <var>globalObject</var> be <var>fetchParams</var>'s <a for="fetch params">request</a>'s
+  <a for=request>client</a>'s <a for="environment settings object">global object</a>.
+  <li>Let <var>timingInfo</var> be <var>fetchParams</var>'s <a for="fetch params">timing info</a>.
+  <li>Let <var>requestedURL</var> be <var>response</var>'s <a for=response>URL list</a>'s first item.
+  <li>If <var>response</var>'s <a for=response>timing allow passed flag</a> is not set, set
+  <var>timingInfo</var> to a new <a for=/>fetch timing info</a>, with its
+  <a for="fetch timing info">fetch start time</a> set to <var>timingInfo</var>'s

Is there infra that just enables us to copy the structs? This just seems like a lot of boilerplate..

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/pull/1185#pullrequestreview-603092082

Received on Wednesday, 3 March 2021 16:45:07 UTC