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

Side by Side Diff: Source/core/animation/ElementAnimations.cpp

Issue 1120003002: [Oilpan] Migrate most classes under core/animations to Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Resize expect size of Persistent Created 5 years, 6 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
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 24 matching lines...) Expand all
35 35
36 namespace blink { 36 namespace blink {
37 37
38 ElementAnimations::ElementAnimations() 38 ElementAnimations::ElementAnimations()
39 : m_animationStyleChange(false) 39 : m_animationStyleChange(false)
40 { 40 {
41 } 41 }
42 42
43 ElementAnimations::~ElementAnimations() 43 ElementAnimations::~ElementAnimations()
44 { 44 {
45 #if !ENABLE(OILPAN)
46 for (KeyframeEffect* effect : m_effects)
47 effect->notifyElementDestroyed();
48 m_effects.clear();
49 #endif
50 } 45 }
51 46
52 void ElementAnimations::updateAnimationFlags(ComputedStyle& style) 47 void ElementAnimations::updateAnimationFlags(ComputedStyle& style)
53 { 48 {
54 for (const auto& entry : m_animations) { 49 for (const auto& entry : m_animations) {
55 const Animation& animation = *entry.key; 50 const Animation& animation = *entry.key;
56 ASSERT(animation.source()); 51 ASSERT(animation.source());
57 // FIXME: Needs to consider AnimationGroup once added. 52 // FIXME: Needs to consider AnimationGroup once added.
58 ASSERT(animation.source()->isAnimation()); 53 ASSERT(animation.source()->isAnimation());
59 const KeyframeEffect& effect = *toKeyframeEffect(animation.source()); 54 const KeyframeEffect& effect = *toKeyframeEffect(animation.source());
(...skipping 16 matching lines...) Expand all
76 } 71 }
77 72
78 void ElementAnimations::restartAnimationOnCompositor() 73 void ElementAnimations::restartAnimationOnCompositor()
79 { 74 {
80 for (const auto& entry : m_animations) 75 for (const auto& entry : m_animations)
81 entry.key->restartAnimationOnCompositor(); 76 entry.key->restartAnimationOnCompositor();
82 } 77 }
83 78
84 DEFINE_TRACE(ElementAnimations) 79 DEFINE_TRACE(ElementAnimations)
85 { 80 {
86 #if ENABLE(OILPAN)
87 visitor->trace(m_cssAnimations); 81 visitor->trace(m_cssAnimations);
88 visitor->trace(m_defaultStack); 82 visitor->trace(m_defaultStack);
89 visitor->trace(m_animations); 83 visitor->trace(m_animations);
90 #endif
91 } 84 }
92 85
93 const ComputedStyle* ElementAnimations::baseComputedStyle() const 86 const ComputedStyle* ElementAnimations::baseComputedStyle() const
94 { 87 {
95 #if !ENABLE(ASSERT) 88 #if !ENABLE(ASSERT)
96 if (isAnimationStyleChange()) 89 if (isAnimationStyleChange())
97 return m_baseComputedStyle.get(); 90 return m_baseComputedStyle.get();
98 #endif 91 #endif
99 return nullptr; 92 return nullptr;
100 } 93 }
(...skipping 21 matching lines...) Expand all
122 // TODO(rune@opera.com): The FontFaceCache version number may be increased w ithout forcing 115 // TODO(rune@opera.com): The FontFaceCache version number may be increased w ithout forcing
123 // a style recalc (see crbug.com/471079). ComputedStyle objects created with different cache 116 // a style recalc (see crbug.com/471079). ComputedStyle objects created with different cache
124 // versions will not be considered equal as Font::operator== will compare ve rsions, hence 117 // versions will not be considered equal as Font::operator== will compare ve rsions, hence
125 // ComputedStyle::operator== will return false. We avoid using baseComputedS tyle (the check for 118 // ComputedStyle::operator== will return false. We avoid using baseComputedS tyle (the check for
126 // isFallbackValid()) in that case to avoid triggering the ComputedStyle com parison ASSERT 119 // isFallbackValid()) in that case to avoid triggering the ComputedStyle com parison ASSERT
127 // in updateBaseComputedStyle. 120 // in updateBaseComputedStyle.
128 return m_animationStyleChange && (!m_baseComputedStyle || m_baseComputedStyl e->font().isFallbackValid()); 121 return m_animationStyleChange && (!m_baseComputedStyle || m_baseComputedStyl e->font().isFallbackValid());
129 } 122 }
130 123
131 } // namespace blink 124 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698