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

Unified Diff: ui/compositor/layer_animator.cc

Issue 2414863002: Remove usage of base::ObserverList<T>::Iter::GetNext() in //ui. (Closed)
Patch Set: 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
Index: ui/compositor/layer_animator.cc
diff --git a/ui/compositor/layer_animator.cc b/ui/compositor/layer_animator.cc
index 5af6fb6ae5c04a825d96fe7044288a0458cfaec7..4cf056e5e4fe8d2901d2465da2d05c3b5c1f5290 100644
--- a/ui/compositor/layer_animator.cc
+++ b/ui/compositor/layer_animator.cc
@@ -872,12 +872,8 @@ void LayerAnimator::GetTargetValue(
}
void LayerAnimator::OnScheduled(LayerAnimationSequence* sequence) {
- if (observers_.might_have_observers()) {
- base::ObserverListBase<LayerAnimationObserver>::Iterator it(&observers_);
- LayerAnimationObserver* obs;
- while ((obs = it.GetNext()) != NULL) {
- sequence->AddObserver(obs);
- }
+ for (auto& observer : observers_) {
sky 2016/10/13 02:20:57 no {}
dcheng 2016/10/13 02:39:22 Done.
+ sequence->AddObserver(&observer);
}
sequence->OnScheduled();
}

Powered by Google App Engine
This is Rietveld 408576698