Bug 1292475 - Fix Windows Gamepad API backend to receive event correctly; r=ted a=ritu CLOSED TREE
authorChih-Yi Leu <cleu@mozilla.com>
Mon, 08 Aug 2016 11:33:26 -0700
changeset 347636 fd3bb47e076f05259436a1f7af5985d7d399ff80
parent 347635 3237f302d6788b819e78a540a8a6165e48dbfd1f
child 347637 6b7a77c7ecaa1f90b5400299ef640c1a7e947b3c
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted, ritu
bugs1292475
milestone50.0a2
Bug 1292475 - Fix Windows Gamepad API backend to receive event correctly; r=ted a=ritu CLOSED TREE MozReview-Commit-ID: 6AVYu9uEBWQ
dom/gamepad/windows/WindowsGamepad.cpp
--- a/dom/gamepad/windows/WindowsGamepad.cpp
+++ b/dom/gamepad/windows/WindowsGamepad.cpp
@@ -748,18 +748,18 @@ bool
 WindowsGamepadService::HandleRawInput(HRAWINPUT handle)
 {
   if (!mHID) {
     return false;
   }
 
   RefPtr<GamepadPlatformService> service =
     GamepadPlatformService::GetParentService();
-  if (service) {
-    return true;
+  if (!service) {
+    return false;
   }
 
   // First, get data from the handle
   UINT size;
   GetRawInputData(handle, RID_INPUT, nullptr, &size, sizeof(RAWINPUTHEADER));
   nsTArray<uint8_t> data(size);
   data.SetLength(size);
   if (GetRawInputData(handle, RID_INPUT, data.Elements(), &size,