Bug 134324 - Add HID-based gamepad implementation for Mac
Summary: Add HID-based gamepad implementation for Mac
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Brady Eidson
URL:
Keywords:
Depends on:
Blocks: 134076
  Show dependency treegraph
 
Reported: 2014-06-25 19:23 PDT by Brady Eidson
Modified: 2014-06-25 22:31 PDT (History)
8 users (show)

See Also:


Attachments
Patch v1 (60.83 KB, patch)
2014-06-25 19:54 PDT, Brady Eidson
dino: review+
Details | Formatted Diff | Diff
Patch for landing v1 (60.87 KB, patch)
2014-06-25 21:02 PDT, Brady Eidson
beidson: commit-queue+
Details | Formatted Diff | Diff
Patch for landing v2 - Fix *one* style complaint, remove stale #include that will fix the build (60.81 KB, patch)
2014-06-25 21:17 PDT, Brady Eidson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brady Eidson 2014-06-25 19:23:31 PDT
Add HID-based gamepad implementation for Mac

This also hooks up the platform abstractions to the actual Gamepad mechanisms.

This gets the gamepad API working in WK1, and the pieces for WK2 support are also there for later use.
Comment 1 Brady Eidson 2014-06-25 19:54:13 PDT
Created attachment 233867 [details]
Patch v1

I don't expect this to pass EWS yet because it relies on the patch in bug 134325 landing first.

But it's ready for review.
Comment 2 Dean Jackson 2014-06-25 20:07:49 PDT
Comment on attachment 233867 [details]
Patch v1

View in context: https://bugs.webkit.org/attachment.cgi?id=233867&action=review

> Source/WebCore/Modules/gamepad/Gamepad.cpp:45
> +    for (unsigned i = 0; i < platformGamepad.buttonValues().size(); ++i)
> +        m_buttons.append(GamepadButton::create());

Can this be a C++11 for loop?

> Source/WebCore/Modules/gamepad/GamepadManager.cpp:71
> +    // connectect/disconnected event listeners.

Nit: typo connected

> Source/WebCore/Modules/gamepad/GamepadManager.cpp:83
> +    // connectect/disconnected event listeners.

Ditto
Comment 3 Brady Eidson 2014-06-25 20:09:42 PDT
(In reply to comment #2)
> (From update of attachment 233867 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=233867&action=review
> 
> > Source/WebCore/Modules/gamepad/Gamepad.cpp:45
> > +    for (unsigned i = 0; i < platformGamepad.buttonValues().size(); ++i)
> > +        m_buttons.append(GamepadButton::create());
> 
> Can this be a C++11 for loop?

Yes.

> 
> > Source/WebCore/Modules/gamepad/GamepadManager.cpp:71
> > +    // connectect/disconnected event listeners.
> 
> Nit: typo connected
> 
> > Source/WebCore/Modules/gamepad/GamepadManager.cpp:83
> > +    // connectect/disconnected event listeners.
> 
> Ditto

Got it.

Thanks!
Comment 4 Brady Eidson 2014-06-25 21:02:00 PDT
Created attachment 233875 [details]
Patch for landing v1
Comment 5 WebKit Commit Bot 2014-06-25 21:04:22 PDT
Attachment 233875 [details] did not pass style-queue:


ERROR: Source/WebCore/Modules/gamepad/Gamepad.h:60:  The parameter name "platformGamepad" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/WebCore/platform/mac/HIDGamepad.cpp:64:  Use 0 instead of NULL.  [readability/null] [5]
Total errors found: 2 in 20 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 Brady Eidson 2014-06-25 21:17:49 PDT
Created attachment 233878 [details]
Patch for landing v2 - Fix *one* style complaint, remove stale #include that will fix the build
Comment 7 WebKit Commit Bot 2014-06-25 21:19:13 PDT
Attachment 233878 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/mac/HIDGamepad.cpp:64:  Use 0 instead of NULL.  [readability/null] [5]
Total errors found: 1 in 20 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 8 WebKit Commit Bot 2014-06-25 21:49:58 PDT
Comment on attachment 233878 [details]
Patch for landing v2 - Fix *one* style complaint, remove stale #include that will fix the build

Clearing flags on attachment: 233878

Committed r170465: <http://trac.webkit.org/changeset/170465>
Comment 9 WebKit Commit Bot 2014-06-25 21:50:03 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Ryosuke Niwa 2014-06-25 22:31:33 PDT
Build fix attempt landed in http://trac.webkit.org/changeset/170468.