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

Unified Diff: Source/core/animation/DocumentTimeline.cpp

Issue 219413002: Hash iterators: Check for concurrent modification and fix 1 place where it happened (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: CR feedback Created 6 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
Index: Source/core/animation/DocumentTimeline.cpp
diff --git a/Source/core/animation/DocumentTimeline.cpp b/Source/core/animation/DocumentTimeline.cpp
index 77ef592d566ff005da38639a7d62257444a653db..2059351c6e67357ab5abd6a5ed93514843c06070 100644
--- a/Source/core/animation/DocumentTimeline.cpp
+++ b/Source/core/animation/DocumentTimeline.cpp
@@ -98,7 +98,7 @@ void DocumentTimeline::serviceAnimations()
double timeToNextEffect = std::numeric_limits<double>::infinity();
Vector<AnimationPlayer*> players;
- for (HashSet<RefPtr<AnimationPlayer> >::iterator it = m_playersNeedingUpdate.begin(); it != m_playersNeedingUpdate.end(); ++it)
+ for (ListHashSet<RefPtr<AnimationPlayer> >::iterator it = m_playersNeedingUpdate.begin(); it != m_playersNeedingUpdate.end(); ++it)
players.append(it->get());
std::sort(players.begin(), players.end(), AnimationPlayer::hasLowerPriority);
@@ -159,7 +159,7 @@ double DocumentTimeline::effectiveTime()
void DocumentTimeline::pauseAnimationsForTesting(double pauseTime)
{
- for (HashSet<RefPtr<AnimationPlayer> >::iterator it = m_playersNeedingUpdate.begin(); it != m_playersNeedingUpdate.end(); ++it)
+ for (ListHashSet<RefPtr<AnimationPlayer> >::iterator it = m_playersNeedingUpdate.begin(); it != m_playersNeedingUpdate.end(); ++it)
(*it)->pauseForTesting(pauseTime);
serviceAnimations();
}
@@ -181,7 +181,7 @@ size_t DocumentTimeline::numberOfActiveAnimationsForTesting() const
if (isNull(m_zeroTime))
return 0;
size_t count = 0;
- for (HashSet<RefPtr<AnimationPlayer> >::iterator it = m_playersNeedingUpdate.begin(); it != m_playersNeedingUpdate.end(); ++it) {
+ for (ListHashSet<RefPtr<AnimationPlayer> >::const_iterator it = m_playersNeedingUpdate.begin(); it != m_playersNeedingUpdate.end(); ++it) {
const TimedItem* timedItem = (*it)->source();
if ((*it)->hasStartTime())
count += (timedItem && (timedItem->isCurrent() || timedItem->isInEffect()));

Powered by Google App Engine
This is Rietveld 408576698