<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Add event support for link preload."
   href="https://bugs.webkit.org/show_bug.cgi?id=158466#c39">Comment # 39</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Add event support for link preload."
   href="https://bugs.webkit.org/show_bug.cgi?id=158466">bug 158466</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>Comment on <span class=""><a href="attachment.cgi?id=280799&amp;action=diff" name="attach_280799" title="Patch">attachment 280799</a> <a href="attachment.cgi?id=280799&amp;action=edit" title="Patch">[details]</a></span>
Patch

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

<span class="quote">&gt;&gt; Source/WebCore/loader/LinkPreloadResourceClients.cpp:2
&gt;&gt; + * Copyright 2016 The Chromium Authors. All rights reserved.
&gt; 
&gt; Did the chromium authors write this?  Is there a corresponding crbug?</span >

The crbug is <a href="https://bugs.chromium.org/p/chromium/issues/detail?id=552289">https://bugs.chromium.org/p/chromium/issues/detail?id=552289</a>

I added these files to the Chromium project a few months back. I consulted other Chromium developers for the design.

<span class="quote">&gt;&gt; Source/WebCore/loader/LinkPreloadResourceClients.h:28
&gt;&gt; +#define LinkPreloadResourceClients_h
&gt; 
&gt; #pragma once</span >

will change

<span class="quote">&gt;&gt; Source/WebCore/loader/LinkPreloadResourceClients.h:81
&gt;&gt; +        return new LinkPreloadScriptResourceClient(loader, resource);
&gt; 
&gt; This is a memory leak.  There's no corresponding delete.  Instead of Optional, I think we should just use std::unique_ptr</span >

Thanks for catching this. I'll change it to use unique_ptr, and add a LinkLoader member that keeps that reference around.

<span class="quote">&gt;&gt; Source/WebCore/loader/cache/CachedResourceLoader.cpp:1035
&gt;&gt;  #if !PLATFORM(IOS)
&gt; 
&gt; I think we should consider making iOS loading work more like everything else.  Probably not in this patch, though.</span >

I agree. I think we're using the OS here as a signal for network conditions, where we could most probably address those directly.

<span class="quote">&gt;&gt; Source/WebCore/platform/network/ResourceRequestBase.h:152
&gt;&gt; +    void setIgnoreForRequestCounting(bool ignoreForRequestCounting) { m_ignoreForRequestCounting = ignoreForRequestCounting; }
&gt; 
&gt; shouldIgnoreForeRequestCounting and setShouldIgnoreForRequestCounting might be better names.  Or maybe ignoreForRequestCount to match CachedResource.</span >

will change to ignoreForRequestCount for better consistency.</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>