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

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

Issue 1850413002: Improve DEFINE_STATIC_LOCAL()'s handling of Blink GCed objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address compilation failure Created 4 years, 8 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 #include "modules/gamepad/GamepadDispatcher.h" 5 #include "modules/gamepad/GamepadDispatcher.h"
6 6
7 #include "modules/gamepad/NavigatorGamepad.h" 7 #include "modules/gamepad/NavigatorGamepad.h"
8 #include "public/platform/Platform.h" 8 #include "public/platform/Platform.h"
9 #include "wtf/TemporaryChange.h" 9 #include "wtf/TemporaryChange.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 GamepadDispatcher& GamepadDispatcher::instance() 13 GamepadDispatcher& GamepadDispatcher::instance()
14 { 14 {
15 DEFINE_STATIC_LOCAL(Persistent<GamepadDispatcher>, gamepadDispatcher, (new G amepadDispatcher())); 15 DEFINE_STATIC_LOCAL(GamepadDispatcher, gamepadDispatcher, (new GamepadDispat cher));
16 return *gamepadDispatcher; 16 return gamepadDispatcher;
17 } 17 }
18 18
19 void GamepadDispatcher::sampleGamepads(WebGamepads& gamepads) 19 void GamepadDispatcher::sampleGamepads(WebGamepads& gamepads)
20 { 20 {
21 Platform::current()->sampleGamepads(gamepads); 21 Platform::current()->sampleGamepads(gamepads);
22 } 22 }
23 23
24 GamepadDispatcher::GamepadDispatcher() 24 GamepadDispatcher::GamepadDispatcher()
25 { 25 {
26 } 26 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 { 58 {
59 Platform::current()->startListening(WebPlatformEventTypeGamepad, this); 59 Platform::current()->startListening(WebPlatformEventTypeGamepad, this);
60 } 60 }
61 61
62 void GamepadDispatcher::stopListening() 62 void GamepadDispatcher::stopListening()
63 { 63 {
64 Platform::current()->stopListening(WebPlatformEventTypeGamepad); 64 Platform::current()->stopListening(WebPlatformEventTypeGamepad);
65 } 65 }
66 66
67 } // namespace blink 67 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698