Bug 226857 - Fix some inefficient uses of SharedBuffer
Summary: Fix some inefficient uses of SharedBuffer
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-06-09 16:19 PDT by Chris Dumez
Modified: 2021-06-10 08:09 PDT (History)
27 users (show)

See Also:


Attachments
Patch (50.15 KB, patch)
2021-06-09 16:26 PDT, Chris Dumez
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (50.16 KB, patch)
2021-06-09 16:48 PDT, Chris Dumez
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (50.16 KB, patch)
2021-06-09 16:55 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (54.55 KB, patch)
2021-06-09 19:16 PDT, Chris Dumez
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (54.55 KB, patch)
2021-06-09 19:29 PDT, Chris Dumez
no flags 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-09 16:19:02 PDT
Fix some inefficient uses of SharedBuffer.
Comment 1 Chris Dumez 2021-06-09 16:26:18 PDT
Created attachment 431023 [details]
Patch
Comment 2 Chris Dumez 2021-06-09 16:48:59 PDT
Created attachment 431024 [details]
Patch
Comment 3 Chris Dumez 2021-06-09 16:55:31 PDT
Created attachment 431025 [details]
Patch
Comment 4 Darin Adler 2021-06-09 18:22:24 PDT
Comment on attachment 431025 [details]
Patch

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

> Source/WebCore/platform/SharedBuffer.h:103
> +    Vector<uint8_t> dataAsVector() { return { data(), size() }; }

This should have the word "copy" in its name.

> Source/WebCore/platform/SharedBuffer.h:188
> +    void forEachSegment(const Function<void(const uint8_t*, size_t)>&) const;

This should use a Span as the argument.

> Source/WebCore/platform/SharedBuffer.h:189
> +    bool startsWith(const uint8_t* prefix, size_t prefixSize) const;

This should use a Span as the argument.
Comment 5 Chris Dumez 2021-06-09 19:16:11 PDT
Created attachment 431041 [details]
Patch
Comment 6 Chris Dumez 2021-06-09 19:29:30 PDT
Created attachment 431042 [details]
Patch
Comment 7 EWS 2021-06-09 23:37:41 PDT
Found 1 new test failure: imported/w3c/web-platform-tests/navigation-timing/nav2_test_attributes_values.html
Comment 8 EWS 2021-06-10 08:08:24 PDT
Committed r278702 (238674@main): <https://commits.webkit.org/238674@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 431042 [details].
Comment 9 Radar WebKit Bug Importer 2021-06-10 08:09:18 PDT
<rdar://problem/79140035>