Chromium Code Reviews| Index: content/common/notification_service.h |
| =================================================================== |
| --- content/common/notification_service.h (revision 91771) |
| +++ content/common/notification_service.h (working copy) |
| @@ -11,6 +11,7 @@ |
| #pragma once |
| #include <map> |
| +#include <vector> |
|
darin (slow to review)
2011/07/07 22:54:56
nit: looks like this include is not needed.
|
| #include "base/observer_list.h" |
| #include "content/common/notification_details.h" |
| @@ -55,6 +56,8 @@ |
| typedef ObserverList<NotificationObserver> NotificationObserverList; |
| typedef std::map<uintptr_t, NotificationObserverList*> NotificationSourceMap; |
| + typedef std::map<int, NotificationSourceMap> NotificationObserverMap; |
| + typedef std::map<int, int> NotificationObserverCount; |
| // Convenience function to determine whether a source has a |
| // NotificationObserverList in the given map; |
| @@ -94,12 +97,12 @@ |
| // Keeps track of the observers for each type of notification. |
| // Until we get a prohibitively large number of notification types, |
| // a simple array is probably the fastest way to dispatch. |
| - NotificationSourceMap observers_[NotificationType::NOTIFICATION_TYPE_COUNT]; |
| + NotificationObserverMap observers_; |
| #ifndef NDEBUG |
| // Used to check to see that AddObserver and RemoveObserver calls are |
| // balanced. |
| - int observer_counts_[NotificationType::NOTIFICATION_TYPE_COUNT]; |
| + NotificationObserverCount observer_counts_; |
| #endif |
| DISALLOW_COPY_AND_ASSIGN(NotificationService); |