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

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

Issue 1406923009: Rename DISALLOW_ALLOCATION and ALLOW_ONLY_INLINE_ALLOCATION (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 WebGamepads; 15 class WebGamepads;
16 16
17 class GamepadDispatcher final : public GarbageCollectedFinalized<GamepadDispatch er>, public PlatformEventDispatcher, public WebGamepadListener { 17 class GamepadDispatcher final : public GarbageCollectedFinalized<GamepadDispatch er>, public PlatformEventDispatcher, public WebGamepadListener {
18 USING_GARBAGE_COLLECTED_MIXIN(GamepadDispatcher); 18 USING_GARBAGE_COLLECTED_MIXIN(GamepadDispatcher);
19 public: 19 public:
20 static GamepadDispatcher& instance(); 20 static GamepadDispatcher& instance();
21 ~GamepadDispatcher() override; 21 ~GamepadDispatcher() override;
22 22
23 void sampleGamepads(WebGamepads&); 23 void sampleGamepads(WebGamepads&);
24 24
25 struct ConnectionChange { 25 struct ConnectionChange {
26 DISALLOW_ALLOCATION(); 26 DISALLOW_NEW();
27 WebGamepad pad; 27 WebGamepad pad;
28 unsigned index; 28 unsigned index;
29 }; 29 };
30 30
31 const ConnectionChange& latestConnectionChange() const { return m_latestChan ge; } 31 const ConnectionChange& latestConnectionChange() const { return m_latestChan ge; }
32 32
33 DECLARE_VIRTUAL_TRACE(); 33 DECLARE_VIRTUAL_TRACE();
34 34
35 private: 35 private:
36 GamepadDispatcher(); 36 GamepadDispatcher();
37 37
38 // WebGamepadListener 38 // WebGamepadListener
39 void didConnectGamepad(unsigned index, const WebGamepad&) override; 39 void didConnectGamepad(unsigned index, const WebGamepad&) override;
40 void didDisconnectGamepad(unsigned index, const WebGamepad&) override; 40 void didDisconnectGamepad(unsigned index, const WebGamepad&) override;
41 41
42 // PlatformEventDispatcher 42 // PlatformEventDispatcher
43 void startListening() override; 43 void startListening() override;
44 void stopListening() override; 44 void stopListening() override;
45 45
46 void dispatchDidConnectOrDisconnectGamepad(unsigned index, const WebGamepad& , bool connected); 46 void dispatchDidConnectOrDisconnectGamepad(unsigned index, const WebGamepad& , bool connected);
47 47
48 ConnectionChange m_latestChange; 48 ConnectionChange m_latestChange;
49 }; 49 };
50 50
51 } // namespace blink 51 } // namespace blink
52 52
53 #endif 53 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698