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

Side by Side Diff: ui/compositor/layer_animation_observer.cc

Issue 10882043: Revert 153291 - Fixes crash introduced @ 153047 (you can hit crash by maximizing a (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/compositor/layer_animation_observer.h ('k') | ui/compositor/layer_animator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/compositor/layer_animation_observer.h" 5 #include "ui/compositor/layer_animation_observer.h"
6 6
7 #include "ui/compositor/layer_animation_sequence.h" 7 #include "ui/compositor/layer_animation_sequence.h"
8 8
9 namespace ui { 9 namespace ui {
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 if (attached_sequences_.find(sequence) != attached_sequences_.end()) 49 if (attached_sequences_.find(sequence) != attached_sequences_.end())
50 attached_sequences_.erase(sequence); 50 attached_sequences_.erase(sequence);
51 if (send_notification) 51 if (send_notification)
52 OnDetachedFromSequence(sequence); 52 OnDetachedFromSequence(sequence);
53 } 53 }
54 54
55 //////////////////////////////////////////////////////////////////////////////// 55 ////////////////////////////////////////////////////////////////////////////////
56 // ImplicitAnimationObserver 56 // ImplicitAnimationObserver
57 57
58 ImplicitAnimationObserver::ImplicitAnimationObserver() 58 ImplicitAnimationObserver::ImplicitAnimationObserver()
59 : active_(false), 59 : active_(false) {
60 destroyed_(NULL) {
61 } 60 }
62 61
63 ImplicitAnimationObserver::~ImplicitAnimationObserver() { 62 ImplicitAnimationObserver::~ImplicitAnimationObserver() {}
64 if (destroyed_)
65 *destroyed_ = true;
66 }
67 63
68 void ImplicitAnimationObserver::SetActive(bool active) { 64 void ImplicitAnimationObserver::SetActive(bool active) {
69 active_ = active; 65 active_ = active;
70 CheckCompleted(); 66 CheckCompleted();
71 } 67 }
72 68
73 void ImplicitAnimationObserver::StopObservingImplicitAnimations() { 69 void ImplicitAnimationObserver::StopObservingImplicitAnimations() {
74 SetActive(false); 70 SetActive(false);
75 StopObserving(); 71 StopObserving();
76 } 72 }
77 73
78 void ImplicitAnimationObserver::OnLayerAnimationEnded( 74 void ImplicitAnimationObserver::OnLayerAnimationEnded(
79 LayerAnimationSequence* sequence) { 75 LayerAnimationSequence* sequence) {
80 bool destroyed = false;
81 destroyed_ = &destroyed;
82 sequence->RemoveObserver(this); 76 sequence->RemoveObserver(this);
83 if (destroyed)
84 return;
85 destroyed_ = NULL;
86 DCHECK(attached_sequences().find(sequence) == attached_sequences().end()); 77 DCHECK(attached_sequences().find(sequence) == attached_sequences().end());
87 CheckCompleted(); 78 CheckCompleted();
88 } 79 }
89 80
90 void ImplicitAnimationObserver::OnLayerAnimationAborted( 81 void ImplicitAnimationObserver::OnLayerAnimationAborted(
91 LayerAnimationSequence* sequence) { 82 LayerAnimationSequence* sequence) {
92 sequence->RemoveObserver(this); 83 sequence->RemoveObserver(this);
93 DCHECK(attached_sequences().find(sequence) == attached_sequences().end()); 84 DCHECK(attached_sequences().find(sequence) == attached_sequences().end());
94 CheckCompleted(); 85 CheckCompleted();
95 } 86 }
(...skipping 13 matching lines...) Expand all
109 } 100 }
110 101
111 void ImplicitAnimationObserver::CheckCompleted() { 102 void ImplicitAnimationObserver::CheckCompleted() {
112 if (active_ && attached_sequences().empty()) { 103 if (active_ && attached_sequences().empty()) {
113 OnImplicitAnimationsCompleted(); 104 OnImplicitAnimationsCompleted();
114 active_ = false; 105 active_ = false;
115 } 106 }
116 } 107 }
117 108
118 } // namespace ui 109 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/layer_animation_observer.h ('k') | ui/compositor/layer_animator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698