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

Unified Diff: base/observer_list_unittest.cc

Issue 2419673003: Remove base::ObserverList<T>::Iter::GetNext(). (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
« no previous file with comments | « base/observer_list_threadsafe.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/observer_list_unittest.cc
diff --git a/base/observer_list_unittest.cc b/base/observer_list_unittest.cc
index 299a33f2e896053bf452887191559944c3c53334..35d6eb10902d3ddb0f5060f353aa787ef43e873c 100644
--- a/base/observer_list_unittest.cc
+++ b/base/observer_list_unittest.cc
@@ -905,10 +905,12 @@ TEST(ObserverListTest, AddObserverInTheLastObserve) {
a.SetToAdd(&b);
observer_list.AddObserver(&a);
- FooList::Iterator it(&observer_list);
- Foo* foo;
- while ((foo = it.GetNext()) != nullptr)
- foo->Observe(10);
+ auto it = observer_list.begin();
+ while (it != observer_list.end()) {
+ auto& observer = *it;
+ ++it;
danakj 2016/10/14 21:52:10 Leave a comment explaining why youre doing this ++
+ observer.Observe(10);
+ }
EXPECT_EQ(-10, b.total);
}
« no previous file with comments | « base/observer_list_threadsafe.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698