Bug 250149

Summary: Add plumbing for Gamepad.vibrationActuator support
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebCore Misc.Assignee: Michael Catanzaro <mcatanzaro>
Status: RESOLVED FIXED    
Severity: Normal CC: mcatanzaro, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 248989    

Description Chris Dumez 2023-01-05 14:01:40 PST
Add plumbing for Gamepad.vibrationActuator support:
- https://w3c.github.io/gamepad/extensions.html#dom-gamepadhapticactuator
Comment 1 Chris Dumez 2023-01-05 14:17:49 PST
Pull request: https://github.com/WebKit/WebKit/pull/8251
Comment 2 EWS 2023-01-06 13:57:03 PST
Committed 258559@main (7203ee047b6c): <https://commits.webkit.org/258559@main>

Reviewed commits have been landed. Closing PR #8251 and removing active labels.
Comment 3 Radar WebKit Bug Importer 2023-01-06 13:58:16 PST
<rdar://problem/103966957>
Comment 4 Michael Catanzaro 2023-01-06 16:05:05 PST
Looks like this broke the GTK build:

/home/mcatanzaro/Projects/WebKit/Source/WebCore/platform/gamepad/EmptyGamepadProvider.cpp: In member function ‘virtual void WebCore::EmptyGamepadProvider::playEffect(unsigned int, const WTF::String&, WebCore::GamepadHapticEffectType, const WebCore::GamepadEffectParameters&, WTF::CompletionHandler<void(bool)>&&)’:
/home/mcatanzaro/Projects/WebKit/Source/WebCore/platform/gamepad/EmptyGamepadProvider.cpp:52:22: error: no match for call to ‘(WTF::CompletionHandler<void(bool)>) (bool)’
   52 |     completionHandler(false);
      |     ~~~~~~~~~~~~~~~~~^~~~~~~
/home/mcatanzaro/Projects/WebKit/Source/WebCore/platform/gamepad/EmptyGamepadProvider.cpp: In member function ‘virtual void WebCore::EmptyGamepadProvider::stopEffects(unsigned int, const WTF::String&, WTF::CompletionHandler<void()>&&)’:
/home/mcatanzaro/Projects/WebKit/Source/WebCore/platform/gamepad/EmptyGamepadProvider.cpp:57:22: error: no match for call to ‘(WTF::CompletionHandler<void()>) ()’
   57 |     completionHandler();
      |     ~~~~~~~~~~~~~~~~~^~

The code *looks* correct, though...
Comment 5 Chris Dumez 2023-01-06 16:11:22 PST
(In reply to Michael Catanzaro from comment #4)
> Looks like this broke the GTK build:
> 
> /home/mcatanzaro/Projects/WebKit/Source/WebCore/platform/gamepad/
> EmptyGamepadProvider.cpp: In member function ‘virtual void
> WebCore::EmptyGamepadProvider::playEffect(unsigned int, const WTF::String&,
> WebCore::GamepadHapticEffectType, const WebCore::GamepadEffectParameters&,
> WTF::CompletionHandler<void(bool)>&&)’:
> /home/mcatanzaro/Projects/WebKit/Source/WebCore/platform/gamepad/
> EmptyGamepadProvider.cpp:52:22: error: no match for call to
> ‘(WTF::CompletionHandler<void(bool)>) (bool)’
>    52 |     completionHandler(false);
>       |     ~~~~~~~~~~~~~~~~~^~~~~~~
> /home/mcatanzaro/Projects/WebKit/Source/WebCore/platform/gamepad/
> EmptyGamepadProvider.cpp: In member function ‘virtual void
> WebCore::EmptyGamepadProvider::stopEffects(unsigned int, const WTF::String&,
> WTF::CompletionHandler<void()>&&)’:
> /home/mcatanzaro/Projects/WebKit/Source/WebCore/platform/gamepad/
> EmptyGamepadProvider.cpp:57:22: error: no match for call to
> ‘(WTF::CompletionHandler<void()>) ()’
>    57 |     completionHandler();
>       |     ~~~~~~~~~~~~~~~~~^~
> 
> The code *looks* correct, though...

Maybe we need to include <wtf/CompletionHandler.h> inside EmptyGamepadProvider.cpp. Would you be able to try?
Comment 6 Michael Catanzaro 2023-01-06 16:16:03 PST
I had the same idea. Pretty sure it worked: my build is nearly done....
Comment 7 Michael Catanzaro 2023-01-06 16:21:47 PST
Yes, that works.
Comment 8 Michael Catanzaro 2023-01-06 16:24:23 PST
Re-opening for pull request https://github.com/WebKit/WebKit/pull/8331
Comment 9 EWS 2023-01-06 16:27:57 PST
Committed 258578@main (3383a19ab4f9): <https://commits.webkit.org/258578@main>

Reviewed commits have been landed. Closing PR #8331 and removing active labels.