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

Changeset 254590 in webkit


Ignore:
Timestamp:
Jan 15, 2020, 11:14:47 AM (7 years ago)
Author:
Alan Coon
Message:

Cherry-pick r254141. rdar://problem/58559202

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):

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

Location:
branches/safari-609-branch/Source/WebCore/PAL
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-609-branch/Source/WebCore/PAL/ChangeLog

    r254581 r254590  
     12020-01-14  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r254141. rdar://problem/58559202
     4
     5    Flaky API Test: TestWebKitAPI.WebKitLegacy.AudioSessionCategoryIOS
     6    https://bugs.webkit.org/show_bug.cgi?id=194340
     7    <rdar://problem/50507254>
     8   
     9    Reviewed by Eric Carlson.
     10   
     11    Workaround for AVFoundation crash for OS versions prior to platform fix. This crash occurrs infrequently
     12    while triggering KVO due to an internal @property change. Work around the crash by disabling KVO for that
     13    property at runtime, by injecting a new class method +automaticallyNotifiesObserversOfSuppressesVideoLayers
     14    immediately after soft linking the AVFoundation library.
     15   
     16    * pal/cocoa/AVFoundationSoftLink.mm:
     17    (PAL::justReturnsNO):
     18    (PAL::AVFoundationLibrary):
     19   
     20   
     21    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254141 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     22
     23    2020-01-07  Jer Noble  <jer.noble@apple.com>
     24
     25            Flaky API Test: TestWebKitAPI.WebKitLegacy.AudioSessionCategoryIOS
     26            https://bugs.webkit.org/show_bug.cgi?id=194340
     27            <rdar://problem/50507254>
     28
     29            Reviewed by Eric Carlson.
     30
     31            Workaround for AVFoundation crash for OS versions prior to platform fix. This crash occurrs infrequently
     32            while triggering KVO due to an internal @property change. Work around the crash by disabling KVO for that
     33            property at runtime, by injecting a new class method +automaticallyNotifiesObserversOfSuppressesVideoLayers
     34            immediately after soft linking the AVFoundation library.
     35
     36            * pal/cocoa/AVFoundationSoftLink.mm:
     37            (PAL::justReturnsNO):
     38            (PAL::AVFoundationLibrary):
     39
    1402020-01-14  Alan Coon  <alancoon@apple.com>
    241
  • branches/safari-609-branch/Source/WebCore/PAL/pal/cocoa/AVFoundationSoftLink.mm

    r254476 r254590  
    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.