Re: [ServiceWorker] Backpressure on fetch integrated with Streams (#452)

Sorry, I misunderstood ReadableByteStream.

As you say, we can observe the underlying source's `readInto`, so we definitely can know when `read` or `readInto` is called.

 - Body mixin's `used flag` is set when stream's `readInto` is called.
   - But, `used flag` can be incorrect when the stream is locked to an exclusive lock, to give an optimization chance to implementations.
 - Remove `Body.bodyUsed`. Because `used flag` is valid only when stream is not locked.

Can we define like this? This introduces incompatible changes.

 - `Body.bodyUsed` is removed.
 - Reading an empty body does not set `used flag`. For example, if `res` is a response with an empty body, `res.text().then(() => res.text())` is resolved with an empty string.

---
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/452#issuecomment-70622279

Received on Tuesday, 20 January 2015 08:54:34 UTC