Title: [270890] trunk/Source/WebCore
Revision
270890
Author
[email protected]
Date
2020-12-16 08:12:13 -0800 (Wed, 16 Dec 2020)

Log Message

[Mac] Disable the WebM format reader in configurations where the plug-in will fail to load
https://bugs.webkit.org/show_bug.cgi?id=219938

Reviewed by Eric Carlson.

The user default for loading an ad-hoc code-signed WebM format reader plug-in is not
respected in customer installs of macOS, leaving no known way to load the plug-in in an
engineering build running on a customer OS variant. Fixing this is tracked by
rdar://72320419, but for now we must disable the plug-in for this configuration.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::isFormatReaderAvailable):
(WebCore::MediaPlayerPrivateAVFoundationObjC::supportsTypeAndCodecs):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (270889 => 270890)


--- trunk/Source/WebCore/ChangeLog	2020-12-16 16:03:29 UTC (rev 270889)
+++ trunk/Source/WebCore/ChangeLog	2020-12-16 16:12:13 UTC (rev 270890)
@@ -1,3 +1,19 @@
+2020-12-16  Andy Estes  <[email protected]>
+
+        [Mac] Disable the WebM format reader in configurations where the plug-in will fail to load
+        https://bugs.webkit.org/show_bug.cgi?id=219938
+
+        Reviewed by Eric Carlson.
+
+        The user default for loading an ad-hoc code-signed WebM format reader plug-in is not
+        respected in customer installs of macOS, leaving no known way to load the plug-in in an
+        engineering build running on a customer OS variant. Fixing this is tracked by
+        rdar://72320419, but for now we must disable the plug-in for this configuration.
+
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::isFormatReaderAvailable):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsTypeAndCodecs):
+
 2020-12-16  Antti Koivisto  <[email protected]>
 
         Remove simpleUserAgentStyleSheet (to fix flaky fast/lists/001.html and fast/lists/001-vertical.html)

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (270889 => 270890)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2020-12-16 16:03:29 UTC (rev 270889)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2020-12-16 16:12:13 UTC (rev 270890)
@@ -100,6 +100,7 @@
 #import <wtf/OSObjectPtr.h>
 #import <wtf/URL.h>
 #import <wtf/cocoa/VectorCocoa.h>
+#import <wtf/spi/darwin/OSVariantSPI.h>
 #import <wtf/text/CString.h>
 #import <wtf/threads/BinarySemaphore.h>
 
@@ -1680,6 +1681,25 @@
 }
 #endif
 
+#if ENABLE(MEDIA_SOURCE) && HAVE(MT_PLUGIN_FORMAT_READER)
+static bool isFormatReaderAvailable()
+{
+    if (!RuntimeEnabledFeatures::sharedFeatures().webMFormatReaderEnabled())
+        return false;
+
+#if !USE(APPLE_INTERNAL_SDK)
+    // FIXME (rdar://72320419): If WebKit was built with ad-hoc code-signing,
+    // CoreMedia will only load the format reader plug-in when a user default
+    // is set on Apple internal OSs. That means we cannot currently support WebM
+    // in public SDK builds on customer OSs.
+    if (!os_variant_allows_internal_security_policies("com.apple.WebKit"))
+        return false;
+#endif
+
+    return true;
+}
+#endif
+
 MediaPlayer::SupportsType MediaPlayerPrivateAVFoundationObjC::supportsTypeAndCodecs(const MediaEngineSupportParameters& parameters)
 {
 #if ENABLE(MEDIA_SOURCE)
@@ -1692,7 +1712,7 @@
 #endif
 
 #if ENABLE(MEDIA_SOURCE) && HAVE(MT_PLUGIN_FORMAT_READER)
-    if (RuntimeEnabledFeatures::sharedFeatures().webMFormatReaderEnabled()) {
+    if (isFormatReaderAvailable()) {
         auto supported = SourceBufferParserWebM::isContentTypeSupported(parameters.type);
         if (supported != MediaPlayer::SupportsType::IsNotSupported) {
             ensureFormatReaderIsRegistered();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to