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

Side by Side Diff: third_party/WebKit/Source/core/animation/Animation.cpp

Issue 2535793002: Revert of Blink Animation: Extend Animation's GC lifetime if it has a finish promise. (Closed)
Patch Set: Created 4 years 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 643
644 const AtomicString& Animation::interfaceName() const { 644 const AtomicString& Animation::interfaceName() const {
645 return EventTargetNames::AnimationPlayer; 645 return EventTargetNames::AnimationPlayer;
646 } 646 }
647 647
648 ExecutionContext* Animation::getExecutionContext() const { 648 ExecutionContext* Animation::getExecutionContext() const {
649 return ActiveDOMObject::getExecutionContext(); 649 return ActiveDOMObject::getExecutionContext();
650 } 650 }
651 651
652 bool Animation::hasPendingActivity() const { 652 bool Animation::hasPendingActivity() const {
653 bool hasPendingPromise = 653 return m_pendingFinishedEvent ||
654 m_finishedPromise &&
655 m_finishedPromise->getState() == ScriptPromisePropertyBase::Pending;
656
657 return m_pendingFinishedEvent || hasPendingPromise ||
658 (!m_finished && hasEventListeners(EventTypeNames::finish)); 654 (!m_finished && hasEventListeners(EventTypeNames::finish));
659 } 655 }
660 656
661 void Animation::contextDestroyed() { 657 void Animation::contextDestroyed() {
662 PlayStateUpdateScope updateScope(*this, TimingUpdateOnDemand); 658 PlayStateUpdateScope updateScope(*this, TimingUpdateOnDemand);
663 659
664 m_finished = true; 660 m_finished = true;
665 m_pendingFinishedEvent = nullptr; 661 m_pendingFinishedEvent = nullptr;
666 } 662 }
667 663
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
1118 visitor->trace(m_timeline); 1114 visitor->trace(m_timeline);
1119 visitor->trace(m_pendingFinishedEvent); 1115 visitor->trace(m_pendingFinishedEvent);
1120 visitor->trace(m_pendingCancelledEvent); 1116 visitor->trace(m_pendingCancelledEvent);
1121 visitor->trace(m_finishedPromise); 1117 visitor->trace(m_finishedPromise);
1122 visitor->trace(m_readyPromise); 1118 visitor->trace(m_readyPromise);
1123 EventTargetWithInlineData::trace(visitor); 1119 EventTargetWithInlineData::trace(visitor);
1124 ActiveDOMObject::trace(visitor); 1120 ActiveDOMObject::trace(visitor);
1125 } 1121 }
1126 1122
1127 } // namespace blink 1123 } // namespace blink
OLDNEW
« 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