Index: cc/animation/animation_host.cc |
diff --git a/cc/animation/animation_host.cc b/cc/animation/animation_host.cc |
index 53f21c72c6709d9116ac681abec612ab9de8340c..eb76c596e181713191b3ff19a52b88a4216ef5f9 100644 |
--- a/cc/animation/animation_host.cc |
+++ b/cc/animation/animation_host.cc |
@@ -128,7 +128,8 @@ void AnimationHost::RegisterPlayerForElement(ElementId element_id, |
if (!element_animations) { |
element_animations = ElementAnimations::Create(); |
element_animations->SetElementId(element_id); |
- RegisterElementAnimations(element_animations.get()); |
+ element_to_animations_map_[element_animations->element_id()] = |
+ element_animations; |
} |
if (element_animations->animation_host() != this) { |
@@ -151,7 +152,8 @@ void AnimationHost::UnregisterPlayerForElement(ElementId element_id, |
if (element_animations->IsEmpty()) { |
element_animations->ClearAffectedElementTypes(); |
- UnregisterElementAnimations(element_animations.get()); |
+ element_to_animations_map_.erase(element_animations->element_id()); |
+ DidDeactivateElementAnimations(element_animations.get()); |
element_animations->SetAnimationHost(nullptr); |
} |
} |
@@ -562,20 +564,6 @@ void AnimationHost::DidDeactivateElementAnimations( |
active_element_to_animations_map_.erase(element_animations->element_id()); |
} |
-void AnimationHost::RegisterElementAnimations( |
- ElementAnimations* element_animations) { |
- DCHECK(element_animations->element_id()); |
- element_to_animations_map_[element_animations->element_id()] = |
- element_animations; |
-} |
- |
-void AnimationHost::UnregisterElementAnimations( |
- ElementAnimations* element_animations) { |
- DCHECK(element_animations->element_id()); |
- element_to_animations_map_.erase(element_animations->element_id()); |
- DidDeactivateElementAnimations(element_animations); |
-} |
- |
const AnimationHost::ElementToAnimationsMap& |
AnimationHost::active_element_animations_for_testing() const { |
return active_element_to_animations_map_; |