<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Cleanup WK2 platform gamepad handling"
   href="https://bugs.webkit.org/show_bug.cgi?id=160871#c4">Comment # 4</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Cleanup WK2 platform gamepad handling"
   href="https://bugs.webkit.org/show_bug.cgi?id=160871">bug 160871</a>
              from <span class="vcard"><a class="email" href="mailto:beidson&#64;apple.com" title="Brady Eidson &lt;beidson&#64;apple.com&gt;"> <span class="fn">Brady Eidson</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=160871#c2">comment #2</a>)
<span class="quote">&gt; Comment on <span class=""><a href="attachment.cgi?id=286103&amp;action=diff" name="attach_286103" title="Patch">attachment 286103</a> <a href="attachment.cgi?id=286103&amp;action=edit" title="Patch">[details]</a></span>
&gt; Patch
&gt; 
&gt; View in context:
&gt; <a href="https://bugs.webkit.org/attachment.cgi?id=286103&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=286103&amp;action=review</a>
&gt; 
&gt; &gt; Source/WebCore/platform/gamepad/GamepadProviderClient.h:40
&gt; &gt; +    virtual void setInitialConnectedGamepads(const Vector&lt;PlatformGamepad*&gt;&amp;) { }
&gt; 
&gt; I don't understand the lifetime of these PlatformGamepads.  Where do they
&gt; come from?  How do we know they will still be alive as long as we have
&gt; pointers to them?</span >

The platform GamepadProvider owns them. They are valid until you get a &quot;platformGamepadDisconnected&quot; message.

<span class="quote">&gt; 
&gt; &gt; Source/WebKit2/UIProcess/Gamepad/UIGamepadProvider.h:87
&gt; &gt; +    bool m_hasInitialGamepads { false };
&gt; 
&gt; This is only used in an assertion.  Could be compiled out.  Probably nbd</span >

I'd like to leave it for now, as there are grander plans for it going forward - Though I will remain cognizant of whether or not it is assertion-only.

<span class="quote">&gt; 
&gt; &gt; Source/WebKit2/WebProcess/WebProcess.cpp:1036
&gt; &gt; +void WebProcess::setInitialGamepads(const Vector&lt;WebKit::GamepadData&gt;&amp; gamepadDatas)
&gt; 
&gt; data is already plural</span >

Do you have a naming suggestion for a &quot;vector of GamepadData&quot; that is not &quot;gamepadDatas&quot; but also not &quot;gamepadDataVector&quot;? :)</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>