Make DataPipeBytesConsumer support ReadableStream loading better.

This CL fixes some edge condition interactions when being loaded as
a ReadableStream.  In particular, it:

1. Properly distinguishes between the end of the DataPipe and a closed
   DataPipe with bytes left to be read.  A ReadableStream that is not
   actively draining the pipe could get closed too early.
2. Responses must support explicit completion in order to handle error
   conditions properly.  This CL makes DataPipeBytesConsumer wait
   for an explicit signal before closing.
3. Service worker navigation preload is updated to provide the explicit
   completion signals.

Bug: 894815
Change-Id: I8cff3de94aa2dcbc8deb4a9601a95c13b8ab94d9
Commit-Queue: Ben Kelly <>
Reviewed-by: Yutaka Hirano <>
Reviewed-by: Marijn Kruisselbrink <>
Reviewed-by: Kinuko Yasuda <>
Cr-Commit-Position: refs/heads/master@{#599192}
10 files changed