Skip to content

Commit 573df55

Browse files
committed
Rename response processing algorithms
In particular, this renames processResponseEndOfBody/process response end-of-body to processResponseConsumeBody/process response consume body and processResponseDone/process response done to processResponseEndOfBody/process response end-of-body. Apologies for the confusion this may cause.
1 parent 1731c03 commit 573df55

File tree

1 file changed

+33
-30
lines changed

1 file changed

+33
-30
lines changed

fetch.bs

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ lt="authentication entry">authentication entries</a> (for HTTP authentication).
196196
<dt><dfn for="fetch params">process request end-of-body</dfn> (default null)
197197
<dt><dfn for="fetch params">process response</dfn> (default null)
198198
<dt><dfn for="fetch params">process response end-of-body</dfn> (default null)
199-
<dt><dfn for="fetch params">process response done</dfn> (default null)
199+
<dt><dfn for="fetch params">process response consume body</dfn> (default null)
200200
<dd>Null or an algorithm.
201201

202202
<dt><dfn for="fetch params">task destination</dfn> (default null)
@@ -3739,17 +3739,18 @@ optional algorithm
37393739
<dfn export for=fetch id=process-request-body><var>processRequestBodyChunkLength</var></dfn>, an
37403740
optional algorithm
37413741
<dfn export for=fetch id=process-request-end-of-body oldids=process-request-end-of-file><var>processRequestEndOfBody</var></dfn>,
3742-
an optional algorithm <dfn export for=fetch id=process-response><var>processResponse</var></dfn>,
3743-
an optional algorithm
3744-
<dfn export for=fetch id=process-response-end-of-body oldids=process-response-end-of-file><var>processResponseEndOfBody</var></dfn>,
3745-
an optional algorithm <dfn export for=fetch><var>processResponseDone</var></dfn>, and an optional
3746-
boolean <dfn export for=fetch><var>useParallelQueue</var></dfn> (default false), run the steps
3747-
below. If given, <var>processRequestBodyChunkLength</var> must be an algorithm accepting an integer
3748-
representing the number of bytes transmitted. If given, <var>processRequestEndOfBody</var> must be
3749-
an algorithm accepting no arguments. If given, <var>processResponse</var> must be an algorithm
3750-
accepting a <a for=/>response</a>. If given, <var>processResponseEndOfBody</var> must be an
3751-
algorithm accepting a <a for=/>response</a> and null, failure, or a <a for=/>byte sequence</a>. If
3752-
given, <var>processResponseDone</var> must be an algorithm accepting a <a for=/>response</a>.
3742+
an optional algorithm <dfn export for=fetch id=process-response><var>processResponse</var></dfn>, an
3743+
optional algorithm <dfn export for=fetch><var>processResponseEndOfBody</var></dfn>, an optional
3744+
algorithm
3745+
<dfn export for=fetch id=process-response-end-of-body oldids=process-response-end-of-file><var>processResponseConsumeBody</var></dfn>,
3746+
and an optional boolean <dfn export for=fetch><var>useParallelQueue</var></dfn> (default false), run
3747+
the steps below. If given, <var>processRequestBodyChunkLength</var> must be an algorithm accepting
3748+
an integer representing the number of bytes transmitted. If given,
3749+
<var>processRequestEndOfBody</var> must be an algorithm accepting no arguments. If given,
3750+
<var>processResponse</var> must be an algorithm accepting a <a for=/>response</a>. If given,
3751+
<var>processResponseEndOfBody</var> must be an algorithm accepting a <a for=/>response</a>. If
3752+
given, <var>processResponseConsumeBody</var> must be an algorithm accepting a <a for=/>response</a>
3753+
and null, failure, or a <a for=/>byte sequence</a>.
37533754

37543755
<p>An ongoing <a for=/>fetch</a> can be
37553756
<dfn export for=fetch id=concept-fetch-terminate>terminated</dfn> with flag <var>aborted</var>,
@@ -3804,8 +3805,8 @@ the request.
38043805
<var>processRequestBodyChunkLength</var>,
38053806
<a for="fetch params">process request end-of-body</a> is <var>processRequestEndOfBody</var>,
38063807
<a for="fetch params">process response</a> is <var>processResponse</var>,
3808+
<a for="fetch params">process response consume body</a> is <var>processResponseConsumeBody</var>,
38073809
<a for="fetch params">process response end-of-body</a> is <var>processResponseEndOfBody</var>,
3808-
<a for="fetch params">process response done</a> is <var>processResponseDone</var>,
38093810
<a for="fetch params">task destination</a> is <var>taskDestination</var>, and
38103811
<a for="fetch params">cross-origin isolated capability</a> is
38113812
<var>crossOriginIsolatedCapability</var>.
@@ -4213,15 +4214,15 @@ steps:
42134214
</li>
42144215

42154216
<li>
4216-
<p>Let <var>processResponseDone</var> be the following steps:
4217+
<p>Let <var>processResponseEndOfBody</var> be the following steps:
42174218

42184219
<ol>
42194220
<li><p>Set <var>fetchParams</var>'s <a for="fetch params">request</a>'s
42204221
<a for=request>done flag</a>.
42214222

