Bug 226674 - Optimize a few call sites creating SharedBuffer objects
Summary: Optimize a few call sites creating SharedBuffer objects
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
Keywords: InRadar
Depends on:
Reported: 2021-06-04 20:43 PDT by Chris Dumez
Modified: 2021-06-05 01:09 PDT (History)
14 users (show)

See Also:

Patch (9.53 KB, patch)
2021-06-04 20:44 PDT, Chris Dumez
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2021-06-04 20:43:11 PDT
Optimization a few call sites creating SharedBuffer objects.
Comment 1 Chris Dumez 2021-06-04 20:44:53 PDT
Created attachment 430640 [details]
Comment 2 Darin Adler 2021-06-04 21:18:02 PDT
Comment on attachment 430640 [details]

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

> Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp:-1249
> -        overrideData = SharedBuffer::create(content.utf8().data(), content.utf8().length());

Wow, we should grep for this mistake, even when it doesn’t involve SharedBuffer.

> Source/WebKit/WebProcess/WebPage/WebPage.cpp:1651
> +    auto sharedBuffer = SharedBuffer::create(data.data(), data.size());

Seems a little sad that we copy in all these IPC cases. But I guess getting lifetime right would be tricky if we used more of a data view instead of a copy.
Comment 3 EWS 2021-06-04 22:46:03 PDT
Committed r278523 (238522@main): <https://commits.webkit.org/238522@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 430640 [details].
Comment 4 Radar WebKit Bug Importer 2021-06-04 22:47:15 PDT