Bug 40897

Summary: Get rid of the extensionToMIME mapping in WebBasePluginPackage
Product: WebKit Reporter: Anders Carlsson <andersca>
Component: New BugsAssignee: Anders Carlsson <andersca>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, eric, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: OS X 10.5   
Attachments:
Description Flags
Patch mitz: review+

Description Anders Carlsson 2010-06-20 19:21:36 PDT
Get rid of the extensionToMIME mapping in WebBasePluginPackage
Comment 1 Anders Carlsson 2010-06-20 19:23:38 PDT
Created attachment 59223 [details]
Patch
Comment 2 mitz 2010-06-20 19:30:39 PDT
Comment on attachment 59223 [details]
Patch

> +    for (size_t i = 0; i < mimeTypes.size(); ++i) {
> +        const MimeClassInfo& mimeClassInfo = mimeTypes[i];
> +        
> +        for (size_t i = 0; i < mimeClassInfo.extensions.size(); ++i) {

Please don’t reuse the outer loop’s index variable.

> +- (NSString *)MIMETypeForExtension:(const String&)extension
>  {
> -    return [extensionToMIME objectForKey:extension];
> +    ASSERT(extension.lower() == extension);
> +    
> +    for (size_t i = 0; i < mimeTypes.size(); ++i) {
> +        const MimeClassInfo& mimeClassInfo = mimeTypes[i];
> +        
> +        for (size_t i = 0; i < mimeClassInfo.extensions.size(); ++i) {

Diito.

…
> +    return NO;

I doubt that clang++ would allow returning NO from an (NSString *) method. Please return nil.
Comment 3 Anders Carlsson 2010-06-20 19:35:06 PDT
Committed r61523: <http://trac.webkit.org/changeset/61523>
Comment 4 WebKit Review Bot 2010-06-20 20:12:03 PDT
http://trac.webkit.org/changeset/61523 might have broken SnowLeopard Intel Release (Tests)
Comment 5 Adam Barth 2010-06-20 20:25:13 PDT
Looks like a real failure...

Tests that caused the DumpRenderTree tool to crash:

compositing/geometry/object-clip-rects-assertion.html	stderr
dom/html/level2/html/AppletsCollection.html	stderr
fast/dom/object-embed-plugin-scripting.html	stderr
plugins/embed-attributes-setting.html	expected