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
3 // found in the LICENSE file.
5 #ifndef PlatformEventDispatcher_h
6 #define PlatformEventDispatcher_h
8 #include "platform/heap/Handle.h"
9 #include "wtf/Vector.h"
12 class PlatformEventController;
14 class PlatformEventDispatcher : public GarbageCollectedMixin {
16 void addController(PlatformEventController*);
17 void removeController(PlatformEventController*);
19 virtual void trace(Visitor*);
22 PlatformEventDispatcher();
24 void notifyControllers();
26 virtual void startListening() = 0;
27 virtual void stopListening() = 0;
30 void purgeControllers();
33 void clearWeakMembers(Visitor*);
36 WillBeHeapVector<PlatformEventController*> m_controllers;
43 #endif // PlatformEventDispatcher_h