| 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 : public GarbageCollectedMixin { | 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*); | 19 DECLARE_VIRTUAL_TRACE(); |
| 20 | 20 |
| 21 protected: | 21 protected: |
| 22 PlatformEventDispatcher(); | 22 PlatformEventDispatcher(); |
| 23 | 23 |
| 24 void notifyControllers(); | 24 void notifyControllers(); |
| 25 | 25 |
| 26 virtual void startListening() = 0; | 26 virtual void startListening() = 0; |
| 27 virtual void stopListening() = 0; | 27 virtual void stopListening() = 0; |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 void purgeControllers(); | 30 void purgeControllers(); |
| 31 | 31 |
| 32 #if ENABLE(OILPAN) | 32 #if ENABLE(OILPAN) |
| 33 void clearWeakMembers(Visitor*); | 33 void clearWeakMembers(Visitor*); |
| 34 #endif | 34 #endif |
| 35 | 35 |
| 36 WillBeHeapVector<PlatformEventController*> m_controllers; | 36 WillBeHeapVector<PlatformEventController*> m_controllers; |
| 37 bool m_needsPurge; | 37 bool m_needsPurge; |
| 38 bool m_isDispatching; | 38 bool m_isDispatching; |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 } // namespace blink | 41 } // namespace blink |
| 42 | 42 |
| 43 #endif // PlatformEventDispatcher_h | 43 #endif // PlatformEventDispatcher_h |
| OLD | NEW |