URLLoaderImpl: Fix handling of read errors

Desktop / Chromium - Matt Menke [chromium.org] - 9 August 2017 13:10 EDT

On an sync read error, transmit the error instead of a successful completion. On an async read error, transmit the error instead of just closing the pipe.

Also fix how ResourceRequestCompletionStatus::decoded_body_length, is calculated on errors.

Bug: 752773 Change-Id: Id42db09e2b50717e1a625aaa6577a0f9ebcd1ce1 Reviewed-on: https://chromium-review.googlesource.com/603971 Commit-Queue: Matt Menke

1dd3f2f URLLoaderImpl: Fix handling of read errors.
content/network/url_loader_impl.cc | 35 ++++++---
content/network/url_loader_impl.h | 1 +
content/network/url_loader_unittest.cc | 91 +++++++++++++++++++++-
.../content-sniffer-test0.html.mock-http-headers | 1 -
.../content-sniffer-test1.html.mock-http-headers | 1 -
.../content-sniffer-test2.html.mock-http-headers | 1 -
.../content-sniffer-test3.html.mock-http-headers | 1 -
net/BUILD.gn | 8 +-
net/test/embedded_test_server/default_handlers.cc | 28 +++++++
9 files changed, 146 insertions(+), 21 deletions(-)

Upstream: git.chromium.org


  • Share