Closed
Bug 1358064
Opened 8 years ago
Closed 8 years ago
Refactor fire event functions in GamepadManager
Categories
(Core :: DOM: Core & HTML, enhancement)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla55
| Tracking | Status | |
|---|---|---|
| firefox55 | --- | fixed |
People
(Reporter: daoshengmu, Assigned: cleu)
References
Details
Attachments
(1 file, 1 obsolete file)
I notice there are some duplicate code when asking global window fire events and set attributes to the gamepads. We should do some refactor at NewButtonEvent/NewAxisMoveEvent/NewPoseEvent/NewHandChangeEvent.
| Assignee | ||
Updated•8 years ago
|
Assignee: nobody → cleu
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Reporter | ||
Comment 6•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8860285 [details]
Bug 1358064 - Simplify Gamepad Event processing;
https://reviewboard.mozilla.org/r/132308/#review135218
r=me, after fixing some nits.
::: dom/gamepad/GamepadManager.cpp:529
(Diff revision 2)
> - NewAxisMoveEvent(a.index(), a.service_type(), a.axis(), a.value());
> + // can mutate the mListeners array.
> + nsTArray<RefPtr<nsGlobalWindow>> listeners(mListeners);
> + MOZ_ASSERT(!listeners.IsEmpty());
> +
> + for (uint32_t i = 0; i < listeners.Length(); i++) {
> +
please remove this new line
::: dom/gamepad/GamepadManager.cpp:557
(Diff revision 2)
> - if (aEvent.type() == GamepadChangeEvent::TGamepadPoseInformation) {
> +
> + RefPtr<Gamepad> gamepad;
> +
> + switch (aEvent.type()) {
> + case GamepadChangeEvent::TGamepadButtonInformation:
> + {
You can choose to remove {} scope or let {} align the letter 'c' of case.
::: dom/gamepad/GamepadManager.cpp:588
(Diff revision 2)
> + RefPtr<Gamepad> gamepad;
> + bool ret = false;
> +
> + switch (aEvent.type()) {
> + case GamepadChangeEvent::TGamepadButtonInformation:
> + {
Same as {} align issue
Attachment #8860285 -
Flags: review?(dmu) → review+
| Reporter | ||
Comment 7•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8859949 [details]
Bug 1358064 - Part1: Combine MaybeWindowHasSeenGamepad and FireConnectionEvent; .mielczarek
https://reviewboard.mozilla.org/r/131998/#review135226
LGTM
Attachment #8859949 -
Flags: review?(dmu) → review+
| Comment hidden (mozreview-request) |
| Assignee | ||
Comment 9•8 years ago
|
||
The scopes in the switch-case code is need because each case has its own variation of GamepadChangeEvent, without them will result in a redefinition variable compile error.
| Comment hidden (mozreview-request) |
| Assignee | ||
Updated•8 years ago
|
Attachment #8859949 -
Attachment is obsolete: true
Attachment #8859949 -
Flags: review?(ted)
| Assignee | ||
Comment 11•8 years ago
|
||
| Assignee | ||
Updated•8 years ago
|
Keywords: checkin-needed
Comment 12•8 years ago
|
||
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/2981a5649a3a
Simplify Gamepad Event processing; r=daoshengmu
Keywords: checkin-needed
Comment 13•8 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•