Title: [176725] trunk/Source/WebCore
Revision
176725
Author
[email protected]
Date
2014-12-03 10:01:32 -0800 (Wed, 03 Dec 2014)

Log 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".

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (176724 => 176725)


--- trunk/Source/WebCore/ChangeLog	2014-12-03 17:55:11 UTC (rev 176724)
+++ trunk/Source/WebCore/ChangeLog	2014-12-03 18:01:32 UTC (rev 176725)
@@ -1,3 +1,19 @@
+2014-12-03  Jer Noble  <[email protected]>
+
+        [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".
+
 2014-12-03  Csaba Osztrogonác  <[email protected]>
 
         URTBF after r176721 to fix ENABLE(CSS_DEVICE_ADAPTATION) build.

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (176724 => 176725)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2014-12-03 17:55:11 UTC (rev 176724)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2014-12-03 18:01:32 UTC (rev 176725)
@@ -2005,10 +2005,10 @@
     
 bool MediaPlayerPrivateAVFoundationObjC::hasSingleSecurityOrigin() const 
 {
-    if (!m_avAsset)
+    if (!m_avAsset || [m_avAsset statusOfValueForKey:@"resolvedURL" error:nullptr] != AVKeyValueStatusLoaded)
         return false;
     
-    RefPtr<SecurityOrigin> resolvedOrigin = SecurityOrigin::create(URL([m_avAsset resolvedURL]));
+    RefPtr<SecurityOrigin> resolvedOrigin = SecurityOrigin::create(resolvedURL());
     RefPtr<SecurityOrigin> requestedOrigin = SecurityOrigin::createFromString(assetURL());
     return resolvedOrigin->isSameSchemeHostPort(requestedOrigin.get());
 }
@@ -2851,7 +2851,7 @@
 
 URL MediaPlayerPrivateAVFoundationObjC::resolvedURL() const
 {
-    if (!m_avAsset)
+    if (!m_avAsset || [m_avAsset statusOfValueForKey:@"resolvedURL" error:nullptr] != AVKeyValueStatusLoaded)
         return MediaPlayerPrivateAVFoundation::resolvedURL();
 
     return URL([m_avAsset resolvedURL]);
@@ -2867,6 +2867,7 @@
                     @"preferredVolume",
                     @"preferredRate",
                     @"playable",
+                    @"resolvedURL",
                     @"tracks",
                     @"availableMediaCharacteristicsWithMediaSelectionOptions",
                    nil];
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to