Bug 1291537 - Assume GMPs are unsupported when running in 32bit mode on MacOS. r=spohl a=lizzard
authorChris Pearce <cpearce@mozilla.com>
Wed, 03 Aug 2016 15:19:00 +1200
changeset 342281 f948c66393c422ca94967b6f961e5673c8c9525c
parent 342280 63cdaf45dd0223d5209ac51dd5129e27a7732564
child 342282 ff14a84489e5e5e0726adc8a8bd393b69127edf9
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersspohl, lizzard
bugs1291537
milestone49.0
Bug 1291537 - Assume GMPs are unsupported when running in 32bit mode on MacOS. r=spohl a=lizzard Users may have opted into running in 32bit mode if they have certain plugins, or manually from Finder's Info dialog. We end up downloading the 64bit GMP and installing it when running in 32bit mode, and it will crash. Since we're dropping 32bit MacOS Firefox in 52, there doesn't seem to be much point doing work to make us install the 32bit GMP on 32bit mode on MacOS, and pushing out new 32bit GMPs. So just mark them as unsupported. MozReview-Commit-ID: KRZKPKZkmKB
toolkit/modules/GMPUtils.jsm
toolkit/mozapps/extensions/internal/GMPProvider.jsm
--- a/toolkit/modules/GMPUtils.jsm
+++ b/toolkit/modules/GMPUtils.jsm
@@ -37,16 +37,21 @@ var GMPPluginHiddenReason = {
 this.GMPUtils = {
   /**
    * Checks whether or not a given plugin is hidden. Hidden plugins are neither
    * downloaded nor displayed in the addons manager.
    * @param   aPlugin
    *          The plugin to check.
    */
   isPluginHidden: function(aPlugin) {
+    if (this._is32bitModeMacOS()) {
+      // GMPs are hidden on MacOS when running in 32 bit mode.
+      // See bug 1291537.
+      return true;
+    }
     if (!aPlugin.isEME) {
       return false;
     }
 
     if (!this._isPluginSupported(aPlugin) ||
         !this._isPluginVisible(aPlugin)) {
       this.maybeReportTelemetry(aPlugin.id,
                                 "VIDEO_EME_ADOBE_HIDDEN_REASON",
@@ -88,16 +93,23 @@ this.GMPUtils = {
       return AppConstants.isPlatformAndVersionAtLeast("win", "6") ||
              AppConstants.platform == "macosx" ||
              AppConstants.platform == "linux";
     }
 
     return true;
   },
 
+  _is32bitModeMacOS: function() {
+    if (AppConstants.platform != "macosx") {
+      return false;
+    }
+    return Services.appinfo.XPCOMABI.split("-")[0] == "x86";
+  },
+
   /**
    * Checks whether or not a given plugin is visible in the addons manager
    * UI and the "enable DRM" notification box. This can be used to test
    * plugins that aren't yet turned on in the mozconfig.
    * @param   aPlugin
    *          The plugin to check.
    */
   _isPluginVisible: function(aPlugin) {
--- a/toolkit/mozapps/extensions/internal/GMPProvider.jsm
+++ b/toolkit/mozapps/extensions/internal/GMPProvider.jsm
@@ -178,17 +178,21 @@ GMPWrapper.prototype = {
   get homepageURL() { return this._plugin.homepageURL; },
 
   get description() { return this._plugin.description; },
   get fullDescription() { return this._plugin.fullDescription; },
 
   get version() { return GMPPrefs.get(GMPPrefs.KEY_PLUGIN_VERSION, null,
                                       this._plugin.id); },
 
-  get isActive() { return !this.appDisabled && !this.userDisabled; },
+  get isActive() {
+    return !this.appDisabled &&
+           !this.userDisabled &&
+           !GMPUtils.isPluginHidden(this._plugin.id);
+  },
   get appDisabled() {
     if (this._plugin.isEME && !GMPPrefs.get(GMPPrefs.KEY_EME_ENABLED, true)) {
       // If "media.eme.enabled" is false, all EME plugins are disabled.
       return true;
     }
    return false;
   },