<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:darin&#64;apple.com" title="Darin Adler &lt;darin&#64;apple.com&gt;"> <span class="fn">Darin Adler</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Initial Link preload support"
   href="https://bugs.webkit.org/show_bug.cgi?id=156334">bug 156334</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 #275944 Flags</td>
           <td>review?
           </td>
           <td>review+
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Initial Link preload support"
   href="https://bugs.webkit.org/show_bug.cgi?id=156334#c26">Comment # 26</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Initial Link preload support"
   href="https://bugs.webkit.org/show_bug.cgi?id=156334">bug 156334</a>
              from <span class="vcard"><a class="email" href="mailto:darin&#64;apple.com" title="Darin Adler &lt;darin&#64;apple.com&gt;"> <span class="fn">Darin Adler</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=275944&amp;action=diff" name="attach_275944" title="Patch">attachment 275944</a> <a href="attachment.cgi?id=275944&amp;action=edit" title="Patch">[details]</a></span>
Patch

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

Looks OK. No test coverage for the various types of preloading, which seems like a problem to me.

<span class="quote">&gt; Source/WebCore/loader/LinkLoader.cpp:104
&gt; +    String lowerAs = as.convertToASCIILowercase();
&gt; +    if (lowerAs == &quot;image&quot;)
&gt; +        return CachedResource::ImageResource;
&gt; +    if (lowerAs == &quot;script&quot;)
&gt; +        return CachedResource::Script;
&gt; +    if (lowerAs == &quot;style&quot;)
&gt; +        return CachedResource::CSSStyleSheet;
&gt; +    if (lowerAs == &quot;media&quot;)
&gt; +        return CachedResource::MediaResource;
&gt; +    if (lowerAs == &quot;font&quot;)
&gt; +        return CachedResource::FontResource;
&gt; +    if (lowerAs == &quot;track&quot;)
&gt; +        return CachedResource::TextTrackResource;</span >

This should use equalLettersIgnoringASCIICase and not allocate a lowercased copy of the string.

<span class="quote">&gt; Source/WebCore/loader/LinkLoader.cpp:114
&gt; +    if (!href.isValid() || href.isEmpty()) {</span >

I found other code doing checks like this, but there is no need to check isEmpty after checking isValid. Empty URLs are always also invalid.

<span class="quote">&gt; Source/WebCore/loader/LinkLoader.cpp:118
&gt; +    Optional&lt;CachedResource::Type&gt; type = LinkLoader::getResourceTypeFromAsAttribute(as);</span >

I think this reads better with the type &quot;auto&quot; instead of writing out the Optional type.</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>