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

Unified Diff: cc/test/animation_test_common.cc

Issue 2340923003: CC Animation: Rework iterations over players to use the range-based for loop. (Closed)
Patch Set: Rebase. Created 4 years, 2 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
« no previous file with comments | « cc/animation/element_animations_unittest.cc ('k') | cc/test/animation_timelines_test_common.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/animation_test_common.cc
diff --git a/cc/test/animation_test_common.cc b/cc/test/animation_test_common.cc
index 9248eb3a7ad8eeb34a93d09cac75da4e01cbc1b4..cadf120ed3d3c67456f9ac9697df7b5659b3ec92 100644
--- a/cc/test/animation_test_common.cc
+++ b/cc/test/animation_test_common.cc
@@ -309,9 +309,7 @@ void AddAnimationToElementWithExistingPlayer(
timeline->animation_host()->GetElementAnimationsForElementId(element_id);
DCHECK(element_animations);
DCHECK(element_animations->players_list().might_have_observers());
- ElementAnimations::PlayersList::Iterator it(
- &element_animations->players_list());
- AnimationPlayer* player = it.GetNext();
+ AnimationPlayer* player = &*element_animations->players_list().begin();
DCHECK(player);
player->AddAnimation(std::move(animation));
}
@@ -324,9 +322,7 @@ void RemoveAnimationFromElementWithExistingPlayer(
timeline->animation_host()->GetElementAnimationsForElementId(element_id);
DCHECK(element_animations);
DCHECK(element_animations->players_list().might_have_observers());
- ElementAnimations::PlayersList::Iterator it(
- &element_animations->players_list());
- AnimationPlayer* player = it.GetNext();
+ AnimationPlayer* player = &*element_animations->players_list().begin();
DCHECK(player);
player->RemoveAnimation(animation_id);
}
@@ -339,9 +335,7 @@ Animation* GetAnimationFromElementWithExistingPlayer(
timeline->animation_host()->GetElementAnimationsForElementId(element_id);
DCHECK(element_animations);
DCHECK(element_animations->players_list().might_have_observers());
- ElementAnimations::PlayersList::Iterator it(
- &element_animations->players_list());
- AnimationPlayer* player = it.GetNext();
+ AnimationPlayer* player = &*element_animations->players_list().begin();
DCHECK(player);
return player->GetAnimationById(animation_id);
}
« no previous file with comments | « cc/animation/element_animations_unittest.cc ('k') | cc/test/animation_timelines_test_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698