| 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_PUBLIC_BROWSER_NOTIFICATION_SERVICE_IMPL_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_NOTIFICATION_SERVICE_IMPL_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_NOTIFICATION_SERVICE_IMPL_H_ | 6 #define CONTENT_PUBLIC_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 10 matching lines...) Expand all Loading... |
| 21 static NotificationServiceImpl* current(); | 21 static NotificationServiceImpl* current(); |
| 22 | 22 |
| 23 // Normally instantiated when the thread is created. Not all threads have | 23 // Normally instantiated when the thread is created. Not all threads have |
| 24 // a NotificationService. Only one instance should be created per thread. | 24 // a NotificationService. Only one instance should be created per thread. |
| 25 NotificationServiceImpl(); | 25 NotificationServiceImpl(); |
| 26 virtual ~NotificationServiceImpl(); | 26 virtual ~NotificationServiceImpl(); |
| 27 | 27 |
| 28 // NotificationService: | 28 // NotificationService: |
| 29 virtual void Notify(int type, | 29 virtual 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 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 |
| (...skipping 44 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_PUBLIC_BROWSER_NOTIFICATION_SERVICE_IMPL_H_ | 95 #endif // CONTENT_PUBLIC_BROWSER_NOTIFICATION_SERVICE_IMPL_H_ |
| OLD | NEW |