extractMIMETypeFromMediaType() creates a StringBuilder using UChars which could result in a 16 bit result from an 8 bit argument.
Created attachment 172400 [details] Patch
Comment on attachment 172400 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=172400&action=review What is the point of this change? Does it improve performance? Does it cause the function to create 8-bit strings instead of 16-bit strings? If so, how? > Source/WebCore/ChangeLog:3 > + extractMIMETypeFromMediaType() should process argument string characters using native bitness Why?
(In reply to comment #0) > extractMIMETypeFromMediaType() creates a StringBuilder using UChars which could result in a 16 bit result from an 8 bit argument. Why doesn’t StringBuilder just handle this correctly? I think this should be fixed in StringBuilder, not here.
(In reply to comment #2) > (From update of attachment 172400 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=172400&action=review > > What is the point of this change? Does it improve performance? Does it cause the function to create 8-bit strings instead of 16-bit strings? If so, how? Sorry, I should have provided more detail. This code creates 16 bit strings in all cases due to the way StringBuilder works. > > Source/WebCore/ChangeLog:3 > > + extractMIMETypeFromMediaType() should process argument string characters using native bitness > > Why? To avoid making 16 bit strings. (In reply to comment #3) > (In reply to comment #0) > > extractMIMETypeFromMediaType() creates a StringBuilder using UChars which could result in a 16 bit result from an 8 bit argument. > > Why doesn’t StringBuilder just handle this correctly? I think this should be fixed in StringBuilder, not here. When appending a UChar to a StringBuilder, the StringBuilder becomes "16 bit". I will look into changing StringBuilder instead of this code, including performance implications.
The bug is no longer valid with change r133726: <http://trac.webkit.org/changeset/133726> from https://bugs.webkit.org/show_bug.cgi?id=101421.
Comment on attachment 172400 [details] Patch Cleared review? from attachment 172400 [details] so that this bug does not appear in http://webkit.org/pending-review. If you would like this patch reviewed, please attach it to a new bug (or re-open this bug before marking it for review again).