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

Unified Diff: third_party/WebKit/Source/platform/animation/CompositorAnimationPlayer.cpp

Issue 1747283004: Blink Compositor Animations: Reset delegate in CC on Blink player deletion. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace DCHECK with detach action. 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/animation/CompositorAnimationPlayer.cpp
diff --git a/third_party/WebKit/Source/platform/animation/CompositorAnimationPlayer.cpp b/third_party/WebKit/Source/platform/animation/CompositorAnimationPlayer.cpp
index 91228292138fdabc01313d00a2fc77de7bce7dcd..819727c41f3610115dc8780307f95a4255c635ce 100644
--- a/third_party/WebKit/Source/platform/animation/CompositorAnimationPlayer.cpp
+++ b/third_party/WebKit/Source/platform/animation/CompositorAnimationPlayer.cpp
@@ -5,6 +5,7 @@
#include "platform/animation/CompositorAnimationPlayer.h"
#include "cc/animation/animation_id_provider.h"
+#include "cc/animation/animation_timeline.h"
#include "platform/animation/CompositorAnimation.h"
#include "platform/animation/CompositorAnimationDelegate.h"
#include "public/platform/WebLayer.h"
@@ -19,6 +20,11 @@ CompositorAnimationPlayer::CompositorAnimationPlayer()
CompositorAnimationPlayer::~CompositorAnimationPlayer()
{
+ setAnimationDelegate(nullptr);
+ // Detach player from timeline, otherwise it stays there (leaks) until
+ // compositor shutdown.
+ if (m_animationPlayer->animation_timeline())
+ m_animationPlayer->animation_timeline()->DetachPlayer(m_animationPlayer);
}
cc::AnimationPlayer* CompositorAnimationPlayer::animationPlayer() const
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698