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

Unified Diff: ui/compositor/layer_animator.h

Issue 10869066: Attempt 2 at Fixes crash introduced @ 153047 (you can hit crash by maximizing a (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Better fix Created 8 years, 3 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
Index: ui/compositor/layer_animator.h
diff --git a/ui/compositor/layer_animator.h b/ui/compositor/layer_animator.h
index 3c9a087128489f31dc3fc157fdc0bc031f7bed47..6de0b9267e62699f4412535a25a5ccd93a22b24e 100644
--- a/ui/compositor/layer_animator.h
+++ b/ui/compositor/layer_animator.h
@@ -10,6 +10,7 @@
#include "base/compiler_specific.h"
#include "base/memory/linked_ptr.h"
+#include "base/memory/ref_counted.h"
#include "base/observer_list.h"
#include "base/time.h"
#include "ui/base/animation/animation_container_element.h"
@@ -186,6 +187,14 @@ class COMPOSITOR_EXPORT LayerAnimator : public AnimationContainerElement {
private:
friend class ScopedLayerAnimationSettings;
+ class DestroyedTracker;
+
+ // Used by FinishAnimation() to indicate if this has been destroyed.
+ enum DestroyedType {
+ DESTROYED,
+ NOT_DESTROYED,
+ };
+
// We need to keep track of the start time of every running animation.
struct RunningAnimation {
RunningAnimation(LayerAnimationSequence* sequence,
@@ -215,7 +224,8 @@ class COMPOSITOR_EXPORT LayerAnimator : public AnimationContainerElement {
LayerAnimationSequence* sequence) WARN_UNUSED_RESULT;
// Progresses to the end of the sequence before removing it.
- void FinishAnimation(LayerAnimationSequence* sequence);
+ DestroyedType FinishAnimation(
+ LayerAnimationSequence* sequence) WARN_UNUSED_RESULT;
// Finishes any running animation with zero duration.
void FinishAnyAnimationWithZeroDuration();
@@ -313,6 +323,8 @@ class COMPOSITOR_EXPORT LayerAnimator : public AnimationContainerElement {
// aborted.
ObserverList<LayerAnimationObserver> observers_;
+ scoped_refptr<DestroyedTracker> destroyed_tracker_;
+
DISALLOW_COPY_AND_ASSIGN(LayerAnimator);
};

Powered by Google App Engine
This is Rietveld 408576698