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

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

Issue 2776203002: Migrate WTF::Vector::remove() to ::erase() (Closed)
Patch Set: rebase, repatch VectorTest Created 3 years, 8 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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 } 467 }
468 468
469 const Vector<size_t>& cancelledIndices = 469 const Vector<size_t>& cancelledIndices =
470 m_pendingUpdate.cancelledAnimationIndices(); 470 m_pendingUpdate.cancelledAnimationIndices();
471 for (size_t i = cancelledIndices.size(); i-- > 0;) { 471 for (size_t i = cancelledIndices.size(); i-- > 0;) {
472 DCHECK(i == cancelledIndices.size() - 1 || 472 DCHECK(i == cancelledIndices.size() - 1 ||
473 cancelledIndices[i] < cancelledIndices[i + 1]); 473 cancelledIndices[i] < cancelledIndices[i + 1]);
474 Animation& animation = *m_runningAnimations[cancelledIndices[i]]->animation; 474 Animation& animation = *m_runningAnimations[cancelledIndices[i]]->animation;
475 animation.cancel(); 475 animation.cancel();
476 animation.update(TimingUpdateOnDemand); 476 animation.update(TimingUpdateOnDemand);
477 m_runningAnimations.remove(cancelledIndices[i]); 477 m_runningAnimations.erase(cancelledIndices[i]);
478 } 478 }
479 479
480 for (const auto& entry : m_pendingUpdate.newAnimations()) { 480 for (const auto& entry : m_pendingUpdate.newAnimations()) {
481 const InertEffect* inertAnimation = entry.effect.get(); 481 const InertEffect* inertAnimation = entry.effect.get();
482 AnimationEventDelegate* eventDelegate = 482 AnimationEventDelegate* eventDelegate =
483 new AnimationEventDelegate(element, entry.name); 483 new AnimationEventDelegate(element, entry.name);
484 KeyframeEffect* effect = KeyframeEffect::create( 484 KeyframeEffect* effect = KeyframeEffect::create(
485 element, inertAnimation->model(), inertAnimation->specifiedTiming(), 485 element, inertAnimation->model(), inertAnimation->specifiedTiming(),
486 KeyframeEffectReadOnly::DefaultPriority, eventDelegate); 486 KeyframeEffectReadOnly::DefaultPriority, eventDelegate);
487 Animation* animation = element->document().timeline().play(effect); 487 Animation* animation = element->document().timeline().play(effect);
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
1212 isCustomPropertyHandle); 1212 isCustomPropertyHandle);
1213 } 1213 }
1214 1214
1215 DEFINE_TRACE(CSSAnimations) { 1215 DEFINE_TRACE(CSSAnimations) {
1216 visitor->trace(m_transitions); 1216 visitor->trace(m_transitions);
1217 visitor->trace(m_pendingUpdate); 1217 visitor->trace(m_pendingUpdate);
1218 visitor->trace(m_runningAnimations); 1218 visitor->trace(m_runningAnimations);
1219 } 1219 }
1220 1220
1221 } // namespace blink 1221 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698