[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
Wed Jan 27 15:01:22 PST 2021


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

Alex Christensen <achristensen at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #418528|                            |commit-queue-
              Flags|                            |

--- Comment #7 from Alex Christensen <achristensen at apple.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.

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

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

-- 
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/20210127/51b43f4f/attachment-0001.htm>


More information about the webkit-unassigned mailing list