Re: [whatwg/fetch] Return a "controller" instance from fetch (#1329)

@annevk commented on this pull request.



> @@ -3756,6 +3804,9 @@ the request.
  <a for="fetch params">cross-origin isolated capability</a> is
  <var>crossOriginIsolatedCapability</var>.
 
+ <li><p>If <var>processFetchStart</var> is not null, invoke <var>processFetchStart</var> with
+ <var>fetchParams</var>'s <a for="fetch params">controller</a>.

Why the change to this rather than returning the controller?

> +   <li><p>Let <var>onServiceWorkerFetchStarted</var> given <a>service worker fetch controller</a>
+   <var>controller</var>: Set <var>fetchParams</var>'s <a for="fetch params">controller</a>'s
+   <a for="fetch controller">service worker controller</a> to <var>controller</var>. [[!SW]]
+
    <li><p>Set <var>response</var> to the result of invoking <a for=/>handle fetch</a> for
-   <var>requestForServiceWorker</var>. [[!HTML]] [[!SW]]
+   <var>requestForServiceWorker</var> with <var>fetchParams</var>'s
+   <a for="fetch params">crossOriginIsolatedCapability</a>, and
+   <var>onServiceWorkerFetchStarted</var>. [[!SW]]

Here too I thought the setup was going to be that handle fetch returns a controller that we abort if our controller is aborted. And that handle fetch would run in parallel after that, invoking a callback with a response at some point.

-- 
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/1329#pullrequestreview-807033158

Received on Tuesday, 16 November 2021 09:28:31 UTC