Skip to content
Commit 43af2894 authored by Xiyuan Xia's avatar Xiyuan Xia Committed by Chromium LUCI CQ
Browse files

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: default avatarPeter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarDana Fried <dfried@chromium.org>
Cr-Commit-Position: refs/heads/main@{#999429}
parent 5e1292d8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment