Skip to content

Commit

Permalink
Overhaul how standards integrate with fetch
Browse files Browse the repository at this point in the history
This makes some rather big changes:

* Requests no longer have a synchronous flag. Blocking a thread is now up to the caller.
* Fetch therefore no longer returns a response directly. In parallel callers will need to pass in "callbacks" that are either invoked on a parallel queue or on an event loop.
* To hold onto these callbacks as well as some other information a fetch params struct is now passed around the various fetch algorithms. This will allow for cleanup around termination and aborting in the future. Potentially some bookkeeping state from request can move there going forward.
* There's a dedicated navigate-redirect fetch algorithm for HTML as the HTTP-redirect fetch algorithm now wants a fetch params instance.
* Some allowance for aborting early on in fetch was removed as all that is run synchronously with the code that invoked fetch to begin with. Closes #1164.
* Algorithms that needed to be adjusted were changed to use the new Infra patterns for parameters. I also tried to improve naming, e.g., makeCORSPreflight rather than CORS-preflight flag.
* "process response done" was removed as it seemed redundant with "response response end-of-body"; possible leftover from trailers.
* Removed duplicate task queueing at the end of main fetch for request's body.

Fixes #536.
  • Loading branch information
annevk committed Feb 11, 2021
1 parent d8ebe2f commit 965b86a
Showing 1 changed file with 380 additions and 343 deletions.
Loading

0 comments on commit 965b86a

Please sign in to comment.