Bug 282210
| Summary: | [GLib] Provide and use helper functions to convert GBytes to std::span | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Adrian Perez <aperez> |
| Component: | Platform | Assignee: | Adrian Perez <aperez> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | bugs-noreply, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Local Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Bug Depends on: | 281571 | ||
| Bug Blocks: | |||
Adrian Perez
In a number of locations we use g_bytes_get_data() to immediately make
a new std::span; which needs WTF_ALLOW_UNSAFE_BUFFER_USAGE_{BEGIN,END}.
We could provide a convenience helper template that takes a GBytes and
the item type and returns the corresponding std::span, then the unsafe
std::span construction would be a controller call in a single location,
making the code easier to audit.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Adrian Perez
Pull request: https://github.com/WebKit/WebKit/pull/35830
EWS
Committed 285855@main (bdeb007fd6c1): <https://commits.webkit.org/285855@main>
Reviewed commits have been landed. Closing PR #35830 and removing active labels.
Radar WebKit Bug Importer
<rdar://problem/138864715>