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

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

Issue 2536523002: Blink Animation: Extend Animation's GC lifetime if it has a finish promise. (Closed)
Patch Set: Fix memory leaks. Created 4 years, 1 month 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/LayoutTests/web-animations-api/animation-finish-promise-gc.html ('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 a65c0b78df8b14bdd0c9e46510832eab27dc8582..bc2efd8eca3daa7d561485734bfec104ea498ca0 100644
--- a/third_party/WebKit/Source/core/animation/Animation.cpp
+++ b/third_party/WebKit/Source/core/animation/Animation.cpp
@@ -651,7 +651,11 @@ ExecutionContext* Animation::getExecutionContext() const {
}
bool Animation::hasPendingActivity() const {
- return m_pendingFinishedEvent ||
+ bool hasPendingPromise =
+ !m_finished && m_finishedPromise &&
+ m_finishedPromise->getState() == ScriptPromisePropertyBase::Pending;
+
+ return m_pendingFinishedEvent || hasPendingPromise ||
(!m_finished && hasEventListeners(EventTypeNames::finish));
}
« no previous file with comments | « third_party/WebKit/LayoutTests/web-animations-api/animation-finish-promise-gc.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698