Title: [274034] trunk/Source
Revision
274034
Author
[email protected]
Date
2021-03-06 04:53:32 -0800 (Sat, 06 Mar 2021)

Log Message

dlopen_preflight is failing (temporarily) but obsolete
https://bugs.webkit.org/show_bug.cgi?id=222829

Reviewed by Jer Noble.

I hit a bug where dlopen_preflight was failing in a particular build.
That is now fixed, but as I was discussing it with the dyld team
they said we should stop using it. The rationale was that it only
made sense during the PowerPC to Intel transition, and it is as
expensive as dlopen now.

Source/WebCore:

* platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm:
(WebCore::AVAssetMIMETypeCache::isAvailable const): Remove the preflight opening
of the AVFoundation framework.
* platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.mm:
(WebCore::AVStreamDataParserMIMETypeCache::isAvailable const):

Source/WTF:

* wtf/PlatformUse.h: No need for preflight linking code.
* wtf/cocoa/SoftLinking.h:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (274033 => 274034)


--- trunk/Source/WTF/ChangeLog	2021-03-06 11:13:42 UTC (rev 274033)
+++ trunk/Source/WTF/ChangeLog	2021-03-06 12:53:32 UTC (rev 274034)
@@ -1,3 +1,19 @@
+2021-03-06  Dean Jackson  <[email protected]>
+
+        dlopen_preflight is failing (temporarily) but obsolete
+        https://bugs.webkit.org/show_bug.cgi?id=222829
+
+        Reviewed by Jer Noble.
+
+        I hit a bug where dlopen_preflight was failing in a particular build.
+        That is now fixed, but as I was discussing it with the dyld team
+        they said we should stop using it. The rationale was that it only
+        made sense during the PowerPC to Intel transition, and it is as
+        expensive as dlopen now.
+
+        * wtf/PlatformUse.h: No need for preflight linking code.
+        * wtf/cocoa/SoftLinking.h:
+
 2021-03-05  Don Olmstead  <[email protected]>
 
         [CMake] Bump cmake_minimum_required version to 3.12 or later

Modified: trunk/Source/WTF/wtf/PlatformUse.h (274033 => 274034)


--- trunk/Source/WTF/wtf/PlatformUse.h	2021-03-06 11:13:42 UTC (rev 274033)
+++ trunk/Source/WTF/wtf/PlatformUse.h	2021-03-06 12:53:32 UTC (rev 274034)
@@ -281,10 +281,6 @@
 #define USE_NEW_THEME 1
 #endif
 
-#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED < 101500
-#define USE_REALPATH_FOR_DLOPEN_PREFLIGHT 1
-#endif
-
 #if PLATFORM(IOS) || PLATFORM(MACCATALYST)
 #define USE_UICONTEXTMENU 1
 #endif

Modified: trunk/Source/WTF/wtf/cocoa/SoftLinking.h (274033 => 274034)


--- trunk/Source/WTF/wtf/cocoa/SoftLinking.h	2021-03-06 11:13:42 UTC (rev 274033)
+++ trunk/Source/WTF/wtf/cocoa/SoftLinking.h	2021-03-06 12:53:32 UTC (rev 274034)
@@ -85,19 +85,6 @@
         return frameworkLibrary; \
     }
 
