[webkit-reviews] review denied: [Bug 170122] [link preload] Double downloads of preloaded content when it's in MemoryCache : [Attachment 305793] Patch

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


Antti Koivisto <koivisto at iki.fi> has denied Yoav Weiss <yoav at yoav.ws>'s request
for review:
Bug 170122: [link preload] Double downloads of preloaded content when it's in
MemoryCache
https://bugs.webkit.org/show_bug.cgi?id=170122

Attachment 305793: Patch

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




--- 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.


More information about the webkit-reviews mailing list