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

@yoavweiss commented on this pull request.



>  
  <li>
   <p>Run these steps, but <a>abort when</a> the ongoing fetch is <a for=fetch>terminated</a>:
 
   <ol>
    <li>
     <p>Set <var>connection</var> to the result of establishing an HTTP connection to
-    <var>origin</var>. [[!HTTP]] [[!HTTP-SEMANTICS]] [[!HTTP-COND]] [[!HTTP-CACHING]] [[!HTTP-AUTH]]
-    [[!TLS]]
+    <var>origin</var>, with the following caveats:

Nit: s/caveats/conditions/ ?

>  </ol>
 
+<h3 id=fetch-report-resource-timing>Report Resource Timing</h3>

I don't think this needs an `h3` here. This feels like it could be an algorithm that's part of the previous section.

>  </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
+  <a for="fetch timing info">fetch start time</a>,
+  <a for="fetch timing info">response end time</a> set to <var>timingInfo</var>'s
+  <a for="fetch timing info">response end time</a>,
+  <a for="fetch timing info">decoded body size</a>, and

Should we remove `decoded body size` here? It should be zero if TAO is not passing.

>  </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

What would happen when TAO passes? Would we then pass along the originals?

>  
          <li><p>Let <var>codings</var> be the result of <a>extracting header list values</a> given
          `<code>Content-Encoding</code>` and <var>response</var>'s <a for=response>header list</a>.
 
+         <li><p>Set <var>timingInfo</var>'s <a for="fetch timing info">transfer size</a> to the result of
+         adding <var>timingInfo</var>'s <a for="fetch timing info">transfer size</a> and <var>bytes</var>.
+
+         <p class=XXX>TODO: <a for="fetch timing info">transfer size</a> should also include the total size of the headers.

I think there's no need to bother with that, due to https://github.com/w3c/resource-timing/issues/238
In the latest WG discussion, we talked about just adding a fixed amount of bytes as headers, to avoid exposing sensitive information, while keeping backwards compat.

-- 
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-603288713

Received on Wednesday, 3 March 2021 20:44:02 UTC