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

Unified Diff: base/observer_list.h

Issue 1180693002: Update from https://crrev.com/333737 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased Created 5 years, 6 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/numerics/safe_numerics_unittest.cc ('k') | base/observer_list_threadsafe.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/observer_list.h
diff --git a/base/observer_list.h b/base/observer_list.h
index fb6f0262dfd512787b92b3f000dbc5afdf91dd26..a454430fc9481a687603f0c9879eb610159646f9 100644
--- a/base/observer_list.h
+++ b/base/observer_list.h
@@ -51,18 +51,20 @@
// }
//
// private:
-// ObserverList<Observer> observer_list_;
+// base::ObserverList<Observer> observer_list_;
// };
//
//
///////////////////////////////////////////////////////////////////////////////
+namespace base {
+
template <typename ObserverType>
class ObserverListThreadSafe;
template <class ObserverType>
class ObserverListBase
- : public base::SupportsWeakPtr<ObserverListBase<ObserverType> > {
+ : public SupportsWeakPtr<ObserverListBase<ObserverType>> {
public:
// Enumeration of which observers are notified.
enum NotificationType {
@@ -84,7 +86,7 @@ class ObserverListBase
ObserverType* GetNext();
private:
- base::WeakPtr<ObserverListBase<ObserverType> > list_;
+ WeakPtr<ObserverListBase<ObserverType>> list_;
size_t index_;
size_t max_index_;
};
@@ -232,12 +234,14 @@ class ObserverList : public ObserverListBase<ObserverType> {
#define FOR_EACH_OBSERVER(ObserverType, observer_list, func) \
do { \
if ((observer_list).might_have_observers()) { \
- ObserverListBase<ObserverType>::Iterator it_inside_observer_macro( \
+ base::ObserverListBase<ObserverType>::Iterator it_inside_observer_macro( \
&observer_list); \
ObserverType* obs; \
- while ((obs = it_inside_observer_macro.GetNext()) != nullptr) \
+ while ((obs = it_inside_observer_macro.GetNext()) != nullptr) \
obs->func; \
} \
} while (0)
+} // namespace base
+
#endif // BASE_OBSERVER_LIST_H_
« no previous file with comments | « base/numerics/safe_numerics_unittest.cc ('k') | base/observer_list_threadsafe.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698