<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Decode data URLs in web process"
href="https://bugs.webkit.org/show_bug.cgi?id=148128#c36">Comment # 36</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Decode data URLs in web process"
href="https://bugs.webkit.org/show_bug.cgi?id=148128">bug 148128</a>
from <span class="vcard"><a class="email" href="mailto:koivisto@iki.fi" title="Antti Koivisto <koivisto@iki.fi>"> <span class="fn">Antti Koivisto</span></a>
</span></b>
<pre>
<span class="quote">> I don’t think we need this constructor. We should just be able to write:
>
> std::make_unique<DecodeTask>({ ... });</span >
That wouldn't compile. More awkward version does:
std::make_unique<DecodeTask>(DecodeTask { ... });
<span class="quote">> > Source/WebCore/platform/network/DataURLDecoder.cpp:68
> > + ASSERT(urlString.startsWith(dataString));
>
> This check needs to ignore ASCII case.</span >
I believe protocol part of URL is always converted to lowercase
<span class="quote">> > Source/WebCore/platform/network/DataURLDecoder.cpp:72
> > + if (headerEnd == notFound)
> > + return nullptr;
>
> Do we have a test case that covers this?</span >
Probably not. We have some explicit data url test coverage and a ton of incidental coverage. It would be good to add a bunch of more systematic cases covering all the edges.
<span class="quote">> > Source/WebCore/platform/network/DataURLDecoder.h:49
> > +void decode(const URL&, DecodeCompletionHandler);
>
> Don’t functions sometimes have state and are thus expensive to copy? If so,
> it might be nicer to take ownership of the completion handler rather than
> passing it by value.</span >
std::function has efficient move constructor. I think we just need to use WTF::move in a few places? (instead of say DecodeCompletionHandler&&)
<span class="quote">> > Source/WebCore/platform/text/DecodeEscapeSequences.h:170
> > + encodedRunPosition = length;
>
> I’m not sure this line of code is needed. We intentionally made
> encodedRunPosition a very large value so it doesn’t need to be explicitly
> checked for. Using StringView::substring with it should work because it
> clamps its arguments down to the length of the string. It’s even possible,
> depending on how URLEscapeSequence::findEndOfRun is written, that we could
> remove the if statement entirely.</span >
Ok. I didn't know that notFound value was intentionally chosen for this purpose.</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>