4222-
<li><p>If <var>fetchParams</var>'s <a for="fetch params">process response done</a> is not null,
4223-
then <a>queue a fetch task</a> to run <var>fetchParams</var>'s
4224-
<a for="fetch params">process response done</a> given <var>response</var> with
4223+
<li><p>If <var>fetchParams</var>'s <a for="fetch params">process response end-of-body</a> is not
4224+
null, then <a>queue a fetch task</a> to run <var>fetchParams</var>'s
4225+
<a for="fetch params">process response end-of-body</a> given <var>response</var> with
42254226
<var>fetchParams</var>'s <a for="fetch params">task destination</a>.
42264227
</ol>
42274228
</li>
@@ -4232,7 +4233,7 @@ steps:
42324233
<a for="fetch params">task destination</a>.
42334234

42344235
<li><p>If <var>response</var>'s <a for=response>body</a> is null, then run
4235-
<var>processResponseDone</var>.
4236+
<var>processResponseEndOfBody</var>.
42364237

42374238
<li>
42384239
<p>Otherwise:</p>
@@ -4244,8 +4245,10 @@ steps:
42444245
<a for=TransformStream lt=enqueue>enqueues</a> <var>chunk</var> in <var>transformStream</var>.
42454246

42464247
<li><p><a for=TransformStream lt="setting up">Set up</a> <var>transformStream</var> with
4247-
<a for="TransformStream/set up"><i>transformAlgorithm</i></a> set to <var>identityTransformAlgorithm</var> and
4248-
<a for="TransformStream/set up"><i>flushAlgorithm</i></a> set to <var>processResponseDone</var>.
4248+
<a for="TransformStream/set up"><i>transformAlgorithm</i></a> set to
4249+
<var>identityTransformAlgorithm</var> and
4250+
<a for="TransformStream/set up"><i>flushAlgorithm</i></a> set to
4251+
<var>processResponseEndOfBody</var>.
42494252

42504253
<li><p>Set <var>response</var>'s <a for=response>body</a> to the result of
42514254
<a for=ReadableStream lt="piping through">piping</a> <var>response</var>'s
@@ -4256,16 +4259,16 @@ steps:
42564259
the stream reaches its end, and is otherwise an <a>identity transform stream</a>.
42574260

42584261
<li>
4259-
<p>If <var>fetchParams</var>'s <a for="fetch params">process response end-of-body</a> is non-null,
4260-
then:
4262+
<p>If <var>fetchParams</var>'s <a for="fetch params">process response consume body</a> is
4263+
non-null, then:
42614264

42624265
<ol>
42634266
<li><p>Let <var>processBody</var> given <var>nullOrBytes</var> be this step: run
4264-
<var>fetchParams</var>'s <a for="fetch params">process response end-of-body</a> given
4267+
<var>fetchParams</var>'s <a for="fetch params">process response consume body</a> given
42654268
<var>response</var> and <var>nullOrBytes</var>.
42664269

42674270
<li><p>Let <var>processBodyError</var> be this step: run <var>fetchParams</var>'s
4268-
<a for="fetch params">process response end-of-body</a> given <var>response</var> and failure.
4271+
<a for="fetch params">process response consume body</a> given <var>response</var> and failure.
42694272

42704273
<li><p>If <var>response</var>'s <a for=response>body</a> is null, then <a>queue a fetch task</a>
42714274
to run <var>processBody</var> given null, with <var>fetchParams</var>'s
@@ -7582,7 +7585,7 @@ method steps are:
75827585
"<code>fetch</code>".
75837586

75847587
<li>
7585-
<p><a for=/>Fetch</a> <var>request</var> with <a for=fetch><i>processResponseDone</i></a> set to
7588+
<p><a for=/>Fetch</a> <var>request</var> with <a for=fetch><i>processResponseEndOfBody</i></a> set to
75867589
<var>handleFetchDone</var>, and <a for=fetch><i>processResponse</i></a> given <var>response</var>
75877590
being these substeps:
75887591

@@ -8032,6 +8035,11 @@ in a <a for=/>parallel queue</a> if <a for=fetch><i>useParallelQueue</i></a> is
80328035
<a for=response>body</a>'s <a for=body>stream</a> directly.
80338036

80348037
<dt><a for=fetch><i>processResponseEndOfBody</i></a>
8038+
<dd><p>Takes an algorithm that will be passed a <a for=/>response</a>. Indicates the network is
8039+
done transmitting the response. This does not read <a for=/>response</a>'s
8040+
<a for=response>body</a>.
8041+
8042+
<dt><a for=fetch><i>processResponseConsumeBody</i></a>
80358043
<dd>
80368044
<p>Takes an algorithm that will be passed a <a for=/>response</a> and null, failure, or a
80378045
<a>byte sequence</a>. This is useful for standards that wish to operate on the entire
@@ -8056,11 +8064,6 @@ in a <a for=/>parallel queue</a> if <a for=fetch><i>useParallelQueue</i></a> is
80568064
<a for=response>body</a> itself as providing this argument will cause it to be read and it can be
80578065
read only once.
80588066

8059-
<dt><a for=fetch><i>processResponseDone</i></a>
8060-
<dd><p>Takes an algorithm that will be passed a <a for=/>response</a>. Indicates the network is
8061-
done transmitting the response. This does not read <a for=/>response</a>'s
8062-
<a for=response>body</a>.
8063-
80648067
<dt><a for=fetch><i>useParallelQueue</i></a>
80658068
<dd><p>Takes a <a for=/>boolean</a> that defaults to false. Indicates where the algorithms passed
80668069
as arguments will be invoked. Hopefully most standards will not need this.

0 commit comments

Comments
 (0)