Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / frame / PlatformEventDispatcher.h
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.
4
5 #ifndef PlatformEventDispatcher_h
6 #define PlatformEventDispatcher_h
7
8 #include "platform/heap/Handle.h"
9 #include "wtf/Vector.h"
10
11 namespace blink {
12 class PlatformEventController;
13
14 class PlatformEventDispatcher : public GarbageCollectedMixin {
15 public:
16     void addController(PlatformEventController*);
17     void removeController(PlatformEventController*);
18
19     virtual void trace(Visitor*);
20
21 protected:
22     PlatformEventDispatcher();
23
24     void notifyControllers();
25
26     virtual void startListening() = 0;
27     virtual void stopListening() = 0;
28
29 private:
30     void purgeControllers();
31
32 #if ENABLE(OILPAN)
33     void clearWeakMembers(Visitor*);
34 #endif
35
36     WillBeHeapVector<PlatformEventController*> m_controllers;
37     bool m_needsPurge;
38     bool m_isDispatching;
39 };
40
41 } // namespace blink
42
43 #endif // PlatformEventDispatcher_h