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

Unified Diff: content/common/notification_service.h

Issue 7327007: Moving notification types which are chrome specific to a new header file chrome_notification_type... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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
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);

Powered by Google App Engine
This is Rietveld 408576698