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 347618 93f9fde505f4f3fb3eefce52453663238cda12fa
parent 347617 fb956712e50f5e08af1a3106bed8b67badc04dde
child 347619 deba9752fc422bd5c3c0d611c9d8963c6a727374
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersspohl, lizzard
bugs1291537
milestone50.0a2
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)) {
       return true;
     }
@@ -78,16 +83,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
@@ -165,17 +165,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;
   },