Reviewed by Adele.
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Nov 2007 06:25:36 +0000 (06:25 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Nov 2007 06:25:36 +0000 (06:25 +0000)
        Fix <rdar://problem/5601598>
        The movie tag should do initialization on need and not during startup.

        Initialize Movie MIME type hash on demand

        * platform/MIMETypeRegistry.cpp:
        (WebCore::initialiseSupportedMovieMIMETypes):
        (WebCore::initialiseMIMETypeRegistry):
        (WebCore::MIMETypeRegistry::isSupportedMovieMIMEType):
        (WebCore::MIMETypeRegistry::getSupportedMovieMIMETypes):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27841 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/MIMETypeRegistry.cpp

index a2caec7..8d0c9c6 100644 (file)
@@ -1,3 +1,18 @@
+2007-11-15  Antti Koivisto  <antti@apple.com>
+
+        Reviewed by Adele.
+
+        Fix <rdar://problem/5601598>
+        The movie tag should do initialization on need and not during startup.
+        
+        Initialize Movie MIME type hash on demand
+
+        * platform/MIMETypeRegistry.cpp:
+        (WebCore::initialiseSupportedMovieMIMETypes):
+        (WebCore::initialiseMIMETypeRegistry):
+        (WebCore::MIMETypeRegistry::isSupportedMovieMIMEType):
+        (WebCore::MIMETypeRegistry::getSupportedMovieMIMETypes):
+
 2007-11-15  Mark Rowe  <mrowe@apple.com>
 
         Build fix for Qt on Windows.
index f791c2b..5b70916 100644 (file)
@@ -149,6 +149,7 @@ static void initialiseSupportedNonImageMimeTypes()
     
 static void initialiseSupportedMovieMIMETypes()
 {
+    supportedMovieMIMETypes = new WTF::HashSet<String>();
 #if ENABLE(VIDEO)
     Movie::getSupportedTypes(*supportedMovieMIMETypes);
 #endif
@@ -159,11 +160,9 @@ static void initialiseMIMETypeRegistry()
     supportedImageResourceMIMETypes = new WTF::HashSet<String>();
     supportedImageMIMETypes = new WTF::HashSet<String>();
     supportedNonImageMIMETypes = new WTF::HashSet<String>();
-    supportedMovieMIMETypes = new WTF::HashSet<String>();
     
     initialiseSupportedNonImageMimeTypes();
     initialiseSupportedImageMIMETypes();
-    initialiseSupportedMovieMIMETypes();
 }
 
 String MIMETypeRegistry::getMIMETypeForPath(const String& path)
@@ -200,7 +199,7 @@ bool MIMETypeRegistry::isSupportedNonImageMIMEType(const String& mimeType)
 bool MIMETypeRegistry::isSupportedMovieMIMEType(const String& mimeType)
 {
     if (!supportedMovieMIMETypes)
-        initialiseMIMETypeRegistry();
+        initialiseSupportedMovieMIMETypes();
     return !mimeType.isEmpty() && supportedMovieMIMETypes->contains(mimeType);     
 }
     
@@ -240,7 +239,7 @@ HashSet<String> &MIMETypeRegistry::getSupportedNonImageMIMETypes()
 HashSet<String> &MIMETypeRegistry::getSupportedMovieMIMETypes()
 {
     if (!supportedMovieMIMETypes)
-        initialiseMIMETypeRegistry();
+        initialiseSupportedMovieMIMETypes();
     return *supportedMovieMIMETypes;
 }