Bug 1356452 - Part 4: Add gamepad set hand function in Gamepad; r=qdot
authorDaosheng Mu <daoshengmu@gmail.com>
Tue, 18 Apr 2017 15:56:08 +0800
changeset 354037 2e29632323c9f4b839b8018599c75091c4f2e0cc
parent 354036 fed55d5486d0c356f40d582447f811c223679f90
child 354038 ecc42c31cc283151f6a452af171045687023cf75
push id31685
push userkwierso@gmail.com
push dateThu, 20 Apr 2017 21:45:29 +0000
treeherdermozilla-central@5e3dc7e1288a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersqdot
bugs1356452
milestone55.0a1
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
Bug 1356452 - Part 4: Add gamepad set hand function in Gamepad; r=qdot MozReview-Commit-ID: LrQjMZ6demG
dom/gamepad/Gamepad.cpp
dom/gamepad/Gamepad.h
--- a/dom/gamepad/Gamepad.cpp
+++ b/dom/gamepad/Gamepad.cpp
@@ -102,16 +102,22 @@ Gamepad::SetAxis(uint32_t aAxis, double 
 void
 Gamepad::SetPose(const GamepadPoseState& aPose)
 {
   mPose->SetPoseState(aPose);
   UpdateTimestamp();
 }
 
 void
+Gamepad::SetHand(GamepadHand aHand)
+{
+  mHand = aHand;
+}
+
+void
 Gamepad::SyncState(Gamepad* aOther)
 {
   const char* kGamepadExtEnabledPref = "dom.gamepad.extensions.enabled";
 
   if (mButtons.Length() != aOther->mButtons.Length() ||
       mAxes.Length() != aOther->mAxes.Length()) {
     return;
   }
--- a/dom/gamepad/Gamepad.h
+++ b/dom/gamepad/Gamepad.h
@@ -51,16 +51,17 @@ public:
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Gamepad)
 
   void SetConnected(bool aConnected);
   void SetButton(uint32_t aButton, bool aPressed,
                  bool aTouched, double aValue);
   void SetAxis(uint32_t aAxis, double aValue);
   void SetIndex(uint32_t aIndex);
   void SetPose(const GamepadPoseState& aPose);
+  void SetHand(GamepadHand aHand);
 
   // Make the state of this gamepad equivalent to other.
   void SyncState(Gamepad* aOther);
 
   // Return a new Gamepad containing the same data as this object,
   // parented to aParent.
   already_AddRefed<Gamepad> Clone(nsISupports* aParent);