Title: [152867] trunk/Source/WebCore
Revision
152867
Author
[email protected]
Date
2013-07-18 15:00:43 -0700 (Thu, 18 Jul 2013)

Log Message

New PDFPlugin doesn't support WebKitOmitPDFSupport, acts as if Plug-ins are off
https://bugs.webkit.org/show_bug.cgi?id=118858

Reviewed by Eric Carlson.

Expand the scope of rejecting non video/ or audio/ MIME types when
filling the MIME type cache.

* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
(WebCore::shouldRejectMIMEType): Added utility function.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (152866 => 152867)


--- trunk/Source/WebCore/ChangeLog	2013-07-18 21:58:17 UTC (rev 152866)
+++ trunk/Source/WebCore/ChangeLog	2013-07-18 22:00:43 UTC (rev 152867)
@@ -1,3 +1,16 @@
+2013-07-18  Jer Noble  <[email protected]>
+
+        New PDFPlugin doesn't support WebKitOmitPDFSupport, acts as if Plug-ins are off
+        https://bugs.webkit.org/show_bug.cgi?id=118858
+
+        Reviewed by Eric Carlson.
+
+        Expand the scope of rejecting non video/ or audio/ MIME types when
+        filling the MIME type cache.
+
+        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
+        (WebCore::shouldRejectMIMEType): Added utility function.
+
 2013-07-17  Brent Fulgham  <[email protected]>
 
         [Windows] Support in-band text tracks.

Modified: trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm (152866 => 152867)


--- trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm	2013-07-18 21:58:17 UTC (rev 152866)
+++ trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm	2013-07-18 22:00:43 UTC (rev 152867)
@@ -1410,6 +1410,13 @@
     [m_objcObserver.get() setDelayCallbacks:NO];
 }
 
+static bool shouldRejectMIMEType(const String& type)
+{
+    // QTKit will return non-video MIME types which it claims to support, but which we
+    // do not support in the <video> element. Disclaim all non video/ or audio/ types.
+    return !type.startsWith("video/") && !type.startsWith("audio/");
+}
+
 static void addFileTypesToCache(NSArray * fileTypes, HashSet<String> &cache)
 {
     int count = [fileTypes count];
@@ -1419,6 +1426,8 @@
         if (!uti)
             continue;
         RetainPtr<CFStringRef> mime = adoptCF(UTTypeCopyPreferredTagWithClass(uti.get(), kUTTagClassMIMEType));
+        if (shouldRejectMIMEType(mime.get()))
+            continue;
         if (mime)
             cache.add(mime.get());
 
@@ -1433,9 +1442,7 @@
             for (unsigned ndx = 0; ndx < count; ++ndx) {
                 String& type = typesForExtension[ndx];
 
-                // QTKit will return non-video MIME types which it claims to support, but which we
-                // do not support in the <video> element. Disclaim all non video/ or audio/ types.
-                if (!type.startsWith("video/") && !type.startsWith("audio/"))
+                if (shouldRejectMIMEType(type))
                     continue;
 
                 if (!cache.contains(type))
@@ -1497,7 +1504,7 @@
 
     // Due to <rdar://problem/10777059>, avoid calling the mime types cache functions if at
     // all possible:
-    if (!type.startsWith("video/") && !type.startsWith("audio/"))
+    if (shouldRejectMIMEType(type))
         return MediaPlayer::IsNotSupported;
 
     // We check the "modern" type cache first, as it doesn't require QTKitServer to start.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to