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
--- 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);