Backed out changeset ab013a0a0ae5 (bug 1375816)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Tue, 18 Jul 2017 11:48:31 +0200
changeset 418052 7a60993c3958f105960d9f0a63bc05b496745f90
parent 418051 96e75102b3d8ef5396ba0e8a3dec267edb43cd01
child 418053 5654a60499973490633adb7eb715467a99894622
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1375816
milestone56.0a1
backs outab013a0a0ae55eb5d5c5e1b93c3cbae13d2b1070
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset ab013a0a0ae5 (bug 1375816)
dom/gamepad/GamepadManager.cpp
dom/gamepad/GamepadManager.h
dom/gamepad/GamepadPlatformService.cpp
dom/gamepad/GamepadServiceTest.cpp
dom/gamepad/ipc/GamepadEventTypes.ipdlh
--- a/dom/gamepad/GamepadManager.cpp
+++ b/dom/gamepad/GamepadManager.cpp
@@ -221,32 +221,30 @@ uint32_t GamepadManager::GetGamepadIndex
 }
 
 void
 GamepadManager::AddGamepad(uint32_t aIndex,
                            const nsAString& aId,
                            GamepadMappingType aMapping,
                            GamepadHand aHand,
                            GamepadServiceType aServiceType,
-                           uint32_t aDisplayID,
                            uint32_t aNumButtons,
                            uint32_t aNumAxes,
                            uint32_t aNumHaptics)
 {
    uint32_t newIndex = GetGamepadIndexWithServiceType(aIndex, aServiceType);
 
   //TODO: bug 852258: get initial button/axis state
   RefPtr<Gamepad> gamepad =
     new Gamepad(nullptr,
                 aId,
                 0, // index is set by global window
                 newIndex,
                 aMapping,
                 aHand,
-                aDisplayID,
                 aNumButtons,
                 aNumAxes,
                 aNumHaptics);
 
   // We store the gamepad related to its index given by the parent process,
   // and no duplicate index is allowed.
   MOZ_ASSERT(!mGamepads.Get(newIndex, nullptr));
   mGamepads.Put(newIndex, gamepad);
@@ -506,17 +504,16 @@ GamepadManager::Update(const GamepadChan
   }
 
   if (aEvent.type() == GamepadChangeEvent::TGamepadAdded) {
     const GamepadAdded& a = aEvent.get_GamepadAdded();
     AddGamepad(a.index(), a.id(),
                static_cast<GamepadMappingType>(a.mapping()),
                static_cast<GamepadHand>(a.hand()),
                a.service_type(),
-               a.display_id(),
                a.num_buttons(), a.num_axes(),
                a.num_haptics());
     return;
   }
   if (aEvent.type() == GamepadChangeEvent::TGamepadRemoved) {
     const GamepadRemoved& a = aEvent.get_GamepadRemoved();
     RemoveGamepad(a.index(), a.service_type());
     return;
--- a/dom/gamepad/GamepadManager.h
+++ b/dom/gamepad/GamepadManager.h
@@ -46,17 +46,17 @@ class GamepadManager final : public nsIO
 
   // Indicate that |aWindow| wants to receive gamepad events.
   void AddListener(nsGlobalWindow* aWindow);
   // Indicate that |aWindow| should no longer receive gamepad events.
   void RemoveListener(nsGlobalWindow* aWindow);
 
   // Add a gamepad to the list of known gamepads.
   void AddGamepad(uint32_t aIndex, const nsAString& aID, GamepadMappingType aMapping,
-                  GamepadHand aHand, GamepadServiceType aServiceType, uint32_t aDisplayID,
+                  GamepadHand aHand, GamepadServiceType aServiceType,
                   uint32_t aNumButtons, uint32_t aNumAxes, uint32_t aNumHaptics);
 
   // Remove the gamepad at |aIndex| from the list of known gamepads.
   void RemoveGamepad(uint32_t aIndex, GamepadServiceType aServiceType);
 
   // Synchronize the state of |aGamepad| to match the gamepad stored at |aIndex|
   void SyncGamepadState(uint32_t aIndex, Gamepad* aGamepad);
 
--- a/dom/gamepad/GamepadPlatformService.cpp
+++ b/dom/gamepad/GamepadPlatformService.cpp
@@ -91,20 +91,19 @@ GamepadPlatformService::AddGamepad(const
                                    uint32_t aHaptics)
 {
   // This method is called by monitor thread populated in
   // platform-dependent backends
   MOZ_ASSERT(XRE_IsParentProcess());
   MOZ_ASSERT(!NS_IsMainThread());
 
   uint32_t index = ++mGamepadIndex;
-  // Only VR controllers has displayID, we give 0 to the general gamepads.
   GamepadAdded a(NS_ConvertUTF8toUTF16(nsDependentCString(aID)), index,
                  aMapping, aHand, GamepadServiceType::Standard,
-                 0, aNumButtons, aNumAxes, aHaptics);
+                 aNumButtons, aNumAxes, aHaptics);
 
   NotifyGamepadChange<GamepadAdded>(a);
   return index;
 }
 
 void
 GamepadPlatformService::RemoveGamepad(uint32_t aIndex)
 {
--- a/dom/gamepad/GamepadServiceTest.cpp
+++ b/dom/gamepad/GamepadServiceTest.cpp
@@ -118,20 +118,19 @@ GamepadServiceTest::AddGamepad(const nsA
                                uint32_t aNumAxes,
                                uint32_t aNumHaptics,
                                ErrorResult& aRv)
 {
   if (mShuttingDown) {
     return nullptr;
   }
 
-  // Only VR controllers has displayID, we give 0 to the general gamepads.
   GamepadAdded a(nsString(aID), 0,
                  aMapping, aHand,
-                 GamepadServiceType::Standard, 0,
+                 GamepadServiceType::Standard,
                  aNumButtons, aNumAxes, aNumHaptics);
   GamepadChangeEvent e(a);
   nsCOMPtr<nsIGlobalObject> go = do_QueryInterface(mWindow);
 
   RefPtr<Promise> p = Promise::Create(go, aRv);
   if (aRv.Failed()) {
     return nullptr;
   }
--- a/dom/gamepad/ipc/GamepadEventTypes.ipdlh
+++ b/dom/gamepad/ipc/GamepadEventTypes.ipdlh
@@ -12,17 +12,16 @@ namespace mozilla {
 namespace dom {
 
 struct GamepadAdded {
   nsString id;
   uint32_t index;
   GamepadMappingType mapping;
   GamepadHand hand;
   GamepadServiceType service_type;
-  uint32_t display_id;
   uint32_t num_buttons;
   uint32_t num_axes;
   uint32_t num_haptics;
 };
 
 struct GamepadRemoved {
   uint32_t index;
   GamepadServiceType service_type;