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()); |
} |
} |