WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-217226-20201009011034.patch (text/plain), 14.81 KB, created by
Adrian Perez
on 2020-10-08 15:10:36 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Adrian Perez
Created:
2020-10-08 15:10:36 PDT
Size:
14.81 KB
patch
obsolete
>Subversion Revision: 268182 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 8b2d9e0ce6c84c8fddec88ab4cbbbe46905a88bf..9d69a0f746cfb3e32f767cf378031e0d99aca43d 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,32 @@ >+2020-10-08 Adrian Perez de Castro <aperez@igalia.com> >+ >+ [GTK] Build broken with ENABLE_GAMEPAD enabled >+ https://bugs.webkit.org/show_bug.cgi?id=217226 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ No new tests needed. >+ >+ * Headers.cmake: List SharedGamepadValue.h in WebCore_PRIVATE_FRAMEWORK_HEADERS, which >+ was missing. >+ * platform/gamepad/manette/ManetteGamepad.cpp: >+ (WebCore::ManetteGamepad::ManetteGamepad): Adapt to use SharedGamepadValue. >+ (WebCore::ManetteGamepad::buttonPressedOrReleased): Ditto. >+ (WebCore::ManetteGamepad::absoluteAxisChanged): Ditto. >+ * platform/gamepad/manette/ManetteGamepad.h: Ditto. >+ * platform/gamepad/manette/ManetteGamepadProvider.cpp: Rename m_connectionDelayTimer >+ to m_initialGamepadsConnectedTimer, which better reflects the usage and also makes the >+ provider a bit more similar to HIDGamepadProvider (from the Mac port). Arrange to use >+ the EventMakesGamepadsVisible flag. >+ (WebCore::ManetteGamepadProvider::ManetteGamepadProvider): >+ (WebCore::ManetteGamepadProvider::startMonitoringGamepads): >+ (WebCore::ManetteGamepadProvider::stopMonitoringGamepads): >+ (WebCore::ManetteGamepadProvider::deviceConnected): >+ (WebCore::ManetteGamepadProvider::deviceDisconnected): >+ (WebCore::ManetteGamepadProvider::initialGamepadsConnectedTimerFired): >+ (WebCore::ManetteGamepadProvider::inputNotificationTimerFired): >+ * platform/gamepad/manette/ManetteGamepadProvider.h: Ditto. >+ > 2020-10-08 Zalan Bujtas <zalan@apple.com> > > [LFC][IFC] Using the mixture of LayoutUnit and InlineLayoutUnit types causes ASSERT(verticalGap >= 0) >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index fd740b2e276575510831200fb7304f9467d13eac..403c2d4077a48c5ccdc2daf893f699ef288d9265 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,19 @@ >+2020-10-08 Adrian Perez de Castro <aperez@igalia.com> >+ >+ [GTK] Build broken with ENABLE_GAMEPAD enabled >+ https://bugs.webkit.org/show_bug.cgi?id=217226 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UIProcess/Gamepad/UIGamepadProvider.h: Mark class as final, because the destructor is >+ final itself. >+ * UIProcess/WebProcessPool.cpp: >+ (WebKit::WebProcessPool::numberOfConnectedGamepadsForTesting): Reorganize PLATFORM(MAC) >+ guards to use GameControllerGamepadProvider only on macOS, as it is unavailable on other >+ ports. >+ * WebProcess/Gamepad/WebGamepadProvider.h: Mark class as final, because the destructor >+ is final itself. >+ > 2020-10-08 Aditya Keerthi <akeerthi@apple.com> > > [iOS] Blurring a text input and focusing a date input changes the scrollable area >diff --git a/Source/WebCore/Headers.cmake b/Source/WebCore/Headers.cmake >index a847b05ab44e5cd4a706be308c8b645b525400fe..09c7c39d9e0845464ae54712f9720dcdd1eb51b9 100644 >--- a/Source/WebCore/Headers.cmake >+++ b/Source/WebCore/Headers.cmake >@@ -1091,6 +1091,7 @@ set(WebCore_PRIVATE_FRAMEWORK_HEADERS > platform/gamepad/GamepadProvider.h > platform/gamepad/GamepadProviderClient.h > platform/gamepad/PlatformGamepad.h >+ platform/gamepad/SharedGamepadValue.h > > platform/graphics/AlphaPremultiplication.h > platform/graphics/ANGLEWebKitBridge.h >diff --git a/Source/WebCore/platform/gamepad/manette/ManetteGamepad.cpp b/Source/WebCore/platform/gamepad/manette/ManetteGamepad.cpp >index 434c11db066b210e300bfe2fac9722a7fb16e83d..c3d7a1cc9a617d9c23cf8f3cb3cf51dcdf9941ab 100644 >--- a/Source/WebCore/platform/gamepad/manette/ManetteGamepad.cpp >+++ b/Source/WebCore/platform/gamepad/manette/ManetteGamepad.cpp >@@ -132,8 +132,13 @@ ManetteGamepad::ManetteGamepad(ManetteDevice* device, unsigned index) > m_id = String::fromUTF8(manette_device_get_name(m_device.get())); > m_mapping = String::fromUTF8("standard"); > >- m_axisValues.fill(0, static_cast<size_t>(StandardGamepadAxis::Count)); >- m_buttonValues.fill(0, static_cast<size_t>(StandardGamepadButton::Count)); >+ m_axisValues.resize(static_cast<size_t>(StandardGamepadAxis::Count)); >+ for (auto& value : m_axisValues) >+ value.setValue(0.0); >+ >+ m_buttonValues.resize(static_cast<size_t>(StandardGamepadButton::Count)); >+ for (auto& value : m_buttonValues) >+ value.setValue(0.0); > > g_signal_connect(device, "button-press-event", G_CALLBACK(onButtonPressEvent), this); > g_signal_connect(device, "button-release-event", G_CALLBACK(onButtonReleaseEvent), this); >@@ -151,7 +156,7 @@ void ManetteGamepad::buttonPressedOrReleased(ManetteDevice*, StandardGamepadButt > return; > > m_lastUpdateTime = MonotonicTime::now(); >- m_buttonValues[static_cast<int>(button)] = pressed ? 1.0 : 0.0; >+ m_buttonValues[static_cast<int>(button)].setValue(pressed ? 1.0 : 0.0); > > ManetteGamepadProvider::singleton().gamepadHadInput(*this, pressed ? ManetteGamepadProvider::ShouldMakeGamepadsVisible::Yes : ManetteGamepadProvider::ShouldMakeGamepadsVisible::No); > } >@@ -162,7 +167,7 @@ void ManetteGamepad::absoluteAxisChanged(ManetteDevice*, StandardGamepadAxis axi > return; > > m_lastUpdateTime = MonotonicTime::now(); >- m_axisValues[static_cast<int>(axis)] = value; >+ m_axisValues[static_cast<int>(axis)].setValue(value); > > ManetteGamepadProvider::singleton().gamepadHadInput(*this, ManetteGamepadProvider::ShouldMakeGamepadsVisible::No); > } >diff --git a/Source/WebCore/platform/gamepad/manette/ManetteGamepad.h b/Source/WebCore/platform/gamepad/manette/ManetteGamepad.h >index 3fa5974b77cbb7d0beaf03d008f14cd93464c1f5..22f580d67f6baebcd3b38b0fe975f84f6dc407cd 100644 >--- a/Source/WebCore/platform/gamepad/manette/ManetteGamepad.h >+++ b/Source/WebCore/platform/gamepad/manette/ManetteGamepad.h >@@ -70,8 +70,8 @@ public: > ManetteGamepad(ManetteDevice*, unsigned index); > virtual ~ManetteGamepad(); > >- const Vector<double>& axisValues() const final { return m_axisValues; } >- const Vector<double>& buttonValues() const final { return m_buttonValues; } >+ const Vector<SharedGamepadValue>& axisValues() const final { return m_axisValues; } >+ const Vector<SharedGamepadValue>& buttonValues() const final { return m_buttonValues; } > > void absoluteAxisChanged(ManetteDevice*, StandardGamepadAxis, double value); > void buttonPressedOrReleased(ManetteDevice*, StandardGamepadButton, bool pressed); >@@ -79,8 +79,8 @@ public: > private: > GRefPtr<ManetteDevice> m_device; > >- Vector<double> m_buttonValues; >- Vector<double> m_axisValues; >+ Vector<SharedGamepadValue> m_buttonValues; >+ Vector<SharedGamepadValue> m_axisValues; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/platform/gamepad/manette/ManetteGamepadProvider.cpp b/Source/WebCore/platform/gamepad/manette/ManetteGamepadProvider.cpp >index 0082490ecff84180d79b91136f1f6ec572fbbff1..82bc05155371cb72718e487f63e645bace9e7187 100644 >--- a/Source/WebCore/platform/gamepad/manette/ManetteGamepadProvider.cpp >+++ b/Source/WebCore/platform/gamepad/manette/ManetteGamepadProvider.cpp >@@ -58,7 +58,7 @@ static void onDeviceDisconnected(ManetteMonitor*, ManetteDevice* device, Manette > > ManetteGamepadProvider::ManetteGamepadProvider() > : m_monitor(adoptGRef(manette_monitor_new())) >- , m_connectionDelayTimer(RunLoop::current(), this, &ManetteGamepadProvider::connectionDelayTimerFired) >+ , m_initialGamepadsConnectedTimer(RunLoop::current(), this, &ManetteGamepadProvider::initialGamepadsConnectedTimerFired) > , m_inputNotificationTimer(RunLoop::current(), this, &ManetteGamepadProvider::inputNotificationTimerFired) > { > g_signal_connect(m_monitor.get(), "device-connected", G_CALLBACK(onDeviceConnected), this); >@@ -88,8 +88,9 @@ void ManetteGamepadProvider::startMonitoringGamepads(GamepadProviderClient& clie > ASSERT(m_gamepadVector.isEmpty()); > ASSERT(m_gamepadMap.isEmpty()); > >- m_shouldDispatchCallbacks = false; >- m_connectionDelayTimer.startOneShot(connectionDelayInterval); >+ // Any connections we are notified of within the connectionDelayInterval of listening likely represent >+ // devices that were already connected, so we suppress notifying clients of these. >+ m_initialGamepadsConnectedTimer.startOneShot(connectionDelayInterval); > } > > void ManetteGamepadProvider::stopMonitoringGamepads(GamepadProviderClient& client) >@@ -100,7 +101,7 @@ void ManetteGamepadProvider::stopMonitoringGamepads(GamepadProviderClient& clien > if (shouldCloseAndUnscheduleManager) { > m_gamepadVector.clear(); > m_gamepadMap.clear(); >- m_connectionDelayTimer.stop(); >+ m_initialGamepadsConnectedTimer.stop(); > } > } > >@@ -128,21 +129,19 @@ void ManetteGamepadProvider::deviceConnected(ManetteDevice* device) > m_gamepadVector[index] = gamepad.get(); > m_gamepadMap.set(device, WTFMove(gamepad)); > >- if (!m_shouldDispatchCallbacks) { >+ if (!m_initialGamepadsConnected) { > // This added device is the result of us starting to monitor gamepads. > // We'll get notified of all connected devices during this current spin of the runloop >- // and we don't want to tell the client about any of them. >- // The m_connectionDelayTimer fires in a subsequent spin of the runloop after which >- // any connection events are actual new devices. >- m_connectionDelayTimer.startOneShot(0_s); >- >- LOG(Gamepad, "Device %p was added while suppressing callbacks, so this should be an 'already connected' event", device); >- >- return; >+ // and the client should be told they were already connected. >+ // The m_initialGamepadsConnectedTimer fires in a subsequent spin of the runloop after which >+ // any connection events are actual new devices and can trigger gamepad visibility. >+ if (!m_initialGamepadsConnectedTimer.isActive()) >+ m_initialGamepadsConnectedTimer.startOneShot(0_s); > } > >+ auto eventVisibility = m_initialGamepadsConnected ? EventMakesGamepadsVisible::Yes : EventMakesGamepadsVisible::No; > for (auto& client : m_clients) >- client->platformGamepadConnected(*m_gamepadVector[index]); >+ client->platformGamepadConnected(*m_gamepadVector[index], eventVisibility); > } > > void ManetteGamepadProvider::deviceDisconnected(ManetteDevice* device) >@@ -152,10 +151,6 @@ void ManetteGamepadProvider::deviceDisconnected(ManetteDevice* device) > std::unique_ptr<ManetteGamepad> removedGamepad = removeGamepadForDevice(device); > ASSERT(removedGamepad); > >- // Any time we get a device removed callback we know it's a real event and not an 'already connected' event. >- // We should always stop suppressing callbacks when we receive such an event. >- m_shouldDispatchCallbacks = true; >- > for (auto& client : m_clients) > client->platformGamepadDisconnected(*removedGamepad); > } >@@ -169,17 +164,14 @@ unsigned ManetteGamepadProvider::indexForNewlyConnectedDevice() > return index; > } > >-void ManetteGamepadProvider::connectionDelayTimerFired() >+void ManetteGamepadProvider::initialGamepadsConnectedTimerFired() > { >- m_shouldDispatchCallbacks = true; >- >- for (auto* client : m_clients) >- client->setInitialConnectedGamepads(m_gamepadVector); >+ m_initialGamepadsConnected = true; > } > > void ManetteGamepadProvider::inputNotificationTimerFired() > { >- if (!m_shouldDispatchCallbacks) >+ if (!m_initialGamepadsConnected) > return; > > dispatchPlatformGamepadInputActivity(); >diff --git a/Source/WebCore/platform/gamepad/manette/ManetteGamepadProvider.h b/Source/WebCore/platform/gamepad/manette/ManetteGamepadProvider.h >index bf7a7dded36de503da28183dd21e73fecbfada69..53c1405c96ca36a0354ba10b0b4ad9a0345db024 100644 >--- a/Source/WebCore/platform/gamepad/manette/ManetteGamepadProvider.h >+++ b/Source/WebCore/platform/gamepad/manette/ManetteGamepadProvider.h >@@ -62,15 +62,15 @@ private: > std::unique_ptr<ManetteGamepad> removeGamepadForDevice(ManetteDevice*); > > unsigned indexForNewlyConnectedDevice(); >- void connectionDelayTimerFired(); >+ void initialGamepadsConnectedTimerFired(); > void inputNotificationTimerFired(); > > Vector<PlatformGamepad*> m_gamepadVector; > HashMap<ManetteDevice*, std::unique_ptr<ManetteGamepad>> m_gamepadMap; >- bool m_shouldDispatchCallbacks { false }; >+ bool m_initialGamepadsConnected { false }; > > GRefPtr<ManetteMonitor> m_monitor; >- RunLoop::Timer<ManetteGamepadProvider> m_connectionDelayTimer; >+ RunLoop::Timer<ManetteGamepadProvider> m_initialGamepadsConnectedTimer; > RunLoop::Timer<ManetteGamepadProvider> m_inputNotificationTimer; > }; > >diff --git a/Source/WebKit/UIProcess/Gamepad/UIGamepadProvider.h b/Source/WebKit/UIProcess/Gamepad/UIGamepadProvider.h >index cb4262e38c7e571c118d337a138792d4a9f2c54f..2701f99dc974662cbb3657e0695581f8c6ae9420 100644 >--- a/Source/WebKit/UIProcess/Gamepad/UIGamepadProvider.h >+++ b/Source/WebKit/UIProcess/Gamepad/UIGamepadProvider.h >@@ -39,7 +39,7 @@ class WebPageProxy; > class WebProcessPool; > class GamepadData; > >-class UIGamepadProvider : public WebCore::GamepadProviderClient { >+class UIGamepadProvider final : public WebCore::GamepadProviderClient { > public: > static UIGamepadProvider& singleton(); > >diff --git a/Source/WebKit/UIProcess/WebProcessPool.cpp b/Source/WebKit/UIProcess/WebProcessPool.cpp >index 8d987bb66d14340896128d73930f2a1cadd699a6..6c665676c8872722491222793b06af6d61a52a6f 100644 >--- a/Source/WebKit/UIProcess/WebProcessPool.cpp >+++ b/Source/WebKit/UIProcess/WebProcessPool.cpp >@@ -1569,14 +1569,16 @@ size_t WebProcessPool::numberOfConnectedGamepadsForTesting(GamepadType gamepadTy > switch (gamepadType) { > case GamepadType::All: > return UIGamepadProvider::singleton().numberOfConnectedGamepads(); >- case GamepadType::HID: > #if PLATFORM(MAC) >+ case GamepadType::HID: > return HIDGamepadProvider::singleton().numberOfConnectedGamepads(); >-#else >- return 0; >-#endif > case GamepadType::GameControllerFramework: > return GameControllerGamepadProvider::singleton().numberOfConnectedGamepads(); >+#else >+ case GamepadType::HID: >+ case GamepadType::GameControllerFramework: >+ return 0; >+#endif > } > #else > return 0; >diff --git a/Source/WebKit/WebProcess/Gamepad/WebGamepadProvider.h b/Source/WebKit/WebProcess/Gamepad/WebGamepadProvider.h >index 8a17f9084b6693d56689348c2f3e93fe2c4f6abc..f82111712384a6a872ac69167ed414b580d5052e 100644 >--- a/Source/WebKit/WebProcess/Gamepad/WebGamepadProvider.h >+++ b/Source/WebKit/WebProcess/Gamepad/WebGamepadProvider.h >@@ -43,7 +43,7 @@ class WebGamepad; > > class GamepadData; > >-class WebGamepadProvider : public WebCore::GamepadProvider { >+class WebGamepadProvider final : public WebCore::GamepadProvider { > public: > static WebGamepadProvider& singleton(); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 217226
:
410326
|
410887
|
410889
|
410967