[Webkit-unassigned] [Bug 170122] [link preload] Double downloads of preloaded content when it's in MemoryCache

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Apr 5 12:08:42 PDT 2017


https://bugs.webkit.org/show_bug.cgi?id=170122

Antti Koivisto <koivisto at iki.fi> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #305793|review?                     |review-
              Flags|                            |

--- Comment #12 from Antti Koivisto <koivisto at iki.fi> ---
Comment on attachment 305793
  --> https://bugs.webkit.org/attachment.cgi?id=305793
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=305793&action=review

> Source/WebCore/ChangeLog:8
> +        [link preload] Double downloads of preloaded content when it's in MemoryCache
> +        https://bugs.webkit.org/show_bug.cgi?id=170122
> +
> +        Reviewed by NOBODY (OOPS!).
> +
> +        No new tests, but unflaked http/tests/preload/single_download_preload_headers_charset.html.

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

> Source/WebCore/loader/cache/CachedResource.cpp:-126
> -    , m_hasUnknownEncoding(request.isLinkPreload())

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

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

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170405/254baedf/attachment.html>


More information about the webkit-unassigned mailing list