Title: [283074] trunk/Source/WebCore
Revision
283074
Author
[email protected]
Date
2021-09-24 23:24:50 -0700 (Fri, 24 Sep 2021)

Log Message

[GTK] Assertion on gamepad in debug build
https://bugs.webkit.org/show_bug.cgi?id=230682

Reviewed by Adrian Perez de Castro.

Fix assertions on gamepad handling in debug build.

No new tests needed.

* platform/gamepad/manette/ManetteGamepad.cpp:
(WebCore::toStandardGamepadAxis): remove assertion if unknown axis change.
(WebCore::toStandardGamepadButton): remove assertion if unknown buttons change.
* platform/gamepad/manette/ManetteGamepadProvider.cpp:
(WebCore::ManetteGamepadProvider::startMonitoringGamepads): Insert connected devices
asynchronously, after starting the device monitor, as expected by WebProcess.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (283073 => 283074)


--- trunk/Source/WebCore/ChangeLog	2021-09-25 05:03:08 UTC (rev 283073)
+++ trunk/Source/WebCore/ChangeLog	2021-09-25 06:24:50 UTC (rev 283074)
@@ -1,3 +1,21 @@
+2021-09-24  Víctor Manuel Jáquez Leal  <[email protected]>
+
+        [GTK] Assertion on gamepad in debug build
+        https://bugs.webkit.org/show_bug.cgi?id=230682
+
+        Reviewed by Adrian Perez de Castro.
+
+        Fix assertions on gamepad handling in debug build.
+
+        No new tests needed.
+
+        * platform/gamepad/manette/ManetteGamepad.cpp:
+        (WebCore::toStandardGamepadAxis): remove assertion if unknown axis change.
+        (WebCore::toStandardGamepadButton): remove assertion if unknown buttons change.
+        * platform/gamepad/manette/ManetteGamepadProvider.cpp:
+        (WebCore::ManetteGamepadProvider::startMonitoringGamepads): Insert connected devices
+        asynchronously, after starting the device monitor, as expected by WebProcess.
+
 2021-09-24  Nikos Mouchtaris  <[email protected]>
 
         Implement round,mod,rem functions for calc

Modified: trunk/Source/WebCore/platform/gamepad/manette/ManetteGamepad.cpp (283073 => 283074)


--- trunk/Source/WebCore/platform/gamepad/manette/ManetteGamepad.cpp	2021-09-25 05:03:08 UTC (rev 283073)
+++ trunk/Source/WebCore/platform/gamepad/manette/ManetteGamepad.cpp	2021-09-25 06:24:50 UTC (rev 283074)
@@ -47,7 +47,7 @@
     case ABS_RY:
         return ManetteGamepad::StandardGamepadAxis::RightStickY;
     default:
-        ASSERT_NOT_REACHED();
+        break;
     }
     return ManetteGamepad::StandardGamepadAxis::Unknown;
 }
@@ -98,7 +98,7 @@
     case BTN_DPAD_RIGHT:
         return ManetteGamepad::StandardGamepadButton::DPadRight;
     default:
-        ASSERT_NOT_REACHED();
+        break;
     }
     return ManetteGamepad::StandardGamepadButton::Unknown;
 }

Modified: trunk/Source/WebCore/platform/gamepad/manette/ManetteGamepadProvider.cpp (283073 => 283074)


--- trunk/Source/WebCore/platform/gamepad/manette/ManetteGamepadProvider.cpp	2021-09-25 05:03:08 UTC (rev 283073)
+++ trunk/Source/WebCore/platform/gamepad/manette/ManetteGamepadProvider.cpp	2021-09-25 06:24:50 UTC (rev 283074)
@@ -89,10 +89,12 @@
     // devices that were already connected, so we suppress notifying clients of these.
     m_initialGamepadsConnectedTimer.startOneShot(connectionDelayInterval);
 
-    ManetteDevice* device;
-    GUniquePtr<ManetteMonitorIter> iter(manette_monitor_iterate(m_monitor.get()));
-    while (manette_monitor_iter_next(iter.get(), &device))
-        deviceConnected(device);
+    RunLoop::current().dispatch([this] {
+        ManetteDevice* device;
+        GUniquePtr<ManetteMonitorIter> iter(manette_monitor_iterate(m_monitor.get()));
+        while (manette_monitor_iter_next(iter.get(), &device))
+            deviceConnected(device);
+    });
 }
 
 void ManetteGamepadProvider::stopMonitoringGamepads(GamepadProviderClient& client)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to