[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

eric.carlson at apple.com eric.carlson at apple.com
Wed Dec 22 15:55:29 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 00369c5f4325306c0d7f9f6156212f4116a227de
Author: eric.carlson at apple.com <eric.carlson at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Nov 16 18:44:46 2010 +0000

    2010-11-16  Eric Carlson  <eric.carlson at apple.com>
    
            Reviewed by John Sullivan.
    
            getMIMEType(s)ForExtension should consult system mapping
            https://bugs.webkit.org/show_bug.cgi?id=49497
    
            No new tests possible.
    
            * platform/MIMETypeRegistry.cpp:
            (WebCore::MIMETypeRegistry::getMediaMIMETypeForExtension): Add the type returned by getMIMETypeForExtension.
            Put the result of mediaMIMETypeMap().get() in a local variable and test instead of calling
            constains() and then get().
            (WebCore::MIMETypeRegistry::getMediaMIMETypesForExtension): Ditto.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72119 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index ce9ed7e..7a53f26 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,5 +1,20 @@
 2010-11-16  Eric Carlson  <eric.carlson at apple.com>
 
+        Reviewed by John Sullivan.
+
+        getMIMEType(s)ForExtension should consult system mapping
+        https://bugs.webkit.org/show_bug.cgi?id=49497
+
+        No new tests possible.
+
+        * platform/MIMETypeRegistry.cpp:
+        (WebCore::MIMETypeRegistry::getMediaMIMETypeForExtension): Add the type returned by getMIMETypeForExtension. 
+        Put the result of mediaMIMETypeMap().get() in a local variable and test instead of calling
+        constains() and then get().
+        (WebCore::MIMETypeRegistry::getMediaMIMETypesForExtension): Ditto.
+
+2010-11-16  Eric Carlson  <eric.carlson at apple.com>
+
         Reviewed by Darin Adler.
 
         Rename QTKit based media engine class name
diff --git a/WebCore/platform/MIMETypeRegistry.cpp b/WebCore/platform/MIMETypeRegistry.cpp
index 337463d..c152a36 100644
--- a/WebCore/platform/MIMETypeRegistry.cpp
+++ b/WebCore/platform/MIMETypeRegistry.cpp
@@ -345,17 +345,34 @@ static MediaMIMETypeMap& mediaMIMETypeMap()
 
 String MIMETypeRegistry::getMediaMIMETypeForExtension(const String& ext)
 {
-    if (mediaMIMETypeMap().contains(ext))
-        return (*mediaMIMETypeMap().get(ext))[0];
+    // Look in the system-specific registry first.
+    String type = getMIMETypeForExtension(ext);
+    if (!type.isEmpty())
+        return type;
+
+    Vector<String>* typeList = mediaMIMETypeMap().get(ext);
+    if (typeList)
+        return (*typeList)[0];
     
     return String();
 }
     
 Vector<String> MIMETypeRegistry::getMediaMIMETypesForExtension(const String& ext)
 {
-    if (mediaMIMETypeMap().contains(ext))
-        return *mediaMIMETypeMap().get(ext);
-
+    Vector<String>* typeList = mediaMIMETypeMap().get(ext);
+    if (typeList)
+        return *typeList;
+
+    // Only need to look in the system-specific registry if mediaMIMETypeMap() doesn't contain
+    // the extension at all, because it always contains the system-specific type if the
+    // extension is in the static mapping table.
+    String type = getMIMETypeForExtension(ext);
+    if (!type.isEmpty()) {
+        Vector<String> typeList;
+        typeList.append(type);
+        return typeList;
+    }
+    
     return Vector<String>();
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list