<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Avoid evicting link preload resources when parsing is done."
   href="https://bugs.webkit.org/show_bug.cgi?id=167415#c18">Comment # 18</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Avoid evicting link preload resources when parsing is done."
   href="https://bugs.webkit.org/show_bug.cgi?id=167415">bug 167415</a>
              from <span class="vcard"><a class="email" href="mailto:yoav&#64;yoav.ws" title="Yoav Weiss &lt;yoav&#64;yoav.ws&gt;"> <span class="fn">Yoav Weiss</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=167415#c17">comment #17</a>)
<span class="quote">&gt; Comment on <span class=""><a href="attachment.cgi?id=299800&amp;action=diff" name="attach_299800" title="Patch">attachment 299800</a> <a href="attachment.cgi?id=299800&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=299800&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=299800&amp;action=review</a>
&gt; 
&gt; &gt; Source/WebCore/dom/Document.cpp:5046
&gt; &gt; +    // Parser should have picked up all speculative preloads by now
&gt; 
&gt; Is there a difference between a speculative preload and a preload?</span >

A speculative preload is one issued by the preloadScanner (at least that's the terminology that I used)

<span class="quote">&gt; 
&gt; &gt; Source/WebCore/loader/LinkLoader.cpp:183
&gt; &gt;      linkRequest.setInitiator(&quot;link&quot;);
&gt; &gt; +    linkRequest.setIsLinkPreload();
&gt; 
&gt; Do we really need another bool for this?  Can't we just check if the
&gt; initiator is &quot;link&quot;?</span >

A &quot;link&quot; initiator can also be a stylesheet. A slightly similar flag is the ForPreload flag, which signified if a request and a resource were triggered as a speculative preload.

Maybe we can somehow unite those flags, but a 4 state enum is not necessarily better/clearer than two bools

<span class="quote">&gt; 
&gt; &gt; Source/WebCore/loader/LinkPreloadResourceClients.h:66
&gt; &gt; +            m_resource-&gt;cancelLoad();
&gt; &gt;              m_resource-&gt;removeClient(client);
&gt; 
&gt; I think removing the client will cancel the load if this was the only
&gt; client.  If it wasn't the only client, then something else has made the same
&gt; request and we probably don't want to cancel the load for that other client,
&gt; right?</span >

I'll try that

<span class="quote">&gt; 
&gt; &gt; Source/WebCore/loader/cache/CachedResourceLoader.h:131
&gt; &gt; +    enum ClearPreloadsMode { ClearSpeculativePreloads, ClearAllPreloads };
&gt; 
&gt; enum class</span >

OK

<span class="quote">&gt; 
&gt; &gt; Source/WebCore/loader/cache/CachedResourceRequest.cpp:48
&gt; &gt; +    , m_isLinkPreload(false)
&gt; 
&gt; If we added a bool here, we would want to have its initializer be an
&gt; initializer list in the header
&gt; bool m_isLinkPreload { false };</span >

OK</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>