Bug 233511 - Investigate if ScriptBufferSourceProvider could do without having to flatten underlying SharedBuffer
Summary: Investigate if ScriptBufferSourceProvider could do without having to flatten ...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-11-25 22:04 PST by Jean-Yves Avenard [:jya]
Modified: 2021-12-12 14:23 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Yves Avenard [:jya] 2021-11-25 22:04:32 PST
Seen in https://bugs.webkit.org/show_bug.cgi?id=233030#c13

ScriptBufferSourceProvider wraps a ScriptBuffer and ScriptBufferSourceProvider::source() flatten that ScriptBuffer's SharedBuffer to access the raw content and use this information to return a StringView.

A StringView is non-owning requiring ScriptBufferSourceProvider to take an extra reference to the flatten SharedBuffer so we have the content held in both the ScriptBuffer (non-flattened) and in ScriptBufferSourceProvider (flattened)

Ideally, we would have StringView keep a raw reference to the SharedBuffer and use SharedBuffer:read() to access the content when needed on demand.

Depends on the requirements: speed vs memory cost.
Comment 1 Radar WebKit Bug Importer 2021-12-02 22:05:24 PST
<rdar://problem/86003855>