WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
37949
Do no copy strings into a shared buffer when converting UStrings to Strings
https://bugs.webkit.org/show_bug.cgi?id=37949
Summary
Do no copy strings into a shared buffer when converting UStrings to Strings
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+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
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.
Top of Page
Format For Printing
XML
Clone This Bug