Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1670)

Unified Diff: ui/compositor/layer_animator.cc

Issue 795113002: compositor/layer_animator: handle delegate removal in LayerAnimation::StopAnimating (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More fixups for test Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/compositor/layer_animator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer_animator.cc
diff --git a/ui/compositor/layer_animator.cc b/ui/compositor/layer_animator.cc
index 39585a7c946e5a7656d46f02739826e1754e8a69..adff73fe89afe1be63b1d5f930a468b9f5be4d9f 100644
--- a/ui/compositor/layer_animator.cc
+++ b/ui/compositor/layer_animator.cc
@@ -409,7 +409,7 @@ void LayerAnimator::Step(base::TimeTicks now) {
void LayerAnimator::StopAnimatingInternal(bool abort) {
scoped_refptr<LayerAnimator> retain(this);
- while (is_animating()) {
+ while (is_animating() && delegate()) {
// We're going to attempt to finish the first running animation. Let's
// ensure that it's valid.
PurgeDeletedAnimations();
@@ -517,6 +517,8 @@ void LayerAnimator::FinishAnimation(
sequence->Abort(delegate());
else
ProgressAnimationToEnd(sequence);
+ if (!delegate())
+ return;
ProcessQueue();
UpdateAnimationState();
}
« no previous file with comments | « no previous file | ui/compositor/layer_animator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698