Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(291)

Side by Side Diff: Source/modules/gamepad/GamepadDispatcher.h

Issue 619383002: Move PlatformEventDispatcher implementations to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix non-Oilpan allocation of DeviceLightDispatcher singleton Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 GamepadDispatcher_h 5 #ifndef GamepadDispatcher_h
6 #define GamepadDispatcher_h 6 #define GamepadDispatcher_h
7 7
8 #include "core/frame/PlatformEventDispatcher.h" 8 #include "core/frame/PlatformEventDispatcher.h"
9 #include "platform/heap/Handle.h" 9 #include "platform/heap/Handle.h"
10 #include "public/platform/WebGamepad.h" 10 #include "public/platform/WebGamepad.h"
11 #include "public/platform/WebGamepadListener.h" 11 #include "public/platform/WebGamepadListener.h"
12 12
13 namespace blink { 13 namespace blink {
14 14
15 class NavigatorGamepad; 15 class NavigatorGamepad;
16 class WebGamepads; 16 class WebGamepads;
17 17
18 class GamepadDispatcher : public PlatformEventDispatcher, public WebGamepadListe ner { 18 class GamepadDispatcher final : public GarbageCollectedFinalized<GamepadDispatch er>, public PlatformEventDispatcher, public WebGamepadListener {
19 USING_GARBAGE_COLLECTED_MIXIN(GamepadDispatcher);
19 public: 20 public:
20 static GamepadDispatcher& instance(); 21 static GamepadDispatcher& instance();
22 virtual ~GamepadDispatcher();
21 23
22 void sampleGamepads(WebGamepads&); 24 void sampleGamepads(WebGamepads&);
23 25
24 struct ConnectionChange { 26 struct ConnectionChange {
25 WebGamepad pad; 27 WebGamepad pad;
26 unsigned index; 28 unsigned index;
27 }; 29 };
28 30
29 const ConnectionChange& latestConnectionChange() const { return m_latestChan ge; } 31 const ConnectionChange& latestConnectionChange() const { return m_latestChan ge; }
30 32
33 virtual void trace(Visitor*) override;
34
31 private: 35 private:
32 GamepadDispatcher(); 36 GamepadDispatcher();
33 virtual ~GamepadDispatcher();
34 37
35 // WebGamepadListener 38 // WebGamepadListener
36 virtual void didConnectGamepad(unsigned index, const WebGamepad&) OVERRIDE; 39 virtual void didConnectGamepad(unsigned index, const WebGamepad&) override;
37 virtual void didDisconnectGamepad(unsigned index, const WebGamepad&) OVERRID E; 40 virtual void didDisconnectGamepad(unsigned index, const WebGamepad&) overrid e;
38 41
39 // PlatformEventDispatcher 42 // PlatformEventDispatcher
40 virtual void startListening() OVERRIDE; 43 virtual void startListening() override;
41 virtual void stopListening() OVERRIDE; 44 virtual void stopListening() override;
42 45
43 void dispatchDidConnectOrDisconnectGamepad(unsigned index, const WebGamepad& , bool connected); 46 void dispatchDidConnectOrDisconnectGamepad(unsigned index, const WebGamepad& , bool connected);
44 47
45 ConnectionChange m_latestChange; 48 ConnectionChange m_latestChange;
46 }; 49 };
47 50
48 } // namespace blink 51 } // namespace blink
49 52
50 #endif 53 #endif
OLDNEW
« no previous file with comments | « Source/modules/device_orientation/DeviceOrientationDispatcher.cpp ('k') | Source/modules/gamepad/GamepadDispatcher.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698