[fetch] Cache request stream body up to 64k bytes.
This CL introduces caching in ChunkedDataPipeUploadDataStream (CDPUDS here in after) so that fetch upload streams manages inevitable replay required situations like socket time out. If the caching is enabled, CDPUDS caches streams content from the data pipe while uploading. 1 If we hit some error requiring CDPUDS restart, InitInternal() doesn't reset the data pipe and CDPUDS replays the cached content and continues data pipe withdrawing after that. 2 If we hit the error when the cache is over the max size, we will fail the request because we cannot replay the stream any longer. 3 If no error happens, the cache will never be used. We don't clear the cache because it is small and will be discarded after the transaction. CDPUDS caches chunks from the date pipe until whole size gets over the max size. For example, if the date pipe sends [60k, 60k, 60k] chunks, CDPUDS caches the first 2 60ks. If it is [120k, 1k,], CDPUDS caches the 120k chunk or any size if it is the first chunk. Since this change is neutral to the HTTP protocol, this works over H1/SPDY and QUIC. Bug: 1077174 Change-Id: Ib87b9d7ff97577f25e7355aa4b0764e03157d7bd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2269622Reviewed-by:Yutaka Hirano <yhirano@chromium.org> Reviewed-by:
Matt Menke <mmenke@chromium.org> Commit-Queue: Yoichi Osato <yoichio@chromium.org> Cr-Commit-Position: refs/heads/master@{#801213}
Showing
This diff is collapsed.
Please register or sign in to comment