Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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) | |
|
sof
2015/09/03 05:21:46
Aren't you touching a heap object here?
And how a
| |
| 47 effect->notifyElementDestroyed(); | |
| 48 m_effects.clear(); | |
| 49 #endif | |
| 45 } | 50 } |
| 46 | 51 |
| 47 void ElementAnimations::updateAnimationFlags(ComputedStyle& style) | 52 void ElementAnimations::updateAnimationFlags(ComputedStyle& style) |
| 48 { | 53 { |
| 49 for (const auto& entry : m_animations) { | 54 for (const auto& entry : m_animations) { |
| 50 const Animation& animation = *entry.key; | 55 const Animation& animation = *entry.key; |
| 51 ASSERT(animation.effect()); | 56 ASSERT(animation.effect()); |
| 52 // FIXME: Needs to consider AnimationGroup once added. | 57 // FIXME: Needs to consider AnimationGroup once added. |
| 53 ASSERT(animation.effect()->isAnimation()); | 58 ASSERT(animation.effect()->isAnimation()); |
| 54 const KeyframeEffect& effect = *toKeyframeEffect(animation.effect()); | 59 const KeyframeEffect& effect = *toKeyframeEffect(animation.effect()); |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 81 { | 86 { |
| 82 for (const auto& entry : m_animations) | 87 for (const auto& entry : m_animations) |
| 83 entry.key->restartAnimationOnCompositor(); | 88 entry.key->restartAnimationOnCompositor(); |
| 84 } | 89 } |
| 85 | 90 |
| 86 DEFINE_TRACE(ElementAnimations) | 91 DEFINE_TRACE(ElementAnimations) |
| 87 { | 92 { |
| 88 visitor->trace(m_cssAnimations); | 93 visitor->trace(m_cssAnimations); |
| 89 visitor->trace(m_defaultStack); | 94 visitor->trace(m_defaultStack); |
| 90 visitor->trace(m_animations); | 95 visitor->trace(m_animations); |
| 96 #if !ENABLE(OILPAN) | |
| 97 visitor->trace(m_effects); | |
| 98 #endif | |
| 91 } | 99 } |
| 92 | 100 |
| 93 const ComputedStyle* ElementAnimations::baseComputedStyle() const | 101 const ComputedStyle* ElementAnimations::baseComputedStyle() const |
| 94 { | 102 { |
| 95 #if !ENABLE(ASSERT) | 103 #if !ENABLE(ASSERT) |
| 96 if (isAnimationStyleChange()) | 104 if (isAnimationStyleChange()) |
| 97 return m_baseComputedStyle.get(); | 105 return m_baseComputedStyle.get(); |
| 98 #endif | 106 #endif |
| 99 return nullptr; | 107 return nullptr; |
| 100 } | 108 } |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 122 // TODO(rune@opera.com): The FontFaceCache version number may be increased w ithout forcing | 130 // 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 | 131 // 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 | 132 // 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 | 133 // 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 | 134 // isFallbackValid()) in that case to avoid triggering the ComputedStyle com parison ASSERT |
| 127 // in updateBaseComputedStyle. | 135 // in updateBaseComputedStyle. |
| 128 return m_animationStyleChange && (!m_baseComputedStyle || m_baseComputedStyl e->font().isFallbackValid()); | 136 return m_animationStyleChange && (!m_baseComputedStyle || m_baseComputedStyl e->font().isFallbackValid()); |
| 129 } | 137 } |
| 130 | 138 |
| 131 } // namespace blink | 139 } // namespace blink |
| OLD | NEW |