DescriptionI had originally tried to build upon http://codereview.chromium.org/10869066/, but the number of functions that needed to return (or needed to cope with) DestroyedType's was spiralling out of control and it seemed likely that a mistake would be made and bugs introduced. pkotwicz suggested I make the layer animator ref counted, and this seemed to be a much simpler and safer approach. This way, whenever we're in a LayerAnimator function that may notify observers, we create a scoped_refptr<LayerAnimator> for |this|. If the animator's owning layer gets deleted by an observer, then |this| will be safely destroyed when the function exits and the scoped_refptr falls out of scope.
BUG=
TEST=LayerAnimatorTest.ObserverDeletesAnimatorAfter[FinishingAnimation|StoppingAnimation|Scheduling|Aborted]
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=156318
Patch Set 1 #Patch Set 2 : . #Patch Set 3 : Fixing the unit tests. #
Messages
Total messages: 11 (0 generated)
|