Bug 29908

Summary: Make assertion clearer for case where UTF8 is not supported by platform TextCodec
Product: WebKit Reporter: Yong Li <yong.li.webkit>
Component: TextAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, staikos
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
the patch darin: review+, yong.li.webkit: commit-queue-

Yong Li
Reported 2009-09-29 17:33:16 PDT
UTF8Encoding() returns a static TextEncoding object. But if "UTF-8" is not registered by platform TextCodec, the encoding object will contain a null "m_name" and newTextCodec() will get a null "factory" function. There's already an ASSERT(factory.function) in newTextCodec(), but at that point, the encoding name is null. It's not so clear that the crash is due to missing UTF-8 support. ASSERT(factory.function) is supposed to detect the problem that the platform TextCodec forgets to register a factory for an encoding it has registered. So we think adding an ASSERT to UTF8Encoding() can be helpful.
Attachments
the patch (964 bytes, patch)
2009-09-29 17:39 PDT, Yong Li
darin: review+
yong.li.webkit: commit-queue-
Yong Li
Comment 1 2009-09-29 17:39:43 PDT
Created attachment 40337 [details] the patch the patch
Darin Adler
Comment 2 2009-09-29 17:40:55 PDT
Comment on attachment 40337 [details] the patch Seems fine.
Yong Li
Comment 3 2009-09-29 18:08:34 PDT
Landed @48913
Note You need to log in before you can comment on or make changes to this bug.