Changeset 176725 in webkit


Ignore:
Timestamp:
Dec 3, 2014 10:01:32 AM (9 years ago)
Author:
jer.noble@apple.com
Message:

[Mac] Hang when calling -[AVAsset resolvedURL].
https://bugs.webkit.org/show_bug.cgi?id=139223

Reviewed by Eric Carlson.

On a particularly slow-loading site, a call to -[AVAsset resolvedURL] can take an arbitrarily long
time. Treat this AVAsset property similar to other "metadata" properties, and check the load status
of the property before requesting it.

  • platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:

(WebCore::MediaPlayerPrivateAVFoundationObjC::hasSingleSecurityOrigin): Check the load state of -resolvedURL.
(WebCore::MediaPlayerPrivateAVFoundationObjC::resolvedURL): Ditto.
(WebCore::assetMetadataKeyNames): Add @"resolvedURL".

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r176722 r176725  
     12014-12-03  Jer Noble  <jer.noble@apple.com>
     2
     3        [Mac] Hang when calling -[AVAsset resolvedURL].
     4        https://bugs.webkit.org/show_bug.cgi?id=139223
     5
     6        Reviewed by Eric Carlson.
     7
     8        On a particularly slow-loading site, a call to -[AVAsset resolvedURL] can take an arbitrarily long
     9        time. Treat this AVAsset property similar to other "metadata" properties, and check the load status
     10        of the property before requesting it.
     11
     12        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
     13        (WebCore::MediaPlayerPrivateAVFoundationObjC::hasSingleSecurityOrigin): Check the load state of -resolvedURL.
     14        (WebCore::MediaPlayerPrivateAVFoundationObjC::resolvedURL): Ditto.
     15        (WebCore::assetMetadataKeyNames): Add @"resolvedURL".
     16
    1172014-12-03  Csaba Osztrogonác  <ossy@webkit.org>
    218
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm

    r176685 r176725  
    20062006bool MediaPlayerPrivateAVFoundationObjC::hasSingleSecurityOrigin() const
    20072007{
    2008     if (!m_avAsset)
     2008    if (!m_avAsset || [m_avAsset statusOfValueForKey:@"resolvedURL" error:nullptr] != AVKeyValueStatusLoaded)
    20092009        return false;
    20102010   
    2011     RefPtr<SecurityOrigin> resolvedOrigin = SecurityOrigin::create(URL([m_avAsset resolvedURL]));
     2011    RefPtr<SecurityOrigin> resolvedOrigin = SecurityOrigin::create(resolvedURL());
    20122012    RefPtr<SecurityOrigin> requestedOrigin = SecurityOrigin::createFromString(assetURL());
    20132013    return resolvedOrigin->isSameSchemeHostPort(requestedOrigin.get());
     
    28522852URL MediaPlayerPrivateAVFoundationObjC::resolvedURL() const
    28532853{
    2854     if (!m_avAsset)
     2854    if (!m_avAsset || [m_avAsset statusOfValueForKey:@"resolvedURL" error:nullptr] != AVKeyValueStatusLoaded)
    28552855        return MediaPlayerPrivateAVFoundation::resolvedURL();
    28562856
     
    28682868                    @"preferredRate",
    28692869                    @"playable",
     2870                    @"resolvedURL",
    28702871                    @"tracks",
    28712872                    @"availableMediaCharacteristicsWithMediaSelectionOptions",
Note: See TracChangeset for help on using the changeset viewer.