Bug 20039

Summary: Implement UString::adopt
Product: WebKit Reporter: Adam Barth <abarth>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED WORKSFORME    
Severity: Normal CC: barraclough, mrowe
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
patch
sam: review-
non-perf tested version of what I was thinking none

Description Adam Barth 2008-07-15 02:30:02 PDT
It is handy to be able to transfer ownership of a Vector<UChar> into a UString without having to memcpy the contents of the vector.  This can be done with the public API of UString, but it would be more convenient to have a UString::adopt(Vector<UChar>&) method.
Comment 1 Adam Barth 2008-07-15 02:30:41 PDT
Created attachment 22278 [details]
patch
Comment 2 Sam Weinig 2008-07-15 13:26:49 PDT
Comment on attachment 22278 [details]
patch

I would rather we remove non-copying version of the UString constructor and only use adopt.
Comment 3 Sam Weinig 2008-07-15 13:44:30 PDT
Created attachment 22287 [details]
non-perf tested version of what I was thinking
Comment 4 Adam Barth 2008-07-15 16:58:54 PDT
> I would rather we remove non-copying version of the UString constructor and
> only use adopt.  

Yes, that's a good idea.  The non-copying constructor is just asking for memory errors.
Comment 5 Gavin Barraclough 2011-08-25 15:17:25 PDT
This now exists!