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

Side by Side Diff: Source/core/animation/ActiveAnimations.h

Issue 425903003: Use HeapHashCountedSet for AnimationPlayerCountedSet (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 | « no previous file | Source/core/animation/ActiveAnimations.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 26 matching lines...) Expand all
37 #include "wtf/HashMap.h" 37 #include "wtf/HashMap.h"
38 #include "wtf/RefPtr.h" 38 #include "wtf/RefPtr.h"
39 #include "wtf/Vector.h" 39 #include "wtf/Vector.h"
40 40
41 namespace blink { 41 namespace blink {
42 42
43 class CSSAnimations; 43 class CSSAnimations;
44 class RenderObject; 44 class RenderObject;
45 class Element; 45 class Element;
46 46
47 typedef WillBeHeapHashMap<RawPtrWillBeWeakMember<AnimationPlayer>, int> Animatio nPlayerCountedSet; 47 typedef WillBeHeapHashCountedSet<RawPtrWillBeWeakMember<AnimationPlayer> > Anima tionPlayerCountedSet;
48 48
49 class ActiveAnimations : public NoBaseWillBeGarbageCollectedFinalized<ActiveAnim ations> { 49 class ActiveAnimations : public NoBaseWillBeGarbageCollectedFinalized<ActiveAnim ations> {
50 WTF_MAKE_NONCOPYABLE(ActiveAnimations); 50 WTF_MAKE_NONCOPYABLE(ActiveAnimations);
51 public: 51 public:
52 ActiveAnimations() 52 ActiveAnimations()
53 : m_animationStyleChange(false) 53 : m_animationStyleChange(false)
54 { 54 {
55 } 55 }
56 56
57 ~ActiveAnimations(); 57 ~ActiveAnimations();
58 58
59 // Animations that are currently active for this element, their effects will be applied 59 // Animations that are currently active for this element, their effects will be applied
60 // during a style recalc. CSS Transitions are included in this stack. 60 // during a style recalc. CSS Transitions are included in this stack.
61 AnimationStack& defaultStack() { return m_defaultStack; } 61 AnimationStack& defaultStack() { return m_defaultStack; }
62 const AnimationStack& defaultStack() const { return m_defaultStack; } 62 const AnimationStack& defaultStack() const { return m_defaultStack; }
63 // Tracks the state of active CSS Animations and Transitions. The individual animations 63 // Tracks the state of active CSS Animations and Transitions. The individual animations
64 // will also be part of the default stack, but the mapping betwen animation name and 64 // will also be part of the default stack, but the mapping betwen animation name and
65 // player is kept here. 65 // player is kept here.
66 CSSAnimations& cssAnimations() { return m_cssAnimations; } 66 CSSAnimations& cssAnimations() { return m_cssAnimations; }
67 const CSSAnimations& cssAnimations() const { return m_cssAnimations; } 67 const CSSAnimations& cssAnimations() const { return m_cssAnimations; }
68 68
69 // AnimationPlayers which have animations targeting this element. 69 // AnimationPlayers which have animations targeting this element.
70 const AnimationPlayerCountedSet& players() const { return m_players; } 70 AnimationPlayerCountedSet& players() { return m_players; }
71 void addPlayer(AnimationPlayer*);
72 void removePlayer(AnimationPlayer*);
73 71
74 #if ENABLE(OILPAN) 72 #if ENABLE(OILPAN)
75 bool isEmpty() const { return m_defaultStack.isEmpty() && m_cssAnimations.is Empty(); } 73 bool isEmpty() const { return m_defaultStack.isEmpty() && m_cssAnimations.is Empty(); }
76 #else 74 #else
77 bool isEmpty() const { return m_defaultStack.isEmpty() && m_cssAnimations.is Empty() && m_animations.isEmpty(); } 75 bool isEmpty() const { return m_defaultStack.isEmpty() && m_cssAnimations.is Empty() && m_animations.isEmpty(); }
78 #endif 76 #endif
79 77
80 void cancelAnimationOnCompositor(); 78 void cancelAnimationOnCompositor();
81 79
82 void updateAnimationFlags(RenderStyle&); 80 void updateAnimationFlags(RenderStyle&);
(...skipping 20 matching lines...) Expand all
103 Vector<Animation*> m_animations; 101 Vector<Animation*> m_animations;
104 #endif 102 #endif
105 103
106 // CSSAnimations checks if a style change is due to animation. 104 // CSSAnimations checks if a style change is due to animation.
107 friend class CSSAnimations; 105 friend class CSSAnimations;
108 }; 106 };
109 107
110 } // namespace blink 108 } // namespace blink
111 109
112 #endif 110 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/animation/ActiveAnimations.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698