Fix tab hover card overlapping animation edge case
There is one edge case that "TabHoverCardController::HideHoverCard -> WidgetFadeAnimator::FadeOut" could be called with an active fade in animation. WidgetFadeAnimator::Hide would directly close the card widget in such case. However, there is an active ui::ThroughputTracker because of the unfinished fade-in animation. Stop() would be triggered twice in WidgetFadeAnimator::FadeOut for the edge case. Once from `fade_complete_callbacks_.Notify` and the other one from WidgetFadeAnimator::OnWidgetDestroying. The 2nd Stop() would cause a crash because the tracker is no longer valid in ui::Compositor. This CL fixes the crash by canceling the pending fade-in animation and resets the tracker for the edge case. Bug: 1317746 Change-Id: I4b726bc704e1d048949d21644c125129732d07c6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3624098 Commit-Queue: Xiyuan Xia <xiyuan@chromium.org> Reviewed-by:Peter Kasting <pkasting@chromium.org> Reviewed-by:
Dana Fried <dfried@chromium.org> Cr-Commit-Position: refs/heads/main@{#999429}
Loading
Please register or sign in to comment