[FCP++] Text: Replace node_id with LayoutObject* - part 1
FCP++ is currently using node_id to track a layout object. But we should use LayoutObject* instead to track the nodes. The replacement will be more efficient and avoid the generation of node id. After we use layout object* in text record, we start to get a risk of UAF. UAF happens when we stop recording, block the LayoutObject removal hook by is_recording_, and use LayoutObject* in PopulateTraceValue. The fix to it is to clear up everything We also noticed a risk of using |this| in two callback functions, but it proved to be not a real risk in crbug.com/976357 |cached_largest_paint_candidate_| was raw pointer. It's better to be a WeakPtr so no risk of becoming a dead pointer. Note that this CL is mainly to replace node_id with LayoutObject* in TextPaintTimingDetector's sets & maps. A subsequent patch will be made to replace node with LayoutObject in the control logic of TextPaintTimingDetector. And do the same thing for ImagePaintTimingDetector. Bug:967837 Change-Id: Iba0496cfca3f5056724c3267ec10226913d4e70e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1649467 Commit-Queue: Liquan (Max) Gu <maxlg@chromium.org> Reviewed-by:Xianzhu Wang <wangxianzhu@chromium.org> Cr-Commit-Position: refs/heads/master@{#671360}
Showing
This diff is collapsed.
Please register or sign in to comment