⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 254141 in webkit


Ignore:
Timestamp:
Jan 7, 2020, 11:27:11 AM (7 years ago)
Author:
jer.noble@apple.com
Message:

Flaky API Test: TestWebKitAPI.WebKitLegacy.AudioSessionCategoryIOS
​https://bugs.webkit.org/show_bug.cgi?id=194340
<rdar://problem/50507254>

Reviewed by Eric Carlson.

Workaround for AVFoundation crash for OS versions prior to platform fix. This crash occurrs infrequently
while triggering KVO due to an internal @property change. Work around the crash by disabling KVO for that
property at runtime, by injecting a new class method +automaticallyNotifiesObserversOfSuppressesVideoLayers
immediately after soft linking the AVFoundation library.

  • pal/cocoa/AVFoundationSoftLink.mm:

(PAL::justReturnsNO):
(PAL::AVFoundationLibrary):

Location:
trunk/Source/WebCore/PAL
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/PAL/ChangeLog

    r254115 r254141  
     12020-01-07  Jer Noble  <jer.noble@apple.com>
     2
     3        Flaky API Test: TestWebKitAPI.WebKitLegacy.AudioSessionCategoryIOS
     4        https://bugs.webkit.org/show_bug.cgi?id=194340
     5        <rdar://problem/50507254>
     6
     7        Reviewed by Eric Carlson.
     8
     9        Workaround for AVFoundation crash for OS versions prior to platform fix. This crash occurrs infrequently
     10        while triggering KVO due to an internal @property change. Work around the crash by disabling KVO for that
     11        property at runtime, by injecting a new class method +automaticallyNotifiesObserversOfSuppressesVideoLayers
     12        immediately after soft linking the AVFoundation library.
     13
     14        * pal/cocoa/AVFoundationSoftLink.mm:
     15        (PAL::justReturnsNO):
     16        (PAL::AVFoundationLibrary):
     17
    1182020-01-07  Chris Fleizach  <cfleizach@apple.com>
    219
  • trunk/Source/WebCore/PAL/pal/cocoa/AVFoundationSoftLink.mm

    r253064 r254141  
    3131#import <wtf/SoftLinking.h>
    3232
     33#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000)
    3334SOFT_LINK_FRAMEWORK_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, PAL_EXPORT)
     35#else
     36@interface AVPlayerItem (DisableKVOOnSupressesVideoLayers)
     37+ (BOOL)automaticallyNotifiesObserversOfSuppressesVideoLayers;
     38@end
     39
     40namespace PAL {
     41
     42static BOOL justReturnsNO()
     43{
     44    return NO;
     45}
     46
     47PAL_EXPORT void* AVFoundationLibrary(bool isOptional = false);
     48void* AVFoundationLibrary(bool isOptional)
     49{
     50    static void* frameworkLibrary;
     51    static dispatch_once_t once;
     52    dispatch_once(&once, ^{
     53        frameworkLibrary = dlopen("/System/Library/Frameworks/AVFoundation.framework/AVFoundation", RTLD_NOW);
     54        if (!isOptional)
     55            RELEASE_ASSERT_WITH_MESSAGE(frameworkLibrary, "%s", dlerror());
     56
     57        class_addMethod(objc_getClass("AVPlayerItem"), @selector(automaticallyNotifiesObserversOfSuppressesVideoLayers), (IMP)justReturnsNO, "B@:");
     58    });
     59    return frameworkLibrary;
     60}
     61
     62}
     63#endif
    3464
    3565SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, AVFoundation, AVAssetCache, PAL_EXPORT)
Note: See TracChangeset for help on using the changeset viewer.