Unreviewed, rolling out r204128.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Aug 2016 21:19:43 +0000 (21:19 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Aug 2016 21:19:43 +0000 (21:19 +0000)
https://bugs.webkit.org/show_bug.cgi?id=160607

Solve the issue by removing the workaround for static files
(Requested by jonlee_ on #webkit).

Reverted changeset:

"Temporary redirected m3u8 streaming stopped working."
https://bugs.webkit.org/show_bug.cgi?id=160472
http://trac.webkit.org/changeset/204128

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

LayoutTests/ChangeLog
LayoutTests/http/tests/media/hls/hls-redirect-expected.txt [deleted file]
LayoutTests/http/tests/media/hls/hls-redirect.html [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/platform/MIMETypeRegistry.cpp
Source/WebCore/platform/MIMETypeRegistry.h
Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.mm

index 01c8bc8..9d19c46 100644 (file)
@@ -1,3 +1,17 @@
+2016-08-05  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r204128.
+        https://bugs.webkit.org/show_bug.cgi?id=160607
+
+        Solve the issue by removing the workaround for static files
+        (Requested by jonlee_ on #webkit).
+
+        Reverted changeset:
+
+        "Temporary redirected m3u8 streaming stopped working."
+        https://bugs.webkit.org/show_bug.cgi?id=160472
+        http://trac.webkit.org/changeset/204128
+
 2016-08-05  Jonathan Bedard  <jbedard@apple.com>
 
         Remove testRunner.handleErrorPages()
diff --git a/LayoutTests/http/tests/media/hls/hls-redirect-expected.txt b/LayoutTests/http/tests/media/hls/hls-redirect-expected.txt
deleted file mode 100644 (file)
index a6b2964..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-
-load metadata OK
-END OF TEST
-
diff --git a/LayoutTests/http/tests/media/hls/hls-redirect.html b/LayoutTests/http/tests/media/hls/hls-redirect.html
deleted file mode 100644 (file)
index 797d5d6..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src=../../media-resources/video-test.js></script>
-</head>
-<body>
-<video src="http://127.0.0.1:8000/resources/redirect.php?code=307&url=http%3A%2F%2Flocalhost%3A8000/media/resources/hls/test-vod.m3u8" onloadedmetadata="logResult(true, 'load metadata'); endTest()" onerror="failTest('load error')"></video>
-</body>
-</html>
index 09e601d..9eb64a5 100644 (file)
@@ -1,3 +1,17 @@
+2016-08-05  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r204128.
+        https://bugs.webkit.org/show_bug.cgi?id=160607
+
+        Solve the issue by removing the workaround for static files
+        (Requested by jonlee_ on #webkit).
+
+        Reverted changeset:
+
+        "Temporary redirected m3u8 streaming stopped working."
+        https://bugs.webkit.org/show_bug.cgi?id=160472
+        http://trac.webkit.org/changeset/204128
+
 2016-08-05  Brent Fulgham  <bfulgham@apple.com>
 
         validity assertion fails after removing a child of an <optgroup> element
index 9af9f85..3a34396 100644 (file)
@@ -146,7 +146,6 @@ static HashSet<String, ASCIICaseInsensitiveHash>* supportedImageMIMETypesForEnco
 static HashSet<String, ASCIICaseInsensitiveHash>* supportedJavaScriptMIMETypes;
 static HashSet<String, ASCIICaseInsensitiveHash>* supportedNonImageMIMETypes;
 static HashSet<String, ASCIICaseInsensitiveHash>* supportedMediaMIMETypes;
-static HashSet<String, ASCIICaseInsensitiveHash>* mpegPlaylistMIMETypes;
 static HashSet<String, ASCIICaseInsensitiveHash>* pdfMIMETypes;
 static HashSet<String, ASCIICaseInsensitiveHash>* pdfAndPostScriptMIMETypes;
 static HashSet<String, ASCIICaseInsensitiveHash>* unsupportedTextMIMETypes;
@@ -302,22 +301,6 @@ static void initializeSupportedJavaScriptMIMETypes()
         supportedJavaScriptMIMETypes->add(type);
 }
 
-static void initializeMPEGPlaylistMIMETypes()
-{
-    const char* const types[] = {
-        "application/vnd.apple.mpegurl",
-        "application/mpegurl",
-        "application/x-mpegurl",
-        "audio/mpegurl",
-        "audio/x-mpegurl",
-        "audio/mpegurl",
-        "audio/x-mpegurl"
-    };
-
-    for (auto& type : types)
-        mpegPlaylistMIMETypes->add(type);
-}
-
 static void initializePDFMIMETypes()
 {
     const char* const types[] = {
@@ -472,9 +455,6 @@ static void initializeMIMETypeRegistry()
     supportedImageMIMETypes = new HashSet<String, ASCIICaseInsensitiveHash>;
     initializeSupportedImageMIMETypes();
 
-    mpegPlaylistMIMETypes = new HashSet<String, ASCIICaseInsensitiveHash>;
-    initializeMPEGPlaylistMIMETypes();
-
     pdfMIMETypes = new HashSet<String, ASCIICaseInsensitiveHash>;
     initializePDFMIMETypes();
 
@@ -573,15 +553,6 @@ bool MIMETypeRegistry::isJavaAppletMIMEType(const String& mimeType)
         || mimeType.startsWith("application/x-java-vm", false);
 }
 
-bool MIMETypeRegistry::isMPEGPlaylistMIMEType(const String& mimeType)
-{
-    if (mimeType.isEmpty())
-        return false;
-    if (!mpegPlaylistMIMETypes)
-        initializeMIMETypeRegistry();
-    return mpegPlaylistMIMETypes->contains(mimeType);
-}
-
 bool MIMETypeRegistry::isPDFOrPostScriptMIMEType(const String& mimeType)
 {
     if (mimeType.isEmpty())
index a27d825..4dc74e7 100644 (file)
@@ -76,9 +76,6 @@ public:
     // Check to see if a MIME type is a plugin implemented by the browser.
     static bool isApplicationPluginMIMEType(const String& mimeType);
 
-    // Check to see if a MIME type is one of the MPEG playlists types.
-    static bool isMPEGPlaylistMIMEType(const String& mimeType);
-
     // Check to see if a MIME type is one of the common PDF/PS types.
     WEBCORE_EXPORT static bool isPDFOrPostScriptMIMEType(const String& mimeType);
     static bool isPDFMIMEType(const String& mimeType);
index 697c16f..4c57c3b 100644 (file)
@@ -29,7 +29,6 @@
 #if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100
 
 #import "CachedResourceRequest.h"
-#import "MIMETypeRegistry.h"
 #import "PlatformMediaResourceLoader.h"
 #import "SecurityOrigin.h"
 #import "SubresourceLoader.h"
@@ -587,20 +586,9 @@ void WebCoreNSURLSessionDataTaskClient::loadFinished(PlatformMediaResource& reso
         // and use that URL for all future requests for the same piece of media. This breaks
         // certain features of CORS, as well as being against the HTTP spec in the case of
         // non-permanent redirects.
-
-        // Exclude MPEG Playlists since these require the redirected URL as the base URL
-        // for relative paths.
-        String mimeType = response.nsURLResponse().MIMEType;
-        if (mimeType.isEmpty() || mimeType == "application/octet-stream" || mimeType == "text/plain") {
-            String extension = response.nsURLResponse().URL.pathExtension;
-            mimeType = MIMETypeRegistry::getMediaMIMETypeForExtension(extension);
-
-        }
-        if (!MIMETypeRegistry::isMPEGPlaylistMIMEType(mimeType)) {
-            auto responseData = response.crossThreadData();
-            responseData.url = URL(self.currentRequest.URL);
-            strongResponse = ResourceResponseBase::fromCrossThreadData(WTFMove(responseData)).nsURLResponse();
-        }
+        auto responseData = response.crossThreadData();
+        responseData.url = URL(self.currentRequest.URL);
+        strongResponse = ResourceResponseBase::fromCrossThreadData(WTFMove(responseData)).nsURLResponse();
     }
 
     RetainPtr<WebCoreNSURLSessionDataTask> strongSelf { self };
@@ -670,18 +658,8 @@ void WebCoreNSURLSessionDataTaskClient::loadFinished(PlatformMediaResource& reso
     // FIXME(<rdar://problem/27000361>):
     // Do not update the current request if the redirect is temporary; use this
     // current request during responseReceieved: to work around a CoreMedia bug.
-
-    // Exclude MPEG Playlists since these require the redirected URL as the base URL
-    // for relative paths.
-    if (response.httpStatusCode() != 302 && response.httpStatusCode() != 307) {
-        String mimeType = response.nsURLResponse().MIMEType;
-        if (mimeType.isEmpty() || mimeType == "application/octet-stream" || mimeType == "text/plain") {
-            String extension = response.nsURLResponse().URL.pathExtension;
-            mimeType = MIMETypeRegistry::getMediaMIMETypeForExtension(extension);
-        }
-        if (!MIMETypeRegistry::isMPEGPlaylistMIMEType(mimeType))
-            self.currentRequest = [NSURLRequest requestWithURL:request.url()];
-    }
+    if (response.httpStatusCode() != 302 && response.httpStatusCode() != 307)
+        self.currentRequest = [NSURLRequest requestWithURL:request.url()];
 
     [self.session updateHasSingleSecurityOrigin:SecurityOrigin::create(request.url())];
 }