Skip to content

Commit

Permalink
Prerender: Check SpeculationHostDelegate is non-null before using
Browse files Browse the repository at this point in the history
This CL fixes the issue that SpeculationHostImpl should ensure the
delegate pointer is not null before using it.

Bug: 1197133
Change-Id: I3a37f86983307571fe6368ff859b481ec518cabb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2907013
Reviewed-by: Tsuyoshi Horo <horo@chromium.org>
Commit-Queue: Lingqi Chi <lingqi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#884858}
  • Loading branch information
Clqsin45 authored and Chromium LUCI CQ committed May 20, 2021
1 parent 41b6c79 commit b249f63
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion content/browser/speculation_rules/speculation_host_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ void SpeculationHostImpl::UpdateSpeculationCandidates(
return;

// Let `delegate_` process the candidates that it is interested in.
delegate_->ProcessCandidates(candidates);
if (delegate_)
delegate_->ProcessCandidates(candidates);

// TODO(crbug.com/1197133): process prerender candidates.
}
Expand Down

0 comments on commit b249f63

Please sign in to comment.