Bug 282210

Summary: [GLib] Provide and use helper functions to convert GBytes to std::span
Product: WebKit Reporter: Adrian Perez <aperez>
Component: PlatformAssignee: 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
Reported 2024-10-28 15:44:34 PDT
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
Adrian Perez
Comment 1 2024-10-28 15:51:13 PDT
EWS
Comment 2 2024-10-29 13:47:10 PDT
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
Comment 3 2024-10-29 13:48:17 PDT
Note You need to log in before you can comment on or make changes to this bug.