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

Unified Diff: cc/animation/animation_player.cc

Issue 1437413002: cc: Remove ScopedPtrVector and cc::remove_if. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « cc/animation/animation_player.h ('k') | cc/animation/keyframed_animation_curve.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/animation_player.cc
diff --git a/cc/animation/animation_player.cc b/cc/animation/animation_player.cc
index 0c380118987882b29692f850b4b8c26c8e769fcf..86a29efe4d710c7c1606083d9261c659c666458e 100644
--- a/cc/animation/animation_player.cc
+++ b/cc/animation/animation_player.cc
@@ -105,9 +105,10 @@ void AnimationPlayer::BindElementAnimations() {
DCHECK(element_animations_);
// Pass all accumulated animations to LAC.
- for (auto it = animations_.begin(); it != animations_.end(); ++it)
+ for (auto& animation : animations_) {
element_animations_->layer_animation_controller()->AddAnimation(
- animations_.take(it));
+ std::move(animation));
+ }
if (!animations_.empty())
SetNeedsCommit();
animations_.clear();
@@ -144,8 +145,11 @@ void AnimationPlayer::RemoveAnimation(int animation_id) {
animation_id);
SetNeedsCommit();
} else {
- auto animations_to_remove = animations_.remove_if([animation_id](
- Animation* animation) { return animation->id() == animation_id; });
+ auto animations_to_remove =
+ std::remove_if(animations_.begin(), animations_.end(),
+ [animation_id](const scoped_ptr<Animation>& animation) {
+ return animation->id() == animation_id;
+ });
animations_.erase(animations_to_remove, animations_.end());
}
}
« no previous file with comments | « cc/animation/animation_player.h ('k') | cc/animation/keyframed_animation_curve.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698