-
tzik authored
ThreatDetails is a ref counted object, and its first reference can be made by base::BindRepeating through ThreadDetails::StartCollection. The ref count is released when the callback instance is destroyed. As the RepeatingCallback instance created in StartCollection is destroyed after the scope out, `new ThreatDetails` may have returned a stale pointer. This CL moves the problematic StartCollection() call out of the constructor to avoid touching the ref count before its first proper reference is made. Bug: 866456 Change-Id: I82b83b9bb30cdc95cff60e3e22e79f0af17645a2 Reviewed-on: https://chromium-review.googlesource.com/1149777Reviewed-by:
Jialiu Lin <jialiul@chromium.org> Commit-Queue: Taiju Tsuiki <tzik@chromium.org> Cr-Commit-Position: refs/heads/master@{#577962}
ed031ddf