Bug 98300

Summary: OpaqueJSString doesn't optimally handle 8 bit strings
Product: WebKit Reporter: Michael Saboff <msaboff>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on: 98417, 98433, 98693, 98801, 98805    
Bug Blocks:    
Attachments:
Description Flags
Patch ggaren: review+

Michael Saboff
Reported 2012-10-03 14:16:09 PDT
OpaqueJSString's can be created with a String or with a UChar*, length pair. The String version of create() will up convert an 8 bit string.
Attachments
Patch (3.81 KB, patch)
2012-10-03 14:45 PDT, Michael Saboff
ggaren: review+
Michael Saboff
Comment 1 2012-10-03 14:45:53 PDT
Geoffrey Garen
Comment 2 2012-10-03 14:47:08 PDT
Comment on attachment 166963 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=166963&action=review r=me > Source/JavaScriptCore/API/OpaqueJSString.h:67 > + // Make a copy fo the source string Typo: should be "of". Please put a period at the end of the comment sentence.
Michael Saboff
Comment 3 2012-10-03 16:40:09 PDT
Chris Dumez
Comment 4 2012-10-04 00:04:04 PDT
Hi, This patch seems to have caused a behavior change for the following code: JSRetainPtr<JSStringRef> response; response.adopt(JSStringCreateWithUTF8CString(0)); String responseString = response->string(); responseString.isNull() // Used to return true, now returns false
Chris Dumez
Comment 5 2012-10-04 00:15:52 PDT
Comment on attachment 166963 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=166963&action=review > Source/JavaScriptCore/API/OpaqueJSString.h:62 > + m_string = emptyString(); Why this? Shouldn't m_string stay null here instead of assigning an empty string to it?
Michael Saboff
Comment 6 2012-10-04 09:17:02 PDT
(In reply to comment #5) > (From update of attachment 166963 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=166963&action=review > > > Source/JavaScriptCore/API/OpaqueJSString.h:62 > > + m_string = emptyString(); > > Why this? Shouldn't m_string stay null here instead of assigning an empty string to it? That change is likely the cause of your problem. I filed https://bugs.webkit.org/show_bug.cgi?id=98417 "After r130344, OpaqueJSString() creates a empty string which should be a null string". Will fix this today.
Note You need to log in before you can comment on or make changes to this bug.