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

Fixing a crashy race conidtion in search prefetch

Since there can be a time gap between when the url loader interceptor is
handed off to content/ and when the throttles allow the request to
proceed, there is a possibility of forwarding_client_ not being set up
while the streaming request pointer is null.

I suspect this is where the crash is coming from.

Bug: 1164190
Change-Id: I1e68fa7898737ba71b68ec681903b88ece88c8d4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2617858
Commit-Queue: Tarun Bansal <tbansal@chromium.org>
Auto-Submit: Ryan Sturm <ryansturm@chromium.org>
Reviewed-by: default avatarTarun Bansal <tbansal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#841579}
parent 42f7aba6
...@@ -270,8 +270,8 @@ void StreamingSearchPrefetchURLLoader::OnComplete( ...@@ -270,8 +270,8 @@ void StreamingSearchPrefetchURLLoader::OnComplete(
return; return;
} }
if (!forwarding_client_) { if (streaming_prefetch_request_) {
DCHECK(streaming_prefetch_request_); DCHECK(!forwarding_client_);
if (status.error_code == net::OK) { if (status.error_code == net::OK) {
streaming_prefetch_request_->MarkPrefetchAsComplete(); streaming_prefetch_request_->MarkPrefetchAsComplete();
} else { } else {
......
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