Network Error Logging: Generate error reports on cancellation

A network error should be reported if the resource fetch is aborted
before it is complete:
https://w3c.github.io/network-error-logging/#transmission-of-request-and-response-errors

This CL adds NEL error generation (with report type ERR_ABORTED) for
any HttpNetworkTransactions destructed without previously generating a
success or error report. This guarantees that every
HttpNetworkTransaction results in a NEL report. Successes are reported
after receiving valid headers (if the response code is 4xx or 5xx, or
if the body will not be read, or on a redirect), or after completely
reading the body. Any other outcome is reported as an error.

Bug: 934000
Change-Id: I8f71309c9cea0295546b23861fba6b131f72a3d7
Reviewed-on: https://chromium-review.googlesource.com/c/1480195
Commit-Queue: Lily Chen <chlily@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#634834}
3 files changed