Fetch: Delay buffering Response data. #17745
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When a service worker executes code like
evt.respondWith(fetch(r))
weshould be able to directly pass the fetch's resulting mojo::DataPipe
through without any data copying. This previously did not work,
however, since the BufferingBytesConsumer would immediately start
buffering the Response body data.
This CL fixes this issue by delaying the start of the buffering by a
short amount of time. This gives the service worker time to drain the
pipe.
The delay is currently disabled by default behind the
"BufferingBytesConsumerDelay" feature.
Based on yhirano's draft CL at crrev.com/c/1383755.
Bug: 911036
Change-Id: I65675ce62a7ce593c8994b3e1258634840ba6c2d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1679669
Commit-Queue: Ben Kelly <wanderview@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#676053}