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

Unified Diff: ui/compositor/layer_animation_sequence.cc

Issue 2414863002: Remove usage of base::ObserverList<T>::Iter::GetNext() in //ui. (Closed)
Patch Set: debrace 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 | « ui/aura/window.cc ('k') | ui/compositor/layer_animator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer_animation_sequence.cc
diff --git a/ui/compositor/layer_animation_sequence.cc b/ui/compositor/layer_animation_sequence.cc
index 041bdbeea8e65b6e16023b1232bee98c5efd6dee..40a77f115f869a782b1298e88b20eef8453769f7 100644
--- a/ui/compositor/layer_animation_sequence.cc
+++ b/ui/compositor/layer_animation_sequence.cc
@@ -232,15 +232,11 @@ void LayerAnimationSequence::OnScheduled() {
}
void LayerAnimationSequence::OnAnimatorDestroyed() {
- if (observers_.might_have_observers()) {
- base::ObserverListBase<LayerAnimationObserver>::Iterator it(&observers_);
- LayerAnimationObserver* obs;
- while ((obs = it.GetNext()) != NULL) {
- if (!obs->RequiresNotificationWhenAnimatorDestroyed()) {
- // Remove the observer, but do not allow notifications to be sent.
- observers_.RemoveObserver(obs);
- obs->DetachedFromSequence(this, false);
- }
+ for (LayerAnimationObserver& observer : observers_) {
+ if (!observer.RequiresNotificationWhenAnimatorDestroyed()) {
+ // Remove the observer, but do not allow notifications to be sent.
+ observers_.RemoveObserver(&observer);
+ observer.DetachedFromSequence(this, false);
}
}
}
« no previous file with comments | « ui/aura/window.cc ('k') | ui/compositor/layer_animator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698