From fc2e7c9a1f737b1ba3a190e7fe3520c80d9fe694 Mon Sep 17 00:00:00 2001 From: Chris Peterson Date: Mon, 21 Nov 2016 21:11:04 -0800 Subject: [PATCH] Bug 1318833 - Part 3: Remove unused Silverlight checks from Decoder Doctor. r=gerald --- dom/locales/en-US/chrome/dom/dom.properties | 2 +- dom/media/DecoderDoctorDiagnostics.cpp | 48 ++++----------------- modules/libpref/init/all.js | 2 +- 3 files changed, 11 insertions(+), 41 deletions(-) diff --git a/dom/locales/en-US/chrome/dom/dom.properties b/dom/locales/en-US/chrome/dom/dom.properties index ec0356c04692..57c0a473ff7d 100644 --- a/dom/locales/en-US/chrome/dom/dom.properties +++ b/dom/locales/en-US/chrome/dom/dom.properties @@ -124,7 +124,7 @@ MediaLoadSourceMediaNotMatched=Specified “media” attribute of “%1$S” doe MediaLoadUnsupportedMimeType=HTTP “Content-Type” of “%1$S” is not supported. Load of media resource %2$S failed. # LOCALIZATION NOTE: %S is the URL of the media resource which failed to load because of error in decoding. MediaLoadDecodeError=Media resource %S could not be decoded. -MediaWidevineNoWMFNoSilverlight=Trying to play Widevine with no Windows Media Foundation (nor Silverlight fallback), see https://support.mozilla.org/kb/fix-video-audio-problems-firefox-windows +MediaWidevineNoWMF=Trying to play Widevine with no Windows Media Foundation. See https://support.mozilla.org/kb/fix-video-audio-problems-firefox-windows # LOCALIZATION NOTE: %S is a comma-separated list of codecs (e.g. 'video/mp4, video/webm') MediaWMFNeeded=To play video formats %S, you need to install extra Microsoft software, see https://support.mozilla.org/kb/fix-video-audio-problems-firefox-windows # LOCALIZATION NOTE: %S is a comma-separated list of codecs (e.g. 'video/mp4, video/webm') diff --git a/dom/media/DecoderDoctorDiagnostics.cpp b/dom/media/DecoderDoctorDiagnostics.cpp index 0e6d44a56f53..e7731e11e734 100644 --- a/dom/media/DecoderDoctorDiagnostics.cpp +++ b/dom/media/DecoderDoctorDiagnostics.cpp @@ -250,9 +250,9 @@ DecoderDoctorDocumentWatcher::EnsureTimerIsStarted() } } -static const NotificationAndReportStringId sMediaWidevineNoWMFNoSilverlight = +static const NotificationAndReportStringId sMediaWidevineNoWMF= { dom::DecoderDoctorNotificationType::Platform_decoder_not_found, - "MediaWidevineNoWMFNoSilverlight" }; + "MediaWidevineNoWMF" }; static const NotificationAndReportStringId sMediaWMFNeeded = { dom::DecoderDoctorNotificationType::Platform_decoder_not_found, "MediaWMFNeeded" }; @@ -275,10 +275,10 @@ static const NotificationAndReportStringId sUnsupportedLibavcodec = { dom::DecoderDoctorNotificationType::Unsupported_libavcodec, "MediaUnsupportedLibavcodec" }; -static const NotificationAndReportStringId* +static const NotificationAndReportStringId *const sAllNotificationsAndReportStringIds[] = { - &sMediaWidevineNoWMFNoSilverlight, + &sMediaWidevineNoWMF, &sMediaWMFNeeded, &sMediaUnsupportedBeforeWindowsVista, &sMediaPlatformDecoderNotFound, @@ -375,33 +375,6 @@ ReportAnalysis(nsIDocument* aDocument, } } -enum SilverlightPresence { - eNoSilverlight, - eSilverlightDisabled, - eSilverlightEnabled -}; -static SilverlightPresence -CheckSilverlight() -{ - MOZ_ASSERT(NS_IsMainThread()); - RefPtr pluginHost = nsPluginHost::GetInst(); - if (!pluginHost) { - return eNoSilverlight; - } - nsTArray> plugins; - pluginHost->GetPlugins(plugins, /*aIncludeDisabled*/ true); - for (const auto& plugin : plugins) { - for (const auto& mime : plugin->MimeTypes()) { - if (mime.LowerCaseEqualsLiteral("application/x-silverlight") - || mime.LowerCaseEqualsLiteral("application/x-silverlight-2")) { - return plugin->IsEnabled() ? eSilverlightEnabled : eSilverlightDisabled; - } - } - } - - return eNoSilverlight; -} - static nsString CleanItemForFormatsList(const nsAString& aItem) { @@ -554,14 +527,11 @@ DecoderDoctorDocumentWatcher::SynthesizeAnalysis() // No supported key systems! switch (lastKeySystemIssue) { case DecoderDoctorDiagnostics::eWidevineWithNoWMF: - if (CheckSilverlight() != eSilverlightEnabled) { - DD_INFO("DecoderDoctorDocumentWatcher[%p, doc=%p]::SynthesizeAnalysis() - unsupported key systems: %s, widevine without WMF nor Silverlight", - this, mDocument, NS_ConvertUTF16toUTF8(unsupportedKeySystems).get()); - ReportAnalysis(mDocument, sMediaWidevineNoWMFNoSilverlight, - false, unsupportedKeySystems); - return; - } - break; + DD_INFO("DecoderDoctorDocumentWatcher[%p, doc=%p]::SynthesizeAnalysis() - unsupported key systems: %s, Widevine without WMF", + this, mDocument, NS_ConvertUTF16toUTF8(unsupportedKeySystems).get()); + ReportAnalysis(mDocument, sMediaWidevineNoWMF, false, + unsupportedKeySystems); + return; default: break; } diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 4958f66b7b41..7dd02f5d843c 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -401,7 +401,7 @@ pref("media.gmp.storage.version.expected", 1); // Filter what triggers user notifications. // See DecoderDoctorDocumentWatcher::ReportAnalysis for details. -pref("media.decoder-doctor.notifications-allowed", "MediaWMFNeeded,MediaWidevineNoWMFNoSilverlight,MediaCannotInitializePulseAudio,MediaCannotPlayNoDecoders,MediaUnsupportedLibavcodec"); +pref("media.decoder-doctor.notifications-allowed", "MediaWMFNeeded,MediaWidevineNoWMF,MediaCannotInitializePulseAudio,MediaCannotPlayNoDecoders,MediaUnsupportedLibavcodec"); // Whether we report partial failures. pref("media.decoder-doctor.verbose", false); // Whether DD should consider WMF-disabled a WMF failure, useful for testing.