Avoid null check on LayerTreeHost, stop passing stack pointer to heap
The LatencyInfoSwapPromiseMonitors do not need to be heap allocated, they are destroyed within the same stack frame where they are created but they are put on the heap because the LayerTreeHost is treated as being possibly null. The LayerTreeHost would only be null if the RenderWidget is closing, and an IPC is received on the handler through some other channel. Instead, don't call to the handler from RenderWidget::HandleInputEvent if the RenderWidget is closing. Then no null checks are needed, and the LatencyInfoSwapPromiseMonitors can be created on the stack. Also narrow their lifetime to just be around the method call that they are monitoring, for clarity. R=avi@chromium.org Bug: 994926 Change-Id: I47a04f248479a6266fba673ea0a2e98ce1671e66 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1812915Reviewed-by:Avi Drissman <avi@chromium.org> Commit-Queue: danakj <danakj@chromium.org> Cr-Commit-Position: refs/heads/master@{#698489}
Showing
Please register or sign in to comment