base: Erase unused FOR_EACH_OBSERVER macro.
We use the range based for loop from now.
BUG=655021
Review-Url: https://codereview.chromium.org/2451933003
Cr-Commit-Position: refs/heads/master@{#427623}
CrOS-Libchrome-Original-Commit: 802c2138162919a3602f4eb20feb3e4020b81438
diff --git a/base/android/java/src/org/chromium/base/ObserverList.java b/base/android/java/src/org/chromium/base/ObserverList.java
index 7a2ab98..9c53b54 100644
--- a/base/android/java/src/org/chromium/base/ObserverList.java
+++ b/base/android/java/src/org/chromium/base/ObserverList.java
@@ -21,7 +21,7 @@
* The implementation (and the interface) is heavily influenced by the C++ ObserverList.
* Notable differences:
* - The iterator implements NOTIFY_EXISTING_ONLY.
- * - The FOR_EACH_OBSERVER closure is left to the clients to implement in terms of iterator().
+ * - The range-based for loop is left to the clients to implement in terms of iterator().
* <p/>
* This class is not threadsafe. Observers MUST be added, removed and will be notified on the same
* thread this is created.
diff --git a/base/observer_list.h b/base/observer_list.h
index 8f0be2d..0572ba6 100644
--- a/base/observer_list.h
+++ b/base/observer_list.h
@@ -344,13 +344,6 @@
}
};
-// Deprecated. Use the range-based for loop instead.
-#define FOR_EACH_OBSERVER(ObserverType, observer_list, func) \
- do { \
- for (ObserverType & o : observer_list) \
- o.func; \
- } while (0)
-
} // namespace base
#endif // BASE_OBSERVER_LIST_H_
diff --git a/base/observer_list_unittest.cc b/base/observer_list_unittest.cc
index 7267bd4..c5e556b 100644
--- a/base/observer_list_unittest.cc
+++ b/base/observer_list_unittest.cc
@@ -606,7 +606,8 @@
ListDestructor a(observer_list);
observer_list->AddObserver(&a);
- FOR_EACH_OBSERVER(Foo, *observer_list, Observe(0));
+ for (auto& observer : *observer_list)
+ observer.Observe(0);
// If this test fails, there'll be Valgrind errors when this function goes out
// of scope.
}