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

Unified Diff: Source/core/animation/Animation.cpp

Issue 225073004: Oilpan: Completely move core/animations/ to oilpan's heap (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 | « Source/core/animation/Animation.h ('k') | Source/core/animation/AnimationPlayer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/Animation.cpp
diff --git a/Source/core/animation/Animation.cpp b/Source/core/animation/Animation.cpp
index fd325c1cb714640d6a37f30e0c1aa9012b5c865f..ae76eba8481c0d359b9843d589462fdca0666100 100644
--- a/Source/core/animation/Animation.cpp
+++ b/Source/core/animation/Animation.cpp
@@ -46,41 +46,41 @@
namespace WebCore {
-PassRefPtr<Animation> Animation::create(Element* target, PassRefPtrWillBeRawPtr<AnimationEffect> effect, const Timing& timing, Priority priority, PassOwnPtr<EventDelegate> eventDelegate)
+PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* target, PassRefPtrWillBeRawPtr<AnimationEffect> effect, const Timing& timing, Priority priority, PassOwnPtr<EventDelegate> eventDelegate)
{
- return adoptRef(new Animation(target, effect, timing, priority, eventDelegate));
+ return adoptRefWillBeNoop(new Animation(target, effect, timing, priority, eventDelegate));
}
-PassRefPtr<Animation> Animation::create(Element* element, PassRefPtrWillBeRawPtr<AnimationEffect> effect, const Dictionary& timingInputDictionary)
+PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, PassRefPtrWillBeRawPtr<AnimationEffect> effect, const Dictionary& timingInputDictionary)
{
ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
return create(element, effect, TimingInput::convert(timingInputDictionary));
}
-PassRefPtr<Animation> Animation::create(Element* element, PassRefPtrWillBeRawPtr<AnimationEffect> effect, double duration)
+PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, PassRefPtrWillBeRawPtr<AnimationEffect> effect, double duration)
{
ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
return create(element, effect, TimingInput::convert(duration));
}
-PassRefPtr<Animation> Animation::create(Element* element, PassRefPtrWillBeRawPtr<AnimationEffect> effect)
+PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, PassRefPtrWillBeRawPtr<AnimationEffect> effect)
{
ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
return create(element, effect, Timing());
}
-PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionary>& keyframeDictionaryVector, const Dictionary& timingInputDictionary, ExceptionState& exceptionState)
+PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, const Vector<Dictionary>& keyframeDictionaryVector, const Dictionary& timingInputDictionary, ExceptionState& exceptionState)
{
ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
if (element)
UseCounter::count(element->document(), UseCounter::AnimationConstructorKeyframeListEffectObjectTiming);
return create(element, EffectInput::convert(element, keyframeDictionaryVector, exceptionState), TimingInput::convert(timingInputDictionary));
}
-PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionary>& keyframeDictionaryVector, double duration, ExceptionState& exceptionState)
+PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, const Vector<Dictionary>& keyframeDictionaryVector, double duration, ExceptionState& exceptionState)
{
ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
if (element)
UseCounter::count(element->document(), UseCounter::AnimationConstructorKeyframeListEffectDoubleTiming);
return create(element, EffectInput::convert(element, keyframeDictionaryVector, exceptionState), TimingInput::convert(duration));
}
-PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionary>& keyframeDictionaryVector, ExceptionState& exceptionState)
+PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, const Vector<Dictionary>& keyframeDictionaryVector, ExceptionState& exceptionState)
{
ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
if (element)
@@ -92,33 +92,39 @@ Animation::Animation(Element* target, PassRefPtrWillBeRawPtr<AnimationEffect> ef
: TimedItem(timing, eventDelegate)
, m_target(target)
, m_effect(effect)
- , m_sampledEffect(0)
+ , m_sampledEffect(nullptr)
, m_priority(priority)
{
+#if !ENABLE(OILPAN)
if (m_target)
m_target->ensureActiveAnimations().addAnimation(this);
+#endif
}
Animation::~Animation()
{
+#if !ENABLE(OILPAN)
if (m_target)
m_target->activeAnimations()->notifyAnimationDestroyed(this);
+#endif
}
-void Animation::didAttach()
+void Animation::attach(AnimationPlayer* player)
{
if (m_target) {
- m_target->ensureActiveAnimations().addPlayer(player());
+ m_target->ensureActiveAnimations().addPlayer(player);
m_target->setNeedsAnimationStyleRecalc();
}
+ TimedItem::attach(player);
}
-void Animation::willDetach()
+void Animation::detach()
{
if (m_target)
m_target->activeAnimations()->removePlayer(player());
if (m_sampledEffect)
clearEffects();
+ TimedItem::detach();
}
void Animation::specifiedTimingChanged()
@@ -150,7 +156,7 @@ void Animation::applyEffects()
if (m_sampledEffect) {
m_sampledEffect->setInterpolations(interpolations.release());
} else if (!interpolations->isEmpty()) {
- OwnPtr<SampledEffect> sampledEffect = SampledEffect::create(this, interpolations.release());
+ OwnPtrWillBeRawPtr<SampledEffect> sampledEffect = SampledEffect::create(this, interpolations.release());
m_sampledEffect = sampledEffect.get();
ensureAnimationStack(m_target).add(sampledEffect.release());
} else {
@@ -166,7 +172,7 @@ void Animation::clearEffects()
ASSERT(m_sampledEffect);
m_sampledEffect->clear();
- m_sampledEffect = 0;
+ m_sampledEffect = nullptr;
cancelAnimationOnCompositor();
m_target->setNeedsAnimationStyleRecalc();
invalidate();
@@ -225,21 +231,23 @@ double Animation::calculateTimeToEffectChange(bool forwards, double localTime, d
void Animation::notifySampledEffectRemovedFromAnimationStack()
{
ASSERT(m_sampledEffect);
- m_sampledEffect = 0;
+ m_sampledEffect = nullptr;
}
+#if !ENABLE(OILPAN)
void Animation::notifyElementDestroyed()
{
// If our player is kept alive just by the sampledEffect, we might get our
// destructor called when we call SampledEffect::clear(), so we need to
// clear m_sampledEffect first.
- m_target = 0;
+ m_target = nullptr;
clearEventDelegate();
SampledEffect* sampledEffect = m_sampledEffect;
- m_sampledEffect = 0;
+ m_sampledEffect = nullptr;
if (sampledEffect)
sampledEffect->clear();
}
+#endif
bool Animation::isCandidateForAnimationOnCompositor() const
{
@@ -300,4 +308,12 @@ void Animation::pauseAnimationForTestingOnCompositor(double pauseTime)
CompositorAnimations::instance()->pauseAnimationForTestingOnCompositor(*m_target, m_compositorAnimationIds[i], pauseTime);
}
+void Animation::trace(Visitor* visitor)
+{
+ visitor->trace(m_target);
+ visitor->trace(m_effect);
+ visitor->trace(m_sampledEffect);
+ TimedItem::trace(visitor);
+}
+
} // namespace WebCore
« no previous file with comments | « Source/core/animation/Animation.h ('k') | Source/core/animation/AnimationPlayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698