RC: Prevent freezing a tab that is being discarded.
Previously, TabManager::PerformStateTransitions() could be called repeatedly and needlessly while a tab is being discarded: - TabManager::PerformStateTransitions() Transitions a LifecycleUnit to PENDING_DISCARD. - TabManager::PerformStateTransitions() Calls CanFreeze() to check if the LifecycleUnit can be frozen. CanFreeze() returns true even though the LifecycleUnit is already being discarded. Calls Freeze(), which transitions the LifecycleUnit to PENDING_FREEZE. Calls CanDiscard() to check if the LifecycleUnit can be discarded. CanDiscard() returns true. Calls Discard(kProactive) to discard the LifecycleUnit. ** Since a LifecycleUnit was discarded, another call to PerformStateTransitions() is scheduled immediately. ** - TabManager::PerformStateTransitions() Called repeatedly until the LifecycleUnit transitions to DISCARDED. This CL fixes the issue by returning false from CanFreeze() and Freeze() for a LifecycleUnit that is being discarded. Bug: 775644 Change-Id: I4de25dfe7d569f61d0eef988b217203eeae6f006 Reviewed-on: https://chromium-review.googlesource.com/1132343Reviewed-by:Will Harris <wfh@chromium.org> Reviewed-by:
Sébastien Marchand <sebmarchand@chromium.org> Commit-Queue: François Doray <fdoray@chromium.org> Cr-Commit-Position: refs/heads/master@{#574158}
Showing
Please register or sign in to comment