Bug 1524049 - pref on Vorbis decoding on RDD for Windows. r=drno
authorMichael Froman <mfroman@mozilla.com>
Fri, 22 Nov 2019 20:49:14 +0000
changeset 503480 ce600e54dfb93a80b01c4874f6467fcae16d5e92
parent 503479 418a4b4c4de7791854df742dffae92db351c5591
child 503481 b9bfd134a782fb5f0705b9be9acc5a42d6997812
push id101343
push usermfroman@mozilla.com
push dateFri, 22 Nov 2019 22:23:45 +0000
treeherderautoland@ce600e54dfb9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdrno
bugs1524049, 1597408
milestone72.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 1524049 - pref on Vorbis decoding on RDD for Windows. r=drno Also, make sure it is disabled for MinGW builds because of Bug 1597408. Differential Revision: https://phabricator.services.mozilla.com/D53286
dom/media/ipc/RemoteDecoderModule.cpp
dom/media/platforms/agnostic/AgnosticDecoderModule.cpp
modules/libpref/init/StaticPrefList.yaml
--- a/dom/media/ipc/RemoteDecoderModule.cpp
+++ b/dom/media/ipc/RemoteDecoderModule.cpp
@@ -39,19 +39,27 @@ bool RemoteDecoderModule::SupportsMimeTy
     const nsACString& aMimeType, DecoderDoctorDiagnostics* aDiagnostics) const {
   bool supports = false;
 
 #ifdef MOZ_AV1
   if (StaticPrefs::media_av1_enabled()) {
     supports |= AOMDecoder::IsAV1(aMimeType);
   }
 #endif
+#if !defined(__MINGW32__)
+  // We can't let RDD handle the decision to support Vorbis decoding on
+  // MinGW builds because of Bug 1597408 (Vorbis decoding on RDD causing
+  // sandboxing failure on MinGW-clang).  Typically this would be dealt
+  // with using defines in StaticPrefList.yaml, but we must handle it
+  // here because of Bug 1598426 (the __MINGW32__ define isn't supported
+  // in StaticPrefList.yaml).
   if (StaticPrefs::media_rdd_vorbis_enabled()) {
     supports |= VorbisDataDecoder::IsVorbis(aMimeType);
   }
+#endif
   if (StaticPrefs::media_rdd_wav_enabled()) {
     supports |= WaveDataDecoder::IsWave(aMimeType);
   }
   if (StaticPrefs::media_rdd_opus_enabled()) {
     supports |= OpusDataDecoder::IsOpus(aMimeType);
   }
 
   MOZ_LOG(
--- a/dom/media/platforms/agnostic/AgnosticDecoderModule.cpp
+++ b/dom/media/platforms/agnostic/AgnosticDecoderModule.cpp
@@ -19,21 +19,32 @@
 #endif
 
 namespace mozilla {
 
 bool AgnosticDecoderModule::SupportsMimeType(
     const nsACString& aMimeType, DecoderDoctorDiagnostics* aDiagnostics) const {
   bool supports =
       VPXDecoder::IsVPX(aMimeType) || TheoraDecoder::IsTheora(aMimeType);
+#if defined(__MINGW32__)
+  // If this is a MinGW build we need to force AgnosticDecoderModule to
+  // handle the decision to support Vorbis decoding (instead of
+  // RDD/RemoteDecoderModule) because of Bug 1597408 (Vorbis decoding on
+  // RDD causing sandboxing failure on MinGW-clang).  Typically this
+  // would be dealt with using defines in StaticPrefList.yaml, but we
+  // must handle it here because of Bug 1598426 (the __MINGW32__ define
+  // isn't supported in StaticPrefList.yaml).
+  supports |= VorbisDataDecoder::IsVorbis(aMimeType);
+#else
   if (!StaticPrefs::media_rdd_vorbis_enabled() ||
       !StaticPrefs::media_rdd_process_enabled() ||
       !BrowserTabsRemoteAutostart()) {
     supports |= VorbisDataDecoder::IsVorbis(aMimeType);
   }
+#endif
   if (!StaticPrefs::media_rdd_wav_enabled() ||
       !StaticPrefs::media_rdd_process_enabled() ||
       !BrowserTabsRemoteAutostart()) {
     supports |= WaveDataDecoder::IsWave(aMimeType);
   }
   if (!StaticPrefs::media_rdd_opus_enabled() ||
       !StaticPrefs::media_rdd_process_enabled() ||
       !BrowserTabsRemoteAutostart()) {
--- a/modules/libpref/init/StaticPrefList.yaml
+++ b/modules/libpref/init/StaticPrefList.yaml
@@ -5806,16 +5806,18 @@
   mirror: always
 
 - name: media.rdd-vorbis.enabled
   type: RelaxedAtomicBool
 #if defined(XP_LINUX) && !defined(ANDROID)
   value: true
 #elif defined(XP_MACOSX)
   value: true
+#elif defined(XP_WIN) && !defined(_ARM64_)
+  value: true
 #else
   value: false
 #endif
   mirror: always
 
 - name: media.rdd-wav.enabled
   type: RelaxedAtomicBool
 #if defined(XP_LINUX) && !defined(ANDROID)