Bug 1351477 - Remove IsSWFPlayerEnabled function; r?bsmedberg draft
authorKyle Machulis <kyle@nonpolynomial.com>
Tue, 28 Mar 2017 14:56:20 -0700
changeset 552717 c4afff3a222e39a93505e63780adb63aa9994b5e
parent 552546 0e0eb96528a1d032fe6ed54f67d32290d533fbfd
child 552722 bed7c265570e7b1fb69e0e3e49e27eb14681e0f9
push id51434
push userbmo:kyle@nonpolynomial.com
push dateTue, 28 Mar 2017 21:57:44 +0000
reviewersbsmedberg
bugs1351477
milestone55.0a1
Bug 1351477 - Remove IsSWFPlayerEnabled function; r?bsmedberg Since the Shumway project is dead, we no longer register a stream converter for flash files. We can remove this check, as it will always return false. MozReview-Commit-ID: CzC7wYmWEFp
docshell/base/nsWebNavigationInfo.cpp
dom/base/nsContentUtils.cpp
dom/base/nsObjectLoadingContent.cpp
--- a/docshell/base/nsWebNavigationInfo.cpp
+++ b/docshell/base/nsWebNavigationInfo.cpp
@@ -46,23 +46,16 @@ nsWebNavigationInfo::IsTypeSupported(con
 
   // We want to claim that the type for PDF documents is unsupported,
   // so that the internal PDF viewer's stream converted will get used.
   if (aType.LowerCaseEqualsLiteral("application/pdf") &&
       nsContentUtils::IsPDFJSEnabled()) {
     return NS_OK;
   }
 
-  // We want to claim that the type for SWF movies is unsupported,
-  // so that the internal SWF player's stream converter will get used.
-  if (aType.LowerCaseEqualsLiteral("application/x-shockwave-flash") &&
-      nsContentUtils::IsSWFPlayerEnabled()) {
-    return NS_OK;
-  }
-
   const nsCString& flatType = PromiseFlatCString(aType);
   nsresult rv = IsTypeSupportedInternal(flatType, aIsTypeSupported);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (*aIsTypeSupported) {
     return rv;
   }
 
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -6674,30 +6674,16 @@ nsContentUtils::IsPDFJSEnabled()
    nsresult rv = NS_ERROR_FAILURE;
    bool canConvert = false;
    if (convServ) {
      rv = convServ->CanConvert("application/pdf", "text/html", &canConvert);
    }
    return NS_SUCCEEDED(rv) && canConvert;
 }
 
-bool
-nsContentUtils::IsSWFPlayerEnabled()
-{
-   nsCOMPtr<nsIStreamConverterService> convServ =
-     do_GetService("@mozilla.org/streamConverters;1");
-   nsresult rv = NS_ERROR_FAILURE;
-   bool canConvert = false;
-   if (convServ) {
-     rv = convServ->CanConvert("application/x-shockwave-flash",
-                               "text/html", &canConvert);
-   }
-   return NS_SUCCEEDED(rv) && canConvert;
-}
-
 already_AddRefed<nsIDocumentLoaderFactory>
 nsContentUtils::FindInternalContentViewer(const nsACString& aType,
                                           ContentViewerType* aLoaderType)
 {
   if (aLoaderType) {
     *aLoaderType = TYPE_UNSUPPORTED;
   }
 
@@ -10059,23 +10045,16 @@ nsContentUtils::HtmlObjectContentTypeFor
 
   // Faking support of the PDF content as a document for EMBED tags
   // when internal PDF viewer is enabled.
   if (aMIMEType.LowerCaseEqualsLiteral("application/pdf") &&
       IsPDFJSEnabled()) {
     return nsIObjectLoadingContent::TYPE_DOCUMENT;
   }
 
-  // Faking support of the SWF content as a document for EMBED tags
-  // when internal SWF player is enabled.
-  if (aMIMEType.LowerCaseEqualsLiteral("application/x-shockwave-flash") &&
-      IsSWFPlayerEnabled()) {
-    return nsIObjectLoadingContent::TYPE_DOCUMENT;
-  }
-
   if (HtmlObjectContentSupportsDocument(aMIMEType, aContent)) {
     return nsIObjectLoadingContent::TYPE_DOCUMENT;
   }
 
   RefPtr<nsPluginHost> pluginHost = nsPluginHost::GetInst();
   if (pluginHost &&
       pluginHost->HavePluginForType(aMIMEType, nsPluginHost::eExcludeNone)) {
     // ShouldPlay will handle checking for disabled plugins
--- a/dom/base/nsObjectLoadingContent.cpp
+++ b/dom/base/nsObjectLoadingContent.cpp
@@ -489,21 +489,16 @@ IsPluginEnabledByExtension(nsIURI* uri, 
     return false;
   }
 
   // Disables any native PDF plugins, when internal PDF viewer is enabled.
   if (ext.EqualsIgnoreCase("pdf") && nsContentUtils::IsPDFJSEnabled()) {
     return false;
   }
 
-  // Disables any native SWF plugins, when internal SWF player is enabled.
-  if (ext.EqualsIgnoreCase("swf") && nsContentUtils::IsSWFPlayerEnabled()) {
-    return false;
-  }
-
   RefPtr<nsPluginHost> pluginHost = nsPluginHost::GetInst();
 
   if (!pluginHost) {
     NS_NOTREACHED("No pluginhost");
     return false;
   }
 
   return pluginHost->HavePluginForExtension(ext, mimeType);