Bug 241584 - remove concept of non-static Strings with non-owned character data
Summary: remove concept of non-static Strings with non-owned character data
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-06-13 19:32 PDT by Cameron McCormack (:heycam)
Modified: 2022-06-20 19:33 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cameron McCormack (:heycam) 2022-06-13 19:32:35 PDT
It's possible to create non-static String objects that point to non-owned character data.  Specifically, StringView::toStringWithoutCopying can do this.  It's a bit dangerous since it's then not obvious to users of String that there is an arbitrary ownership dependence in there.

We should consider removing that feature of String objects and replace their use with explicit uses of StringView.

It's possible some places may want to represent "a String or a StringView", and we can consider introducing a type to mean that.
Comment 1 Radar WebKit Bug Importer 2022-06-20 19:33:12 PDT
<rdar://problem/95563060>