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

Side by Side 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: Remove AnimationTimeline pre-finalizer Created 4 years, 4 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 unified diff | Download patch
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 885 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 896
897 void Animation::endUpdatingState() 897 void Animation::endUpdatingState()
898 { 898 {
899 ASSERT(m_stateIsBeingUpdated); 899 ASSERT(m_stateIsBeingUpdated);
900 m_stateIsBeingUpdated = false; 900 m_stateIsBeingUpdated = false;
901 } 901 }
902 902
903 void Animation::createCompositorPlayer() 903 void Animation::createCompositorPlayer()
904 { 904 {
905 if (Platform::current()->isThreadedAnimationEnabled() && !m_compositorPlayer ) { 905 if (Platform::current()->isThreadedAnimationEnabled() && !m_compositorPlayer ) {
906 // We only need to pre-finalize if we are running animations on the comp ositor.
907 ThreadState::current()->registerPreFinalizer(this);
908
906 ASSERT(Platform::current()->compositorSupport()); 909 ASSERT(Platform::current()->compositorSupport());
907 m_compositorPlayer = CompositorAnimationPlayer::create(); 910 m_compositorPlayer = CompositorAnimationPlayer::create();
908 ASSERT(m_compositorPlayer); 911 ASSERT(m_compositorPlayer);
909 m_compositorPlayer->setAnimationDelegate(this); 912 m_compositorPlayer->setAnimationDelegate(this);
910 attachCompositorTimeline(); 913 attachCompositorTimeline();
911 } 914 }
912 915
913 attachCompositedLayers(); 916 attachCompositedLayers();
914 } 917 }
915 918
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
1093 visitor->trace(m_timeline); 1096 visitor->trace(m_timeline);
1094 visitor->trace(m_pendingFinishedEvent); 1097 visitor->trace(m_pendingFinishedEvent);
1095 visitor->trace(m_pendingCancelledEvent); 1098 visitor->trace(m_pendingCancelledEvent);
1096 visitor->trace(m_finishedPromise); 1099 visitor->trace(m_finishedPromise);
1097 visitor->trace(m_readyPromise); 1100 visitor->trace(m_readyPromise);
1098 EventTargetWithInlineData::trace(visitor); 1101 EventTargetWithInlineData::trace(visitor);
1099 ActiveDOMObject::trace(visitor); 1102 ActiveDOMObject::trace(visitor);
1100 } 1103 }
1101 1104
1102 } // namespace blink 1105 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698