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

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: Add bool check 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
« no previous file with comments | « third_party/WebKit/Source/core/animation/Animation.h ('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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 , m_timeline(&timeline) 90 , m_timeline(&timeline)
91 , m_paused(false) 91 , m_paused(false)
92 , m_held(false) 92 , m_held(false)
93 , m_isPausedForTesting(false) 93 , m_isPausedForTesting(false)
94 , m_isCompositedAnimationDisabledForTesting(false) 94 , m_isCompositedAnimationDisabledForTesting(false)
95 , m_outdated(false) 95 , m_outdated(false)
96 , m_finished(true) 96 , m_finished(true)
97 , m_compositorState(nullptr) 97 , m_compositorState(nullptr)
98 , m_compositorPending(false) 98 , m_compositorPending(false)
99 , m_compositorGroup(0) 99 , m_compositorGroup(0)
100 , m_preFinalizerRegistered(false)
100 , m_currentTimePending(false) 101 , m_currentTimePending(false)
101 , m_stateIsBeingUpdated(false) 102 , m_stateIsBeingUpdated(false)
102 , m_effectSuppressed(false) 103 , m_effectSuppressed(false)
103 { 104 {
104 if (m_content) { 105 if (m_content) {
105 if (m_content->animation()) { 106 if (m_content->animation()) {
106 m_content->animation()->cancel(); 107 m_content->animation()->cancel();
107 m_content->animation()->setEffect(0); 108 m_content->animation()->setEffect(0);
108 } 109 }
109 m_content->attach(this); 110 m_content->attach(this);
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 897
897 void Animation::endUpdatingState() 898 void Animation::endUpdatingState()
898 { 899 {
899 ASSERT(m_stateIsBeingUpdated); 900 ASSERT(m_stateIsBeingUpdated);
900 m_stateIsBeingUpdated = false; 901 m_stateIsBeingUpdated = false;
901 } 902 }
902 903
903 void Animation::createCompositorPlayer() 904 void Animation::createCompositorPlayer()
904 { 905 {
905 if (Platform::current()->isThreadedAnimationEnabled() && !m_compositorPlayer ) { 906 if (Platform::current()->isThreadedAnimationEnabled() && !m_compositorPlayer ) {
907 // We only need to pre-finalize if we are running animations on the comp ositor.
908 if (!m_preFinalizerRegistered) {
909 ThreadState::current()->registerPreFinalizer(this);
910 m_preFinalizerRegistered = true;
911 }
912
906 ASSERT(Platform::current()->compositorSupport()); 913 ASSERT(Platform::current()->compositorSupport());
907 m_compositorPlayer = CompositorAnimationPlayer::create(); 914 m_compositorPlayer = CompositorAnimationPlayer::create();
908 ASSERT(m_compositorPlayer); 915 ASSERT(m_compositorPlayer);
909 m_compositorPlayer->setAnimationDelegate(this); 916 m_compositorPlayer->setAnimationDelegate(this);
910 attachCompositorTimeline(); 917 attachCompositorTimeline();
911 } 918 }
912 919
913 attachCompositedLayers(); 920 attachCompositedLayers();
914 } 921 }
915 922
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
1093 visitor->trace(m_timeline); 1100 visitor->trace(m_timeline);
1094 visitor->trace(m_pendingFinishedEvent); 1101 visitor->trace(m_pendingFinishedEvent);
1095 visitor->trace(m_pendingCancelledEvent); 1102 visitor->trace(m_pendingCancelledEvent);
1096 visitor->trace(m_finishedPromise); 1103 visitor->trace(m_finishedPromise);
1097 visitor->trace(m_readyPromise); 1104 visitor->trace(m_readyPromise);
1098 EventTargetWithInlineData::trace(visitor); 1105 EventTargetWithInlineData::trace(visitor);
1099 ActiveDOMObject::trace(visitor); 1106 ActiveDOMObject::trace(visitor);
1100 } 1107 }
1101 1108
1102 } // namespace blink 1109 } // namespace blink
OLDNEW
« 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