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

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

Issue 2188623006: Add pre finalizer to Animation to ensure compositor handles get cleaned up (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add bool check Created 4 years, 5 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 | « third_party/WebKit/Source/core/animation/Animation.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 62bb7c8f1af396eea05e5455e3b9f1c75de9b6d8..6fe5a0f1997df8e6a5b63fdd546263ac260e07dc 100644
--- a/third_party/WebKit/Source/core/animation/Animation.cpp
+++ b/third_party/WebKit/Source/core/animation/Animation.cpp
@@ -97,6 +97,7 @@ Animation::Animation(ExecutionContext* executionContext, AnimationTimeline& time
, m_compositorState(nullptr)
, m_compositorPending(false)
, m_compositorGroup(0)
+ , m_preFinalizerRegistered(false)
, m_currentTimePending(false)
, m_stateIsBeingUpdated(false)
, m_effectSuppressed(false)
@@ -903,6 +904,12 @@ void Animation::endUpdatingState()
void Animation::createCompositorPlayer()
{
if (Platform::current()->isThreadedAnimationEnabled() && !m_compositorPlayer) {
+ // We only need to pre-finalize if we are running animations on the compositor.
+ if (!m_preFinalizerRegistered) {
+ ThreadState::current()->registerPreFinalizer(this);
+ m_preFinalizerRegistered = true;
+ }
+
ASSERT(Platform::current()->compositorSupport());
m_compositorPlayer = CompositorAnimationPlayer::create();
ASSERT(m_compositorPlayer);
« no previous file with comments | « third_party/WebKit/Source/core/animation/Animation.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698