Re: [whatwg/fetch] Move `finalize and report timing` to controller (PR #1413)

@yutakahirano commented on this pull request.



> @@ -232,8 +232,21 @@ lt="authentication entry">authentication entries</a> (for HTTP authentication).
 <a for=struct>items</a>:
 
 <dl>
- <dt><dfn for="fetch controller">state</dfn> (default "<code>ongoing</code>")
- <dd>"<code>ongoing</code>", "<code>terminated</code>", or "<code>aborted</code>"
+ <dt><dfn for="fetch controller">state</dfn> (default "<code>requesting</code>")
+ <dd>
+  "<code>requesting</code>", "<code>responding</code>", "<code>concluded</code>",
+  "<code>terminated</code>", or "<code>aborted</code>"
+
+  <p class="note">The <a for="fetch controller" lt="state">states</a> of the <a>fetch controller</a>
+  only make sense in the context of half-duplex HTTP fetches (where the <a for=/>request</a> is
+  complete before the <a for=/>response</a> starts). Handle with care when using them in other
+  contexts.</p>
+
+ <dt><dfn for="fetch controller">timing info</dfn>
+ <dd>A <a for=/>fetch timing info</a>

Wondering if we should have a period.

> @@ -232,8 +232,21 @@ lt="authentication entry">authentication entries</a> (for HTTP authentication).
 <a for=struct>items</a>:
 
 <dl>
- <dt><dfn for="fetch controller">state</dfn> (default "<code>ongoing</code>")
- <dd>"<code>ongoing</code>", "<code>terminated</code>", or "<code>aborted</code>"
+ <dt><dfn for="fetch controller">state</dfn> (default "<code>requesting</code>")
+ <dd>
+  "<code>requesting</code>", "<code>responding</code>", "<code>concluded</code>",

"responding" sounds a bit weird given the server is responding, not the browser.

>   <dt><dfn for="fetch params">timing info</dfn>
  <dd>A <a for=/>fetch timing info</a>.
 
+ <dt><dfn for="fetch params">controller</dfn>

What's the intention of this position change?

> - <dd>"<code>ongoing</code>", "<code>terminated</code>", or "<code>aborted</code>"
+ <dt><dfn for="fetch controller">state</dfn> (default "<code>requesting</code>")
+ <dd>
+  "<code>requesting</code>", "<code>responding</code>", "<code>concluded</code>",
+  "<code>terminated</code>", or "<code>aborted</code>"
+
+  <p class="note">The <a for="fetch controller" lt="state">states</a> of the <a>fetch controller</a>
+  only make sense in the context of half-duplex HTTP fetches (where the <a for=/>request</a> is
+  complete before the <a for=/>response</a> starts). Handle with care when using them in other
+  contexts.</p>
+
+ <dt><dfn for="fetch controller">timing info</dfn>
+ <dd>A <a for=/>fetch timing info</a>
+
+ <dt><dfn for="fetch controller">conclude steps</dfn> (default null)
+ <dd>Null or an algorithm responsible for finalizing the fetch and reporting timing information

Wondering if we should have a period.

> @@ -244,6 +257,32 @@ lt="authentication entry">authentication entries</a> (for HTTP authentication).
 <var>controller</var>, set <var>controller</var>'s <a for="fetch controller">state</a> to
 "<code>terminated</code>".
 
+<p>To <dfn export for="fetch controller" id="finalize-and-report-timing">conclude</dfn> a

Is this called by each spec (XHR, fetch, script, ...)? Are there any preconditions and postconditions callers need to take care of?

>     </li>
 
-   <li><p>Set <var>response</var>'s <a for=response>timing info</a> to the result of
-   <a>creating an opaque timing info</a> for <var>fetchParams</var>'s
-   <a for="fetch params">timing info</a>.</p></li>
+   <li><p>Set <var>timingInfo</var>'s <a for="fetch timing info">end time</a> to the result of
+   <a lt="coarsen time">coarsening</a> <var>unsafeResponseEndTime</var> given <var>global</var>'s
+   <a>relevant settings object</a>'s
+   <a for="environment settings object">cross-origin isolated capability</a>.
+
+   <li><p><a for=/>Mark resource timing</a> for <var>timingInfo</var>, <var>request</var>'s
+   <a for=request>URL</a> <var>initiatorType</var>, <var>global</var>, <var>cacheState</var>,

`,` after `URL</a>`

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

Message ID: <whatwg/fetch/pull/1413/review/974793969@github.com>

Received on Tuesday, 17 May 2022 04:15:37 UTC