Re: [streams] Byte stream update, including reference implementation (#361)

> +  if (controller._totalQueuedBytes === 0) {
> +    // TODO: Detach buffer.
> +    controller._pendingPullIntos.push(pullIntoDescriptor);
> +
> +    if (controller._insideUnderlyingByteSource) {
> +      controller._callPullOrPullIntoLaterIfNeeded = true;
> +      return;
> +    }
> +
> +    CallPullInto(controller);
> +    CallPullOrPullIntoRepeatedlyIfNeeded(controller);
> +
> +    return;
> +  }
> +
> +  const ready = FillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor);

It might be possible to refactor this section to reuse RespondToReadIntoRequestsFromQueue. E.g. push pullIntoDescriptor into _pendingPullIntos and then call it. I am not sure though.

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/361/files#r33553371

Received on Tuesday, 30 June 2015 09:04:40 UTC