Bug 37949

Summary: Do no copy strings into a shared buffer when converting UStrings to Strings
Product: WebKit Reporter: Gavin Barraclough <barraclough>
Component: WebCore JavaScriptAssignee: Gavin Barraclough <barraclough>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
The patch darin: review+

Gavin Barraclough
Reported 2010-04-21 14:03:11 PDT
UString and String now have the same internal representation; Just re-wrap the internal impl.
Attachments
The patch (4.89 KB, patch)
2010-04-21 14:05 PDT, Gavin Barraclough
darin: review+
Gavin Barraclough
Comment 1 2010-04-21 14:05:31 PDT
Created attachment 53989 [details] The patch
Darin Adler
Comment 2 2010-04-21 14:12:49 PDT
Comment on attachment 53989 [details] The patch > String identifierToString(const JSC::Identifier&); > String ustringToString(const JSC::UString&); > JSC::UString stringToUString(const String&); > - > AtomicString identifierToAtomicString(const JSC::Identifier&); > AtomicString ustringToAtomicString(const JSC::UString&); > AtomicStringImpl* findAtomicString(const JSC::Identifier&); I think that blank line is good and you need not remove it. > + inline String ustringToString(const JSC::UString& u) > + { > + return u.rep(); > + } > + > + inline JSC::UString stringToUString(const String& s) > + { > + return JSC::UString(s.impl()); > + } > + > + inline String identifierToString(const JSC::Identifier& i) > + { > + return i.ustring().rep(); > + } > + > + inline AtomicString ustringToAtomicString(const JSC::UString& u) > + { > + return AtomicString(u.rep()); > + } > + > + inline AtomicString identifierToAtomicString(const JSC::Identifier& identifier) > + { > + return AtomicString(identifier.ustring().rep()); > + } > + > String valueToStringWithNullCheck(JSC::ExecState*, JSC::JSValue); // null if the value is null > String valueToStringWithUndefinedOrNullCheck(JSC::ExecState*, JSC::JSValue); // null if the value is null or undefined I suggest putting the function bodies at the end of the file. No need for these definitions to be close the the declarations. r=me with or without those changes
Gavin Barraclough
Comment 3 2010-04-21 16:59:21 PDT
Transmitting file data ... Committed revision 58027.
Note You need to log in before you can comment on or make changes to this bug.