-#if USE(REALPATH_FOR_DLOPEN_PREFLIGHT)
-#define DLOPEN_PREFLIGHT(path) dlopen_preflight(FileSystem::realPath(path##_s).utf8().data())
-#else
-#define DLOPEN_PREFLIGHT(path) dlopen_preflight(path)
-#endif
-
-#define SOFT_LINK_FRAMEWORK_OPTIONAL_PREFLIGHT(framework) \
-    static bool framework##LibraryIsAvailable() \
-    { \
-        static bool frameworkLibraryIsAvailable = DLOPEN_PREFLIGHT("/System/Library/Frameworks/" #framework ".framework/" #framework); \
-        return frameworkLibraryIsAvailable; \
-    }
-
 #define SOFT_LINK_FRAMEWORK_OPTIONAL(framework) \
     static void* framework##Library() \
     { \

Modified: trunk/Source/WebCore/ChangeLog (274033 => 274034)


--- trunk/Source/WebCore/ChangeLog	2021-03-06 11:13:42 UTC (rev 274033)
+++ trunk/Source/WebCore/ChangeLog	2021-03-06 12:53:32 UTC (rev 274034)
@@ -1,3 +1,22 @@
+2021-03-06  Dean Jackson  <[email protected]>
+
+        dlopen_preflight is failing (temporarily) but obsolete
+        https://bugs.webkit.org/show_bug.cgi?id=222829
+
+        Reviewed by Jer Noble.
+
+        I hit a bug where dlopen_preflight was failing in a particular build.
+        That is now fixed, but as I was discussing it with the dyld team
+        they said we should stop using it. The rationale was that it only
+        made sense during the PowerPC to Intel transition, and it is as
+        expensive as dlopen now.
+
+        * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm:
+        (WebCore::AVAssetMIMETypeCache::isAvailable const): Remove the preflight opening
+        of the AVFoundation framework.
+        * platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.mm:
+        (WebCore::AVStreamDataParserMIMETypeCache::isAvailable const):
+
 2021-03-06  Tim Horton  <[email protected]>
 
         <model> should create a model-owning compositing layer

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm (274033 => 274034)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm	2021-03-06 11:13:42 UTC (rev 274033)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm	2021-03-06 12:53:32 UTC (rev 274034)
@@ -33,10 +33,6 @@
 #import <pal/cf/CoreMediaSoftLink.h>
 #import <pal/cocoa/AVFoundationSoftLink.h>
 
-#if !PLATFORM(MACCATALYST)
-SOFT_LINK_FRAMEWORK_OPTIONAL_PREFLIGHT(AVFoundation)
-#endif
-
 namespace WebCore {
 
 AVAssetMIMETypeCache& AVAssetMIMETypeCache::singleton()
@@ -48,14 +44,8 @@
 bool AVAssetMIMETypeCache::isAvailable() const
 {
 #if ENABLE(VIDEO) && USE(AVFOUNDATION)
-#if PLATFORM(MACCATALYST)
-    // FIXME: This should be using AVFoundationLibraryIsAvailable() instead, but doing so causes soft-linking
-    // to subsequently fail on certain symbols. See <rdar://problem/42224780> for more details.
     return PAL::isAVFoundationFrameworkAvailable();
 #else
-    return AVFoundationLibraryIsAvailable();
-#endif
-#else
     return false;
 #endif
 }

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.mm (274033 => 274034)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.mm	2021-03-06 11:13:42 UTC (rev 274033)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.mm	2021-03-06 12:53:32 UTC (rev 274034)
@@ -36,10 +36,6 @@
 #import <pal/cf/CoreMediaSoftLink.h>
 #import <pal/cocoa/AVFoundationSoftLink.h>
 
-#if !PLATFORM(MACCATALYST)
-SOFT_LINK_FRAMEWORK_OPTIONAL_PREFLIGHT(AVFoundation)
-#endif
-
 NS_ASSUME_NONNULL_BEGIN
 @interface AVStreamDataParser (AVStreamDataParserExtendedMIMETypes)
 + (BOOL)canParseExtendedMIMEType:(NSString *)extendedMIMEType;
@@ -57,15 +53,8 @@
 bool AVStreamDataParserMIMETypeCache::isAvailable() const
 {
 #if ENABLE(VIDEO) && USE(AVFOUNDATION)
-#if PLATFORM(MACCATALYST)
-    // FIXME: This should be using AVFoundationLibraryIsAvailable() instead, but doing so causes soft-linking
-    // to subsequently fail on certain symbols. See <rdar://problem/42224780> for more details.
     if (!PAL::AVFoundationLibrary())
         return false;
-#else
-    if (!AVFoundationLibraryIsAvailable())
-        return false;
-#endif
 
     return [PAL::getAVStreamDataParserClass() respondsToSelector:@selector(audiovisualMIMETypes)];
 #else
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to