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

Unified Diff: Source/core/animation/Animation.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: Build fix Created 5 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
Index: Source/core/animation/Animation.cpp
diff --git a/Source/core/animation/Animation.cpp b/Source/core/animation/Animation.cpp
index 1d829a2102657783b14fea11664c07f80e8b1720..872f43b5aeeeecb5effde1ce964c65aac0a2997c 100644
--- a/Source/core/animation/Animation.cpp
+++ b/Source/core/animation/Animation.cpp
@@ -49,26 +49,26 @@
namespace blink {
-PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* target, PassRefPtrWillBeRawPtr<AnimationEffect> effect, const Timing& timing, Priority priority, PassOwnPtrWillBeRawPtr<EventDelegate> eventDelegate)
+Animation* Animation::create(Element* target, AnimationEffect* effect, const Timing& timing, Priority priority, EventDelegate* eventDelegate)
{
- return adoptRefWillBeNoop(new Animation(target, effect, timing, priority, eventDelegate));
+ return new Animation(target, effect, timing, priority, eventDelegate);
}
-PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, const Vector<Dictionary>& keyframeDictionaryVector, double duration, ExceptionState& exceptionState)
+Animation* Animation::create(Element* element, const Vector<Dictionary>& keyframeDictionaryVector, double duration, ExceptionState& exceptionState)
{
ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
if (element)
UseCounter::count(element->document(), UseCounter::AnimationConstructorKeyframeListEffectObjectTiming);
return create(element, EffectInput::convert(element, keyframeDictionaryVector, exceptionState), TimingInput::convert(duration));
}
-PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, const Vector<Dictionary>& keyframeDictionaryVector, const AnimationTimingProperties& timingInput, ExceptionState& exceptionState)
+Animation* Animation::create(Element* element, const Vector<Dictionary>& keyframeDictionaryVector, const AnimationTimingProperties& timingInput, ExceptionState& exceptionState)
{
ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
if (element)
UseCounter::count(element->document(), UseCounter::AnimationConstructorKeyframeListEffectObjectTiming);
return create(element, EffectInput::convert(element, keyframeDictionaryVector, exceptionState), TimingInput::convert(timingInput));
}
-PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, const Vector<Dictionary>& keyframeDictionaryVector, ExceptionState& exceptionState)
+Animation* Animation::create(Element* element, const Vector<Dictionary>& keyframeDictionaryVector, ExceptionState& exceptionState)
{
ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
if (element)
@@ -76,25 +76,17 @@ PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, const Vect
return create(element, EffectInput::convert(element, keyframeDictionaryVector, exceptionState), Timing());
}
-Animation::Animation(Element* target, PassRefPtrWillBeRawPtr<AnimationEffect> effect, const Timing& timing, Priority priority, PassOwnPtrWillBeRawPtr<EventDelegate> eventDelegate)
+Animation::Animation(Element* target, AnimationEffect* effect, const Timing& timing, Priority priority, EventDelegate* eventDelegate)
: AnimationNode(timing, eventDelegate)
, m_target(target)
, m_effect(effect)
, m_sampledEffect(nullptr)
, m_priority(priority)
{
-#if !ENABLE(OILPAN)
- if (m_target)
- m_target->ensureElementAnimations().addAnimation(this);
haraken 2015/05/08 00:13:06 You cannot remove this.
peria 2015/05/08 02:21:20 Acknowledged.
-#endif
}
Animation::~Animation()
{
-#if !ENABLE(OILPAN)
- if (m_target)
- m_target->elementAnimations()->notifyAnimationDestroyed(this);
haraken 2015/05/08 00:13:06 Ditto.
peria 2015/05/08 02:21:20 Acknowledged.
-#endif
}
void Animation::attach(AnimationPlayer* player)
@@ -146,15 +138,15 @@ void Animation::applyEffects()
double iteration = currentIteration();
ASSERT(iteration >= 0);
- OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> interpolations = m_sampledEffect ? m_sampledEffect->mutableInterpolations() : nullptr;
+ HeapVector<Member<Interpolation>>* interpolations = m_sampledEffect ? m_sampledEffect->mutableInterpolations() : nullptr;
// FIXME: Handle iteration values which overflow int.
m_effect->sample(static_cast<int>(iteration), timeFraction(), iterationDuration(), interpolations);
if (m_sampledEffect) {
- m_sampledEffect->setInterpolations(interpolations.release());
+ m_sampledEffect->setInterpolations(interpolations);
} else if (interpolations && !interpolations->isEmpty()) {
- OwnPtrWillBeRawPtr<SampledEffect> sampledEffect = SampledEffect::create(this, interpolations.release());
- m_sampledEffect = sampledEffect.get();
- ensureAnimationStack(m_target).add(sampledEffect.release());
+ SampledEffect* sampledEffect = SampledEffect::create(this, interpolations);
+ m_sampledEffect = sampledEffect;
+ ensureAnimationStack(m_target).add(sampledEffect);
} else {
return;
}
@@ -223,21 +215,6 @@ double Animation::calculateTimeToEffectChange(bool forwards, double localTime, d
}
}
-#if !ENABLE(OILPAN)
-void Animation::notifyElementDestroyed()
haraken 2015/05/08 00:13:06 Ditto.
peria 2015/05/08 02:21:20 Acknowledged.
-{
- // 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 = nullptr;
- clearEventDelegate();
- SampledEffect* sampledEffect = m_sampledEffect;
- m_sampledEffect = nullptr;
- if (sampledEffect)
- sampledEffect->clear();
-}
-#endif
-
bool Animation::isCandidateForAnimationOnCompositor(double playerPlaybackRate) const
{
if (!effect()

Powered by Google App Engine
This is Rietveld 408576698