<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:achristensen&#64;apple.com" title="Alex Christensen &lt;achristensen&#64;apple.com&gt;"> <span class="fn">Alex Christensen</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [WinCairo] Support more video formats."
   href="https://bugs.webkit.org/show_bug.cgi?id=152890">bug 152890</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Attachment #268541 Flags</td>
           <td>review?
           </td>
           <td>review-
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [WinCairo] Support more video formats."
   href="https://bugs.webkit.org/show_bug.cgi?id=152890#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [WinCairo] Support more video formats."
   href="https://bugs.webkit.org/show_bug.cgi?id=152890">bug 152890</a>
              from <span class="vcard"><a class="email" href="mailto:achristensen&#64;apple.com" title="Alex Christensen &lt;achristensen&#64;apple.com&gt;"> <span class="fn">Alex Christensen</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=268541&amp;action=diff" name="attach_268541" title="Patch">attachment 268541</a> <a href="attachment.cgi?id=268541&amp;action=edit" title="Patch">[details]</a></span>
Patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=268541&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=268541&amp;action=review</a>

Functionality looks good, there are just a few optimizations and reorganizations we need to do.

<span class="quote">&gt; Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:124
&gt; +    static HashSet&lt;String&gt; cachedTypes;</span >

Use NeverDestroyed instead of static.  Also, you should probably make this in a separate function like gstreamer's mimeTypeCache(), except have it just return a reference, not a whole HashSet.

<span class="quote">&gt; Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:134
&gt; +    HRESULT hr = MFGetSupportedMimeTypesPtr()(&amp;propVarMimeTypeArray);</span >

This will crash on WindowsXP.  I don't think that's a problem, because we don't support XP any more.

<span class="quote">&gt; Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:156
&gt; +    HashSet&lt;String&gt; types;
&gt; +    getSupportedTypes(types);</span >

We should't copy the whole HashSet every time we want to check if one type is supported.

<span class="quote">&gt; Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:158
&gt; +    for (HashSet&lt;String&gt;::iterator it = types.begin(); it != types.end(); ++it) {</span >

This is what HashSet.contains is for.  No need to iterate.</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>