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.
<rdar://problem/86003855>