Re: [slightlyoff/ServiceWorker] Create a new ReadableStream in FetchEvent.respondWith (#934)

> +                                <li>When <var>promise</var> is fulfilled with an object whose <code>done</code> property is true, set <var>done</var> to true.
> +                                <li>When <var>promise</var> is fulfilled with a value that matches with neither of the above patterns, or <var>promise</var> is rejected, <a lt="error ReadableStream">error</a> <var>newStream</var> with a <code>TypeError</code>.</li>
> +                              </ol>
> +                            </li>
> +                            <li>Let <var>cancel</var> be an action that <a lt="cancel a reader">cancels</a> <var>reader</var>.</li>
> +                            <li>Let <var>newStream</var> be the result of <a lt="construct a ReadableStream">constructing</a> a ReadableStream object with <var>strategy</var>, <var>pull</var> and <var>cancel</var> on <var>targetRealm</var>.</li>
> +                            <li>Set <var>potentialResponse</var>'s <a>body</a> to a new <a>body</a> whose <a>stream</a> is <var>newStream</var>.</li>
> +                            <li>Run these subsubsteps repeatedly in parallel while <var>done</var> is false:</li>
> +                              <ol>
> +                                <li>If <var>response</var>'s <a>body</a>'s <a>stream</a> is <a>errored</a>, then set <var>done</var> to true.</li>
> +                                <li>Otherwise, if <var>bytes</var> is empty and <var>end-of-body</var> is true, then <a lt="close ReadableStream">close</a> <var>response</var>'s <a>body</a>'s <a>stream</a> and set <var>done</var> to true.</li>
> +                                <li>Otherwise, if <var>bytes</var> is not empty, run these subsubsubsteps:
> +                                  <ol>
> +                                    <li>Let <var>chunk</var> be a subsequence of <var>bytes</var> starting from the beginning of <var>bytes</var>.</li>
> +                                    <li>Remove <var>chunk</var> from <var>bytes</var>.
> +                                    <li>Let <var>buffer</var> be an <code>ArrayBuffer</var> object created on <var>targetRealm</var> and containing <var>chunk</var>.

s/on targetRealm/in targetRealm

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/pull/934/files/8f5e410f7619eb463ef8f452e3cfad924e436814#r73101623

Received on Tuesday, 2 August 2016 06:44:09 UTC