Chromium Code Reviews| Index: third_party/WebKit/Source/modules/gamepad/GamepadDispatcher.cpp |
| diff --git a/third_party/WebKit/Source/modules/gamepad/GamepadDispatcher.cpp b/third_party/WebKit/Source/modules/gamepad/GamepadDispatcher.cpp |
| index 21dd5af0cc058afa6701c940b1782a03324b3405..0ff0436e0e2415443a5a62a427192fd89647128b 100644 |
| --- a/third_party/WebKit/Source/modules/gamepad/GamepadDispatcher.cpp |
| +++ b/third_party/WebKit/Source/modules/gamepad/GamepadDispatcher.cpp |
| @@ -4,6 +4,7 @@ |
| #include "modules/gamepad/GamepadDispatcher.h" |
| +#include "modules/gamepad/GamepadSharedMemoryReader.h" |
|
ke.he
2016/12/15 14:11:01
Actually the GamepadSharedMemory can be merged int
|
| #include "modules/gamepad/NavigatorGamepad.h" |
| #include "public/platform/Platform.h" |
| @@ -50,11 +51,17 @@ void GamepadDispatcher::dispatchDidConnectOrDisconnectGamepad( |
| } |
| void GamepadDispatcher::startListening() { |
| - Platform::current()->startListening(WebPlatformEventTypeGamepad, this); |
| + if (!m_reader.get()) { |
| + m_reader.reset(new GamepadSharedMemoryReader( |
| + Platform::current()->interfaceProvider())); |
| + } |
| + m_reader->start(this); |
| } |
| void GamepadDispatcher::stopListening() { |
| - Platform::current()->stopListening(WebPlatformEventTypeGamepad); |
| + if (m_reader) { |
| + m_reader->stop(); |
| + } |
| } |
| } // namespace blink |