- From: Domenic Denicola <notifications@github.com>
- Date: Sun, 31 Jul 2016 20:56:24 -0700
- To: slightlyoff/ServiceWorker <ServiceWorker@noreply.github.com>
- Message-ID: <slightlyoff/ServiceWorker/pull/934/r72921736@github.com>
> - <li>Let <var>dummyStream</var> be an <a>empty</a> <a>ReadableStream</a> object.</li> > - <li>Set <var>response</var>'s <a href="https://fetch.spec.whatwg.org/#concept-body-body">body</a> to a new <a>body</a> whose <a>stream</a> is <var>dummyStream</var>.</li> > - <li>Let <var>reader</var> be the result of <a lt="get a reader">getting a reader</a> from <var>dummyStream</var>.</li> > - <li><a>Read all bytes</a> from <var>dummyStream</var> with <var>reader</var>.</li> > + <li>Let <var>reader</var> be the result of <a lt="get a reader">getting a reader</a> from <var>response</var>'s <a>body</a>'s <a>stream</a>.</li> > + <li>Let <var>strategy</var> be an object. The user agent may choose any object.</li> > + <li>Let <var>pull</var> be an action that runs these subsubsteps: > + <ol> > + <li>Let <var>promise</var> be the result of <a lt="read a chunk from a reader">reading</a> a chunk from <var>reader</var>.</li> > + <li>When <var>promise</var> is fulfilled with an object whose <code>done</code> property is false and whose <code>value</code> property is a <code>Uint8Array</code> object, <a lt="enqueue a chunk to ReadableStream">enqueue</a> the result of transferring the <code>value</code> property to <var>newStream</var>. > + <li>When <var>promise</var> is fulfilled with an object whose <code>done</code> property is true, <a lt="close ReadableStream">close</a> <var>newStream</var>. > + <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>.</li> To be more precise it would be good to specify "in the relevant Realm of this FetchEvent" (_targetRealm_ from the above). See https://github.com/heycam/webidl/issues/135 --- 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/06dd419a6b375f0a6a010323ee6c87c683290523#r72921736
Received on Monday, 1 August 2016 03:56:53 UTC