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

Unified Diff: cc/animation/animation_host.h

Issue 1894023002: CC Animation: Make ElementAnimations a ref-counted object. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « no previous file | cc/animation/animation_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/animation_host.h
diff --git a/cc/animation/animation_host.h b/cc/animation/animation_host.h
index f2ce2ac758f2de9674ddcb8aea05f5f999e40e5c..04d5989c23dd239c6bbf445c6650371889fe2340 100644
--- a/cc/animation/animation_host.h
+++ b/cc/animation/animation_host.h
@@ -61,7 +61,8 @@ class CC_EXPORT AnimationHost {
void RegisterPlayerForLayer(int layer_id, AnimationPlayer* player);
void UnregisterPlayerForLayer(int layer_id, AnimationPlayer* player);
- ElementAnimations* GetElementAnimationsForLayerId(int layer_id) const;
+ scoped_refptr<ElementAnimations> GetElementAnimationsForLayerId(
+ int layer_id) const;
// TODO(loyso): Get rid of LayerAnimationController.
LayerAnimationController* GetControllerForLayerId(int layer_id) const;
@@ -179,11 +180,10 @@ class CC_EXPORT AnimationHost {
void EraseTimeline(scoped_refptr<AnimationTimeline> timeline);
- // TODO(loyso): For now AnimationPlayers share LayerAnimationController object
- // if they are attached to the same element(layer). Note that Element can
- // contain many Layers.
+ // AnimationPlayers share ElementAnimations object if they are attached to the
+ // same element(layer). Note that Element can contain many Layers.
using LayerToElementAnimationsMap =
- std::unordered_map<int, std::unique_ptr<ElementAnimations>>;
+ std::unordered_map<int, scoped_refptr<ElementAnimations>>;
LayerToElementAnimationsMap layer_to_element_animations_map_;
// A list of all timelines which this host owns.
« no previous file with comments | « no previous file | cc/animation/animation_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698