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

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

Issue 1808533003: Revert of Reduce ActiveDOMObjects from core/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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: third_party/WebKit/Source/core/animation/Animation.cpp
diff --git a/third_party/WebKit/Source/core/animation/Animation.cpp b/third_party/WebKit/Source/core/animation/Animation.cpp
index 0a42bfc4d90a0de3320d5d868d02118b664d6e94..eedc832c9708d25adca55b1dc1baee6993a58157 100644
--- a/third_party/WebKit/Source/core/animation/Animation.cpp
+++ b/third_party/WebKit/Source/core/animation/Animation.cpp
@@ -66,15 +66,18 @@
}
Animation* animation = new Animation(timeline->document()->contextDocument().get(), *timeline, effect);
+ animation->suspendIfNeeded();
+
if (timeline) {
timeline->animationAttached(*animation);
animation->attachCompositorTimeline();
}
+
return animation;
}
Animation::Animation(ExecutionContext* executionContext, AnimationTimeline& timeline, AnimationEffect* content)
- : ContextLifecycleObserver(executionContext)
+ : ActiveDOMObject(executionContext)
, m_playState(Idle)
, m_playbackRate(1)
, m_startTime(nullValue())
@@ -637,7 +640,7 @@
ExecutionContext* Animation::executionContext() const
{
- return ContextLifecycleObserver::executionContext();
+ return ActiveDOMObject::executionContext();
}
bool Animation::hasPendingActivity() const
@@ -645,7 +648,7 @@
return m_pendingFinishedEvent || (!m_finished && hasEventListeners(EventTypeNames::finish));
}
-void Animation::contextDestroyed()
+void Animation::stop()
{
PlayStateUpdateScope updateScope(*this, TimingUpdateOnDemand);
@@ -1082,7 +1085,7 @@
visitor->trace(m_finishedPromise);
visitor->trace(m_readyPromise);
RefCountedGarbageCollectedEventTargetWithInlineData<Animation>::trace(visitor);
- ContextLifecycleObserver::trace(visitor);
+ ActiveDOMObject::trace(visitor);
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/animation/Animation.h ('k') | third_party/WebKit/Source/core/css/MediaQueryList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698