Bug 1351477 - Remove IsSWFPlayerEnabled function; r=bsmedberg
authorKyle Machulis <kyle@nonpolynomial.com>
Tue, 28 Mar 2017 14:56:20 -0700
changeset 350494 0010979aed5c6be781e9aaa76eaa51678f50066a
parent 350493 c5cecddbe344d124d91a21eb567b1b85256ceb90
child 350495 61654eb3874c0222bbb8603de0a5d7de46f9b8bf
push id31576
push userryanvm@gmail.com
push dateThu, 30 Mar 2017 19:18:48 +0000
treeherdermozilla-central@0156a91a9fba [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs1351477
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
@@ -6763,30 +6763,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;
   }
 
@@ -10148,23 +10134,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);