[Webkit-unassigned] [Bug 220981] Load data URLs in the web process also for synchronous loads

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 28 03:00:55 PST 2021


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

--- Comment #8 from Carlos Garcia Campos <cgarcia at igalia.com> ---
Comment on attachment 418528
  --> https://bugs.webkit.org/attachment.cgi?id=418528
Patch

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

>> Source/WebCore/platform/network/DataURLDecoder.cpp:221
>> +    bool success = task->process();
> 
> I don't think we need a local variable here.  I think the function logic would look simpler like this:
> 
> if (!task->process())
>     return WTF::nullopt;
> if (task->isBase64) {
>     if (!decodeBase64(*task, mode))
>         return WTF::nullopt;
> } else
>     decodeEscaped(*task);
> return WTFMove(task->result);
> 
> Also, this whole thing is duplicate code.  I think this function should be called decodeSynchronously and decode should call it.

Ok, I'll moved the common parts, the whole function can't be used from the async function because the task creation is different.

>> Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp:547
>> +    result.response.setHTTPStatusCode(200);
> 
> This is adding duplicate code with ResourceLoader::loadDataURL.  Could we make them share code?

Yes.

>> Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp:601
>> +        auto syncLoadResult = loadDataURLSynchronously(request);
> 
> WebLoaderStrategy::loadResourceSynchronously should return a SyncLoadResult instead of taking error, response, and data as out params.

SyncLoadResult is private. We could make it public and update all the callers, but I think that refactoring is out of scope of this bug.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210128/7d1f2fac/attachment.htm>


More information about the webkit-unassigned mailing list