Skip to content

Commit 42a49e9

Browse files
author
Chih-Yi Leu
committed
Bug 1221730 - Move gamepad API to PBackground. r=qdot, r=baku
--HG-- extra : rebase_source : 5ad6d31a770d0d7b1b10d6aebf693ed24fc956ca
1 parent a9d4368 commit 42a49e9

30 files changed

+1569
-361
lines changed

dom/base/nsGlobalWindow.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@
189189

190190
#ifdef MOZ_GAMEPAD
191191
#include "mozilla/dom/Gamepad.h"
192-
#include "mozilla/dom/GamepadService.h"
192+
#include "mozilla/dom/GamepadManager.h"
193193
#endif
194194

195195
#include "mozilla/dom/VRDevice.h"
@@ -9919,9 +9919,9 @@ nsGlobalWindow::EnableGamepadUpdates()
99199919

99209920
if (mHasGamepad) {
99219921
#ifdef MOZ_GAMEPAD
9922-
RefPtr<GamepadService> gamepadsvc(GamepadService::GetService());
9923-
if (gamepadsvc) {
9924-
gamepadsvc->AddListener(this);
9922+
RefPtr<GamepadManager> gamepadManager(GamepadManager::GetService());
9923+
if (gamepadManager) {
9924+
gamepadManager->AddListener(this);
99259925
}
99269926
#endif
99279927
}
@@ -9934,9 +9934,9 @@ nsGlobalWindow::DisableGamepadUpdates()
99349934

99359935
if (mHasGamepad) {
99369936
#ifdef MOZ_GAMEPAD
9937-
RefPtr<GamepadService> gamepadsvc(GamepadService::GetService());
9938-
if (gamepadsvc) {
9939-
gamepadsvc->RemoveListener(this);
9937+
RefPtr<GamepadManager> gamepadManager(GamepadManager::GetService());
9938+
if (gamepadManager) {
9939+
gamepadManager->RemoveListener(this);
99409940
}
99419941
#endif
99429942
}
@@ -13403,9 +13403,9 @@ nsGlobalWindow::SyncGamepadState()
1340313403
{
1340413404
MOZ_ASSERT(IsInnerWindow());
1340513405
if (mHasSeenGamepadInput) {
13406-
RefPtr<GamepadService> gamepadsvc(GamepadService::GetService());
13406+
RefPtr<GamepadManager> gamepadManager(GamepadManager::GetService());
1340713407
for (auto iter = mGamepads.Iter(); !iter.Done(); iter.Next()) {
13408-
gamepadsvc->SyncGamepadState(iter.Key(), iter.UserData());
13408+
gamepadManager->SyncGamepadState(iter.Key(), iter.UserData());
1340913409
}
1341013410
}
1341113411
}

dom/gamepad/GamepadFunctions.cpp

Lines changed: 0 additions & 106 deletions
This file was deleted.

dom/gamepad/GamepadFunctions.h

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)