Changeset 277442 in webkit
- Timestamp:
- May 13, 2021, 11:23:49 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/platform/mac-wk2/TestExpectations (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r277441 r277442 1 2021-05-13 Jer Noble <jer.noble@apple.com> 2 3 [ macOS Wk2 ] media/media-fragments/TC0051.html is flakey crashing 4 https://bugs.webkit.org/show_bug.cgi?id=222277 5 <rdar://problem/74600790> 6 7 Reviewed by Eric Carlson. 8 9 * platform/mac-wk2/TestExpectations: 10 1 11 2021-05-13 Robert Jenner <jenner@apple.com> 2 12 -
trunk/LayoutTests/platform/mac-wk2/TestExpectations
r277441 r277442 1344 1344 webkit.org/b/224032 [ arm64 ] tiled-drawing/top-content-inset-fixed-attachment-cover-local.html [ Pass ImageOnlyFailure ] 1345 1345 1346 webkit.org/b/222277 media/media-fragments [ Skip ]1347 1348 1346 webkit.org/b/224135 media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag-is-prevented-over-button.html [ Pass Timeout ] 1349 1347 -
trunk/Source/WebCore/ChangeLog
r277438 r277442 1 2021-05-13 Jer Noble <jer.noble@apple.com> 2 3 [ macOS Wk2 ] media/media-fragments/TC0051.html is flakey crashing 4 https://bugs.webkit.org/show_bug.cgi?id=222277 5 <rdar://problem/74600790> 6 7 Reviewed by Eric Carlson. 8 9 In r274734, a workaround was added to detect a bug in the Photos.framework that would cause 10 an exception to be thrown if the URL provided to AVURLAsset had a malformed fragment identifier. 11 However, in an effort to reduce the runtime cost of this check, it was only done once, the first 12 time an AVURLAsset is created. This failed to account for the Photos.framework being dynamically 13 loaded and changing the behavior of AVURLAsset after the check had been performed. 14 15 Instead, fall back to a much simpler check: wrap the creation of the AVURLAsset in a @try/@catch 16 block, and if an exception was thrown, re-attempt to create the AVURLAsset with a manually 17 conformed URL. 18 19 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: 20 (WebCore::conformFragmentIdentifierForURL): 21 (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): 22 (WebCore::hasBrokenFragmentSupport): Deleted. 23 1 24 2021-05-13 Alicia Boya García <aboya@igalia.com> 2 25 -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
r277140 r277442 814 814 } 815 815 816 static bool hasBrokenFragmentSupport()816 static URL conformFragmentIdentifierForURL(const URL& url) 817 817 { 818 818 #if PLATFORM(MAC) … … 823 823 // criteria. Problematic strings from the TC0051.html test include "t=3&", and this problem generally is 824 824 // with subtrings between the '&' character not including an equal sign. 825 static bool hasBrokenFragmentSupport = false;826 static dispatch_once_t onceToken;827 dispatch_once(&onceToken, ^{828 @try {829 auto selector = NSSelectorFromString(@"isURLForAssetInCollection:");830 auto theClass = PAL::getAVAssetCollectionClass();831 if (![theClass respondsToSelector:selector])832 return;833 [theClass performSelector:selector withObject:[NSURL URLWithString:@"file:///invalid-file.mp4#t=3&"]];834 } @catch (NSException *exception) {835 hasBrokenFragmentSupport = true;836 }837 });838 return hasBrokenFragmentSupport;839 #else840 return false;841 #endif842 }843 844 static URL conformFragmentIdentifierForURL(const URL& url)845 {846 #if PLATFORM(MAC)847 ASSERT(hasBrokenFragmentSupport());848 849 825 auto hasInvalidNumberOfEqualCharacters = [](const StringView& fragmentParameter) { 850 826 auto results = fragmentParameter.splitAllowingEmptyEntries('='); … … 976 952 registerFormatReaderIfNecessary(); 977 953 978 NSURL *cocoaURL = nil; 979 if (hasBrokenFragmentSupport() && url.hasFragmentIdentifier()) 954 NSURL *cocoaURL = canonicalURL(url); 955 956 @try { 957 m_avAsset = adoptNS([PAL::allocAVURLAssetInstance() initWithURL:cocoaURL options:options.get()]); 958 } @catch(NSException *exception) { 959 ERROR_LOG(LOGIDENTIFIER, "-[AVURLAssetInstance initWithURL:cocoaURL options:] threw an exception: ", [[exception name] UTF8String], ", reason : ", [[exception reason] UTF8String]); 980 960 cocoaURL = canonicalURL(conformFragmentIdentifierForURL(url)); 981 else 982 cocoaURL = canonicalURL(url); 983 984 m_avAsset = adoptNS([PAL::allocAVURLAssetInstance() initWithURL:cocoaURL options:options.get()]); 961 962 @try { 963 m_avAsset = adoptNS([PAL::allocAVURLAssetInstance() initWithURL:cocoaURL options:options.get()]); 964 } @catch(NSException *exception) { 965 ASSERT_NOT_REACHED(); 966 ERROR_LOG(LOGIDENTIFIER, "-[AVURLAssetInstance initWithURL:cocoaURL options:] threw a second exception, bailing: ", [[exception name] UTF8String], ", reason : ", [[exception reason] UTF8String]); 967 setNetworkState(MediaPlayer::NetworkState::FormatError); 968 return; 969 } 970 } 985 971 986 972 AVAssetResourceLoader *resourceLoader = m_avAsset.get().resourceLoader;
Note:
See TracChangeset
for help on using the changeset viewer.