<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@yoav.ws" title="Yoav Weiss <yoav@yoav.ws>"> <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">> Comment on <span class=""><a href="attachment.cgi?id=299800&action=diff" name="attach_299800" title="Patch">attachment 299800</a> <a href="attachment.cgi?id=299800&action=edit" title="Patch">[details]</a></span>
> Patch
>
> View in context:
> <a href="https://bugs.webkit.org/attachment.cgi?id=299800&action=review">https://bugs.webkit.org/attachment.cgi?id=299800&action=review</a>
>
> > Source/WebCore/dom/Document.cpp:5046
> > + // Parser should have picked up all speculative preloads by now
>
> 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">>
> > Source/WebCore/loader/LinkLoader.cpp:183
> > linkRequest.setInitiator("link");
> > + linkRequest.setIsLinkPreload();
>
> Do we really need another bool for this? Can't we just check if the
> initiator is "link"?</span >
A "link" 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">>
> > Source/WebCore/loader/LinkPreloadResourceClients.h:66
> > + m_resource->cancelLoad();
> > m_resource->removeClient(client);
>
> I think removing the client will cancel the load if this was the only
> client. If it wasn't the only client, then something else has made the same
> request and we probably don't want to cancel the load for that other client,
> right?</span >
I'll try that
<span class="quote">>
> > Source/WebCore/loader/cache/CachedResourceLoader.h:131
> > + enum ClearPreloadsMode { ClearSpeculativePreloads, ClearAllPreloads };
>
> enum class</span >
OK
<span class="quote">>
> > Source/WebCore/loader/cache/CachedResourceRequest.cpp:48
> > + , m_isLinkPreload(false)
>
> If we added a bool here, we would want to have its initializer be an
> initializer list in the header
> 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>