Title: [170507] tags/Safari-538.43/Source/WebCore
Revision
170507
Author
[email protected]
Date
2014-06-26 16:48:33 -0700 (Thu, 26 Jun 2014)

Log Message

Merged r170478.  <rdar://problem/17309186>

Modified Paths

Diff

Modified: tags/Safari-538.43/Source/WebCore/ChangeLog (170506 => 170507)


--- tags/Safari-538.43/Source/WebCore/ChangeLog	2014-06-26 23:44:31 UTC (rev 170506)
+++ tags/Safari-538.43/Source/WebCore/ChangeLog	2014-06-26 23:48:33 UTC (rev 170507)
@@ -1,5 +1,20 @@
 2014-06-26  Lucas Forschler  <[email protected]>
 
+        Merge r170478
+
+    2014-06-26  Eric Carlson  <[email protected]>
+
+            [Mac] allow host application to canonicalize media urls
+            https://bugs.webkit.org/show_bug.cgi?id=134329
+
+            Reviewed by Dean Jackson.
+
+            * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+            (WebCore::canonicalURL): New, use NSURLProtocol to canonicalize a URL.
+            (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Call canonicalURL.
+
+2014-06-26  Lucas Forschler  <[email protected]>
+
         Merge r170485
 
     2014-06-26  Eric Carlson  <[email protected]>

Modified: tags/Safari-538.43/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (170506 => 170507)


--- tags/Safari-538.43/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2014-06-26 23:44:31 UTC (rev 170506)
+++ tags/Safari-538.43/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2014-06-26 23:48:33 UTC (rev 170507)
@@ -671,6 +671,24 @@
 }
 #endif
 
+
+static NSURL *canonicalURL(const String& url)
+{
+    NSURL *cocoaURL = URL(ParsedURLString, url);
+    if (url.isEmpty())
+        return cocoaURL;
+
+    RetainPtr<NSURLRequest> request = adoptNS([[NSURLRequest alloc] initWithURL:cocoaURL]);
+    if (!request)
+        return cocoaURL;
+
+    NSURLRequest *canonicalRequest = [NSURLProtocol canonicalRequestForRequest:request.get()];
+    if (!canonicalRequest)
+        return cocoaURL;
+
+    return [canonicalRequest URL];
+}
+
 void MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL(const String& url)
 {
     if (m_avAsset)
@@ -733,7 +751,7 @@
         [options setObject:networkInterfaceName forKey:AVURLAssetBoundNetworkInterfaceName];
 #endif
 
-    NSURL *cocoaURL = URL(ParsedURLString, url);
+    NSURL *cocoaURL = canonicalURL(url);
     m_avAsset = adoptNS([[AVURLAsset alloc] initWithURL:cocoaURL options:options.get()]);
 
 #if HAVE(AVFOUNDATION_LOADER_DELEGATE)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to