| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_NOTIFICATION_SERVICE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_NOTIFICATION_SERVICE_IMPL_H_ |
| 6 #define CONTENT_BROWSER_NOTIFICATION_SERVICE_IMPL_H_ | 6 #define CONTENT_BROWSER_NOTIFICATION_SERVICE_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 ~NotificationServiceImpl() override; | 26 ~NotificationServiceImpl() override; |
| 27 | 27 |
| 28 // NotificationService: | 28 // NotificationService: |
| 29 void Notify(int type, | 29 void Notify(int type, |
| 30 const NotificationSource& source, | 30 const NotificationSource& source, |
| 31 const NotificationDetails& details) override; | 31 const NotificationDetails& details) override; |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 friend class NotificationRegistrar; | 34 friend class NotificationRegistrar; |
| 35 | 35 |
| 36 typedef ObserverList<NotificationObserver> NotificationObserverList; | 36 typedef base::ObserverList<NotificationObserver> NotificationObserverList; |
| 37 typedef std::map<uintptr_t, NotificationObserverList*> NotificationSourceMap; | 37 typedef std::map<uintptr_t, NotificationObserverList*> NotificationSourceMap; |
| 38 typedef std::map<int, NotificationSourceMap> NotificationObserverMap; | 38 typedef std::map<int, NotificationSourceMap> NotificationObserverMap; |
| 39 typedef std::map<int, int> NotificationObserverCount; | 39 typedef std::map<int, int> NotificationObserverCount; |
| 40 | 40 |
| 41 // Convenience function to determine whether a source has a | 41 // Convenience function to determine whether a source has a |
| 42 // NotificationObserverList in the given map; | 42 // NotificationObserverList in the given map; |
| 43 static bool HasKey(const NotificationSourceMap& map, | 43 static bool HasKey(const NotificationSourceMap& map, |
| 44 const NotificationSource& source); | 44 const NotificationSource& source); |
| 45 | 45 |
| 46 // NOTE: Rather than using this directly, you should use a | 46 // NOTE: Rather than using this directly, you should use a |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 // balanced. | 86 // balanced. |
| 87 NotificationObserverCount observer_counts_; | 87 NotificationObserverCount observer_counts_; |
| 88 #endif | 88 #endif |
| 89 | 89 |
| 90 DISALLOW_COPY_AND_ASSIGN(NotificationServiceImpl); | 90 DISALLOW_COPY_AND_ASSIGN(NotificationServiceImpl); |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 } // namespace content | 93 } // namespace content |
| 94 | 94 |
| 95 #endif // CONTENT_BROWSER_NOTIFICATION_SERVICE_IMPL_H_ | 95 #endif // CONTENT_BROWSER_NOTIFICATION_SERVICE_IMPL_H_ |
| OLD | NEW |