[Webkit-unassigned] [Bug 148128] Decode data URLs in web process

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 19 09:52:32 PDT 2015


--- Comment #17 from Darin Adler <darin at apple.com> ---
Comment on attachment 259369
  --> https://bugs.webkit.org/attachment.cgi?id=259369

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

> Source/WebCore/platform/network/DataURLDecoder.h:31
> +#include <wtf/text/WTFString.h>

Could use <wtf/Forward.h> instead.

> Source/WebCore/platform/network/DataURLDecoder.h:46
> +void decode(const URL&, std::function<void (const Result*)>);

Why a pointer rather than a reference?

> Source/WebCore/platform/text/DecodeEscapeSequences.h:118
> -        return (encoding.isValid() ? encoding : UTF8Encoding()).decode(buffer.data(), p - buffer.data());
> +        if (encoding.isValid())
> +            return encoding.decode(buffer.data(), p - buffer.data());
> +        return String(buffer.data(), p - buffer.data());

What makes this behavior change OK? Maybe I am wrong, but I don’t think it’s OK! I have no objections to making a fast path which treats sequences as Latin-1 since that’s what we store in 8-bit WTF::String, but that’s not the same thing as treating sequences as UTF-8. The old contract was that we would treat the sequences as UTF-8 when no encoding was passed in.

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/20150819/c8279e58/attachment.html>

More information about the webkit-unassigned mailing list