OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 PlatformEventDispatcher_h | 5 #ifndef PlatformEventDispatcher_h |
6 #define PlatformEventDispatcher_h | 6 #define PlatformEventDispatcher_h |
7 | 7 |
8 #include "platform/heap/Handle.h" | 8 #include "platform/heap/Handle.h" |
9 #include "wtf/Vector.h" | 9 #include "wtf/Vector.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 class PlatformEventController; | 12 class PlatformEventController; |
13 | 13 |
14 class PlatformEventDispatcher { | 14 class PlatformEventDispatcher : public GarbageCollectedMixin { |
15 public: | 15 public: |
16 void addController(PlatformEventController*); | 16 void addController(PlatformEventController*); |
17 void removeController(PlatformEventController*); | 17 void removeController(PlatformEventController*); |
18 | 18 |
| 19 virtual void trace(Visitor*); |
| 20 |
19 protected: | 21 protected: |
20 PlatformEventDispatcher(); | 22 PlatformEventDispatcher(); |
21 virtual ~PlatformEventDispatcher(); | |
22 | 23 |
23 void notifyControllers(); | 24 void notifyControllers(); |
24 | 25 |
25 virtual void startListening() = 0; | 26 virtual void startListening() = 0; |
26 virtual void stopListening() = 0; | 27 virtual void stopListening() = 0; |
27 | 28 |
28 private: | 29 private: |
29 void purgeControllers(); | 30 void purgeControllers(); |
30 | 31 |
31 WillBePersistentHeapVector<RawPtrWillBeMember<PlatformEventController> > m_c
ontrollers; | 32 #if ENABLE(OILPAN) |
| 33 void clearWeakMembers(Visitor*); |
| 34 #endif |
| 35 |
| 36 WillBeHeapVector<PlatformEventController*> m_controllers; |
32 bool m_needsPurge; | 37 bool m_needsPurge; |
33 bool m_isDispatching; | 38 bool m_isDispatching; |
34 }; | 39 }; |
35 | 40 |
36 } // namespace blink | 41 } // namespace blink |
37 | 42 |
38 #endif // PlatformEventDispatcher_h | 43 #endif // PlatformEventDispatcher_h |
OLD | NEW |