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

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: just the vector 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
Index: cc/animation/animation_player.cc
diff --git a/cc/animation/animation_player.cc b/cc/animation/animation_player.cc
index 0c380118987882b29692f850b4b8c26c8e769fcf..637f2032e0a72596e1e358ebffa300449338abe3 100644
--- a/cc/animation/animation_player.cc
+++ b/cc/animation/animation_player.cc
@@ -106,8 +106,7 @@ void AnimationPlayer::BindElementAnimations() {
// Pass all accumulated animations to LAC.
for (auto it = animations_.begin(); it != animations_.end(); ++it)
danakj 2015/11/17 01:12:16 This could be for (auto& animation : animations_)
vmpstr 2015/11/17 23:26:23 Done.
- element_animations_->layer_animation_controller()->AddAnimation(
- animations_.take(it));
+ element_animations_->layer_animation_controller()->AddAnimation(it->Pass());
if (!animations_.empty())
SetNeedsCommit();
animations_.clear();
@@ -144,8 +143,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());
}
}

Powered by Google App Engine
This is Rietveld 408576698