Always use backpressure for fetch
Previously, backpressure would only be applied to fetch responses if the Cache-Control: no-store header was set. This was to avoid blocking other resource loads that might have to wait for the lock on the http disk cache that was held by the resource load to which backpressure was being applied. As of https://chromium-review.googlesource.com/684615 the disk cache supports multiple concurrent writers and so this protection is no longer needed. Remove support for the non-backpressure mode and always apply backpressure. The fact that the body is no longer implicitly read is visible to tests that observe the result of the fetch() via a side channel, specifically inspector and browser tests. Fix such tests to explicitly read the body to completion. Additionally, in order to satisfy the presubmit check, make SharedMemoryDataConsumerHandle::Context::on_reader_detached_ a OnceClosure. The implementation already implicitly ran on_reader_detached_ at most once, because is_on_reader_detached_valid_ would be set to false by ResetOnReaderDetached immediately after PostTask was called. Now this has been made explicit by using OnceClosure. on_reader_detached_ is only reset on the writer_task_runner_ thread. When the closure is not run this is implemented by the logic in ResetOnReaderDetached(), the same as before. When the closure is run the behaviour has changed slightly: the OnceClosure is moved into the task that is posted to the writer_task_runner_ thread, where it will be destroyed automatically after running. There's no nead for a separate reset in this case. BUG=535793 Change-Id: I9d2b58e183b84640afc153ac99de08fdc2368240 Reviewed-on: https://chromium-review.googlesource.com/861695 Commit-Queue: Adam Rice <ricea@chromium.org> Reviewed-by:Yutaka Hirano <yhirano@chromium.org> Cr-Commit-Position: refs/heads/master@{#530070}
Showing
This diff is collapsed.
Please register or sign in to comment