From 2c36ccbfa0b34821254fd689ad8b01c1ec345f61 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Sat, 20 Feb 2021 11:27:27 +0100 Subject: [PATCH] review --- fetch.bs | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/fetch.bs b/fetch.bs index 9a86075bc..310c0f62a 100644 --- a/fetch.bs +++ b/fetch.bs @@ -1042,7 +1042,7 @@ must be an algorithm accepting an exception.

Let reader be the result of getting a reader for body's stream. -

This operation ought not to throw an exception. +

This operation will not throw an exception.

  • Perform the incrementally-read loop given reader, taskDestination, processBodyChunk, processEndOfBody, and @@ -1072,8 +1072,12 @@ must be an algorithm accepting an exception.

    Otherwise:

      -
    1. Let bytes be a copy of - chunk. +

    2. +

      Let bytes be a copy of + chunk. + +

      Implementations are strongly encouraged to use an implementation strategy that + avoids this copy where possible.

    3. Set continueAlgorithm to these steps: @@ -3226,11 +3230,11 @@ an optional algorithm processResp optional algorithm processResponseEndOfBody, and an optional boolean useParallelQueue (default false), run -the steps below. If given, processRequestBody must be an algorithm accepting an integer. -If given, processRequestEndOfBody must be an algorithm accepting no arguments. -processResponse must be an algorithm accepting a response. -processResponseEndOfBody must be an algorithm accepting a response and null, -failure, or a byte sequence. +the steps below. If given, processRequestBody must be an algorithm accepting an integer +representing the number of bytes transmitted. If given, processRequestEndOfBody must be +an algorithm accepting no arguments. If given, processResponse must be an algorithm +accepting a response. If given, processResponseEndOfBody must be an +algorithm accepting a response and null, failure, or a byte sequence.

      An ongoing fetch can be terminated with flag aborted, @@ -3660,14 +3664,15 @@ steps: then:

        -
      1. Let processBody given nullOrFailureOrBytes be this step: run +

      2. Let processBody given nullOrBytes be this step: run fetchParams's process response end-of-body given - response and nullOrFailureOrBytes. + response and nullOrBytes. -

      3. Let processBodyError be to run processBody given failure. +

      4. Let processBodyError be this step: run fetchParams's + process response end-of-body given response and failure.

      5. If response's body is null, then queue a fetch task - to processBody given null, with fetchParams's + to run processBody given null, with fetchParams's task destination.

      6. Otherwise, fully read response's body given @@ -4685,7 +4690,7 @@ these steps:

        1. -

          Let processBodyChunk given bytes, be these steps: +

          Let processBodyChunk given bytes be these steps:

          1. If the ongoing fetch is terminated, then abort these steps. @@ -4709,7 +4714,7 @@ these steps:

        2. -

          Let processBodyError given e, be these steps: +

          Let processBodyError given e be these steps:

          1. If the ongoing fetch is terminated, then abort these steps.