<html>
    <head>
      <base href="https://bugs.webkit.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:koivisto&#64;iki.fi" title="Antti Koivisto &lt;koivisto&#64;iki.fi&gt;"> <span class="fn">Antti Koivisto</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [link preload] Double downloads of preloaded content when it's in MemoryCache"
   href="https://bugs.webkit.org/show_bug.cgi?id=170122">bug 170122</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 #305793 Flags</td>
           <td>review?
           </td>
           <td>review-
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [link preload] Double downloads of preloaded content when it's in MemoryCache"
   href="https://bugs.webkit.org/show_bug.cgi?id=170122#c12">Comment # 12</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [link preload] Double downloads of preloaded content when it's in MemoryCache"
   href="https://bugs.webkit.org/show_bug.cgi?id=170122">bug 170122</a>
              from <span class="vcard"><a class="email" href="mailto:koivisto&#64;iki.fi" title="Antti Koivisto &lt;koivisto&#64;iki.fi&gt;"> <span class="fn">Antti Koivisto</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=305793&amp;action=diff" name="attach_305793" title="Patch">attachment 305793</a> <a href="attachment.cgi?id=305793&amp;action=edit" title="Patch">[details]</a></span>
Patch

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

<span class="quote">&gt; Source/WebCore/ChangeLog:8
&gt; +        [link preload] Double downloads of preloaded content when it's in MemoryCache
&gt; +        <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [link preload] Double downloads of preloaded content when it's in MemoryCache"
   href="show_bug.cgi?id=170122">https://bugs.webkit.org/show_bug.cgi?id=170122</a>
&gt; +
&gt; +        Reviewed by NOBODY (OOPS!).
&gt; +
&gt; +        No new tests, but unflaked http/tests/preload/single_download_preload_headers_charset.html.</span >

You should explain in the ChangeLog what problem this solves (that is causing the flakiness) and how.

<span class="quote">&gt; Source/WebCore/loader/cache/CachedResource.cpp:-126
&gt; -    , m_hasUnknownEncoding(request.isLinkPreload())</span >

The existing behaviour is safe because it is limited to preloads. However this patch makes the encoding changes happen in other situations too.

<span class="quote">&gt; Source/WebCore/loader/cache/CachedScript.cpp:61
&gt;  void CachedScript::setEncoding(const String&amp; chs)
&gt;  {
&gt; +    TextEncoding previousEncoding = m_decoder-&gt;encoding();
&gt;      m_decoder-&gt;setEncoding(chs, TextResourceDecoder::EncodingFromHTTPHeader);
&gt; +    if (previousEncoding != m_decoder-&gt;encoding()) {
&gt; +        m_script = String();
&gt; +        m_scriptHash = 0;
&gt; +        m_decodingState = NeverDecoded;
&gt; +    }
&gt;  }</span >

I don't think this is safe. CachedScript might have existing clients that expect it to stay immutable. It may be impossible to reconstruct m_script after encoding change.</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>