Commit dc98462c authored by Ryan Sturm's avatar Ryan Sturm Committed by Chromium LUCI CQ

Failing prefetch on net error

Previously, this code assumed that OnComplete would only be called after
OnReceiveResponse, but it can be called before that as well in the case
of a network failure.

Change-Id: I86072c1bd0e05521f2688ad1270e5b7246875676
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2602708Reviewed-by: default avatarTarun Bansal <tbansal@chromium.org>
Commit-Queue: Ryan Sturm <ryansturm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#839475}
parent a06f80f8
......@@ -272,7 +272,12 @@ void StreamingSearchPrefetchURLLoader::OnComplete(
if (!forwarding_client_) {
DCHECK(streaming_prefetch_request_);
streaming_prefetch_request_->MarkPrefetchAsComplete();
if (status.error_code == net::OK) {
streaming_prefetch_request_->MarkPrefetchAsComplete();
} else {
streaming_prefetch_request_->ErrorEncountered();
return;
}
}
status_ = status;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment