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

Issue 10919195: LayerAnimator must be prepared for its owning layer's deletion whenever it notifies observers. (Closed)

Created:
8 years, 3 months ago by Ian Vollick
Modified:
8 years, 3 months ago
Reviewers:
oshima, sky
CC:
chromium-reviews, piman+watch_chromium.org, jonathan.backer, pkotwicz
Visibility:
Public.

Description

I 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. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+348 lines, -148 lines) Patch
M ui/compositor/layer.h View 1 chunk +1 line, -1 line 0 comments Download
M ui/compositor/layer.cc View 1 2 2 chunks +4 lines, -2 lines 0 comments Download
M ui/compositor/layer_animation_sequence.h View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M ui/compositor/layer_animation_sequence.cc View 1 2 2 chunks +7 lines, -4 lines 0 comments Download
M ui/compositor/layer_animator.h View 1 2 7 chunks +20 lines, -17 lines 0 comments Download
M ui/compositor/layer_animator.cc View 1 2 17 chunks +53 lines, -86 lines 0 comments Download
M ui/compositor/layer_animator_unittest.cc View 1 2 33 chunks +257 lines, -35 lines 0 comments Download
M ui/views/view_unittest.cc View 1 2 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
Ian Vollick
8 years, 3 months ago (2012-09-10 19:43:43 UTC) #1
sky
If you go this route, won't it mean observers may outlast the layer?
8 years, 3 months ago (2012-09-10 21:18:53 UTC) #2
Ian Vollick
On 2012/09/10 21:18:53, sky wrote: > If you go this route, won't it mean observers ...
8 years, 3 months ago (2012-09-11 01:30:16 UTC) #3
sky
Fair enough. Please document in layer_animator.h why it's ref counted. LGTM
8 years, 3 months ago (2012-09-11 15:37:02 UTC) #4
Ian Vollick
On 2012/09/11 15:37:02, sky wrote: > Fair enough. Please document in layer_animator.h why it's ref ...
8 years, 3 months ago (2012-09-11 21:02:52 UTC) #5
sky
LGTM
8 years, 3 months ago (2012-09-11 23:00:20 UTC) #6
Ian Vollick
On 2012/09/11 23:00:20, sky wrote: > LGTM I'm sorry for continuing to muck with this ...
8 years, 3 months ago (2012-09-12 03:17:36 UTC) #7
sky
I had a feeling setting the delegate_ to NULL was going to require some additional ...
8 years, 3 months ago (2012-09-12 04:34:14 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/vollick@chromium.org/10919195/7
8 years, 3 months ago (2012-09-12 12:56:48 UTC) #9
commit-bot: I haz the power
Change committed as 156318
8 years, 3 months ago (2012-09-12 17:08:24 UTC) #10
aarya
8 years, 3 months ago (2012-09-23 00:42:26 UTC) #11
On 2012/09/12 17:08:24, I haz the power (commit-bot) wrote:
> Change committed as 156318

you have wrong bug number in the changelog which is causing unrelated comments
on another bug. can you please fix.

Powered by Google App Engine
This is Rietveld 408576698