Skip to content

Commit b173205

Browse files
committed
Backed out 5 changesets (bug 1523351) for build bustage at builds/worker/workspace/build/src/dom/gamepad/GamepadRemapping.cpp on a CLOSED TREE
Backed out changeset 723d0a919d71 (bug 1523351) Backed out changeset 13dcba81ff07 (bug 1523351) Backed out changeset 6209717410be (bug 1523351) Backed out changeset 80b34e6ce876 (bug 1523351) Backed out changeset 7bdb7982c3af (bug 1523351)
1 parent 0db63d2 commit b173205

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+65
-1315
lines changed

browser/components/resistfingerprinting/test/mochitest/test_hide_gamepad_info_iframe.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
GamepadService.noHand,
2020
4, // buttons
2121
2,
22-
0,
23-
0,
2422
0).then((aIndex) => new Promise((aResolve) => {
2523
// Press a button to make the gamepad visible to the page.
2624
GamepadService.newButtonEvent(aIndex, 0, true, true);

dom/gamepad/Gamepad.cpp

Lines changed: 6 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Gamepad)
2222
NS_INTERFACE_MAP_END
2323

2424
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(Gamepad, mParent, mButtons, mPose,
25-
mHapticActuators, mLightIndicators,
26-
mTouchEvents)
25+
mHapticActuators)
2726

2827
void Gamepad::UpdateTimestamp() {
2928
nsCOMPtr<nsPIDOMWindowInner> newWindow(do_QueryInterface(mParent));
@@ -38,14 +37,12 @@ void Gamepad::UpdateTimestamp() {
3837
Gamepad::Gamepad(nsISupports* aParent, const nsAString& aID, uint32_t aIndex,
3938
uint32_t aHashKey, GamepadMappingType aMapping,
4039
GamepadHand aHand, uint32_t aDisplayID, uint32_t aNumButtons,
41-
uint32_t aNumAxes, uint32_t aNumHaptics,
42-
uint32_t aNumLightIndicator, uint32_t aNumTouchEvents)
40+
uint32_t aNumAxes, uint32_t aNumHaptics)
4341
: mParent(aParent),
4442
mID(aID),
4543
mIndex(aIndex),
4644
mHashKey(aHashKey),
4745
mDisplayId(aDisplayID),
48-
mTouchIdHashValue(0),
4946
mMapping(aMapping),
5047
mHand(aHand),
5148
mConnected(true),
@@ -61,14 +58,6 @@ Gamepad::Gamepad(nsISupports* aParent, const nsAString& aID, uint32_t aIndex,
6158
mHapticActuators.AppendElement(
6259
new GamepadHapticActuator(mParent, mHashKey, i));
6360
}
64-
for (uint32_t i = 0; i < aNumLightIndicator; ++i) {
65-
mLightIndicators.AppendElement(
66-
new GamepadLightIndicator(mParent, mHashKey, i));
67-
}
68-
for (uint32_t i = 0; i < aNumTouchEvents; ++i) {
69-
mTouchEvents.AppendElement(new GamepadTouch(mParent));
70-
}
71-
7261
UpdateTimestamp();
7362
}
7463

@@ -99,35 +88,11 @@ void Gamepad::SetPose(const GamepadPoseState& aPose) {
9988
UpdateTimestamp();
10089
}
10190

102-
void Gamepad::SetLightIndicatorType(uint32_t aLightIndex,
103-
GamepadLightIndicatorType aType) {
104-
mLightIndicators[aLightIndex]->SetType(aType);
105-
UpdateTimestamp();
106-
}
107-
108-
void Gamepad::SetTouchEvent(uint32_t aTouchIndex,
109-
const GamepadTouchState& aTouch) {
110-
if (aTouchIndex >= mTouchEvents.Length()) {
111-
MOZ_CRASH("Touch index exceeds the event array.");
112-
return;
113-
}
114-
115-
// Handling cross-origin tracking.
116-
GamepadTouchState touchState(aTouch);
117-
if (auto hashValue = mTouchIdHash.GetValue(touchState.touchId)) {
118-
touchState.touchId = *hashValue;
119-
} else {
120-
touchState.touchId = mTouchIdHashValue;
121-
mTouchIdHash.Put(aTouch.touchId, mTouchIdHashValue);
122-
++mTouchIdHashValue;
123-
}
124-
mTouchEvents[aTouchIndex]->SetTouchState(touchState);
125-
UpdateTimestamp();
126-
}
127-
12891
void Gamepad::SetHand(GamepadHand aHand) { mHand = aHand; }
12992

13093
void Gamepad::SyncState(Gamepad* aOther) {
94+
const char* kGamepadExtEnabledPref = "dom.gamepad.extensions.enabled";
95+
13196
if (mButtons.Length() != aOther->mButtons.Length() ||
13297
mAxes.Length() != aOther->mAxes.Length()) {
13398
return;
@@ -149,24 +114,13 @@ void Gamepad::SyncState(Gamepad* aOther) {
149114
Gamepad_Binding::ClearCachedAxesValue(this);
150115
}
151116

152-
if (StaticPrefs::dom_gamepad_extensions_enabled()) {
117+
if (Preferences::GetBool(kGamepadExtEnabledPref)) {
153118
MOZ_ASSERT(aOther->GetPose());
154119
mPose->SetPoseState(aOther->GetPose()->GetPoseState());
155120
mHand = aOther->Hand();
156121
for (uint32_t i = 0; i < mHapticActuators.Length(); ++i) {
157122
mHapticActuators[i]->Set(aOther->mHapticActuators[i]);
158123
}
159-
160-
if (StaticPrefs::dom_gamepad_extensions_lightindicator()) {
161-
for (uint32_t i = 0; i < mLightIndicators.Length(); ++i) {
162-
mLightIndicators[i]->Set(aOther->mLightIndicators[i]);
163-
}
164-
}
165-
if (StaticPrefs::dom_gamepad_extensions_multitouch()) {
166-
for (uint32_t i = 0; i < mTouchEvents.Length(); ++i) {
167-
mTouchEvents[i]->Set(aOther->mTouchEvents[i]);
168-
}
169-
}
170124
}
171125

172126
UpdateTimestamp();
@@ -175,8 +129,7 @@ void Gamepad::SyncState(Gamepad* aOther) {
175129
already_AddRefed<Gamepad> Gamepad::Clone(nsISupports* aParent) {
176130
RefPtr<Gamepad> out =
177131
new Gamepad(aParent, mID, mIndex, mHashKey, mMapping, mHand, mDisplayId,
178-
mButtons.Length(), mAxes.Length(), mHapticActuators.Length(),
179-
mLightIndicators.Length(), mTouchEvents.Length());
132+
mButtons.Length(), mAxes.Length(), mHapticActuators.Length());
180133
out->SyncState(this);
181134
return out.forget();
182135
}

dom/gamepad/Gamepad.h

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
#include "mozilla/dom/GamepadButton.h"
1313
#include "mozilla/dom/GamepadPose.h"
1414
#include "mozilla/dom/GamepadHapticActuator.h"
15-
#include "mozilla/dom/GamepadLightIndicator.h"
16-
#include "mozilla/dom/GamepadTouch.h"
1715
#include "mozilla/dom/Performance.h"
1816
#include <stdint.h>
1917
#include "nsCOMPtr.h"
@@ -42,8 +40,7 @@ class Gamepad final : public nsISupports, public nsWrapperCache {
4240
Gamepad(nsISupports* aParent, const nsAString& aID, uint32_t aIndex,
4341
uint32_t aHashKey, GamepadMappingType aMapping, GamepadHand aHand,
4442
uint32_t aDisplayID, uint32_t aNumButtons, uint32_t aNumAxes,
45-
uint32_t aNumHaptics, uint32_t aNumLightIndicator,
46-
uint32_t aNumTouchEvents);
43+
uint32_t aNumHaptics);
4744

4845
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
4946
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Gamepad)
@@ -53,9 +50,6 @@ class Gamepad final : public nsISupports, public nsWrapperCache {
5350
void SetAxis(uint32_t aAxis, double aValue);
5451
void SetIndex(uint32_t aIndex);
5552
void SetPose(const GamepadPoseState& aPose);
56-
void SetLightIndicatorType(uint32_t aLightIndex,
57-
GamepadLightIndicatorType aType);
58-
void SetTouchEvent(uint32_t aTouchIndex, const GamepadTouchState& aTouch);
5953
void SetHand(GamepadHand aHand);
6054

6155
// Make the state of this gamepad equivalent to other.
@@ -99,15 +93,6 @@ class Gamepad final : public nsISupports, public nsWrapperCache {
9993
aHapticActuators = mHapticActuators;
10094
}
10195

102-
void GetLightIndicators(
103-
nsTArray<RefPtr<GamepadLightIndicator>>& aLightIndicators) const {
104-
aLightIndicators = mLightIndicators;
105-
}
106-
107-
void GetTouchEvents(nsTArray<RefPtr<GamepadTouch>>& aTouchEvents) const {
108-
aTouchEvents = mTouchEvents;
109-
}
110-
11196
private:
11297
virtual ~Gamepad() {}
11398
void UpdateTimestamp();
@@ -119,7 +104,6 @@ class Gamepad final : public nsISupports, public nsWrapperCache {
119104
// the gamepad hash key in GamepadManager
120105
uint32_t mHashKey;
121106
uint32_t mDisplayId;
122-
uint32_t mTouchIdHashValue;
123107
// The mapping in use.
124108
GamepadMappingType mMapping;
125109
GamepadHand mHand;
@@ -133,9 +117,6 @@ class Gamepad final : public nsISupports, public nsWrapperCache {
133117
DOMHighResTimeStamp mTimestamp;
134118
RefPtr<GamepadPose> mPose;
135119
nsTArray<RefPtr<GamepadHapticActuator>> mHapticActuators;
136-
nsTArray<RefPtr<GamepadLightIndicator>> mLightIndicators;
137-
nsTArray<RefPtr<GamepadTouch>> mTouchEvents;
138-
nsDataHashtable<nsUint32HashKey, uint32_t> mTouchIdHash;
139120
};
140121

141122
} // namespace dom

dom/gamepad/GamepadLightIndicator.cpp

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

dom/gamepad/GamepadLightIndicator.h

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

0 commit comments

Comments
 (0)