Commit 243006e3 authored by Chris Pearce's avatar Chris Pearce
Browse files

Bug 1291537 - Assume GMPs are unsupported when running in 32bit mode on MacOS. r=spohl

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

--HG--
extra : rebase_source : 98cb35ec9469b136a744fe7a2423de6a7e143489
parent a826042a
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -42,6 +42,11 @@ this.GMPUtils = {
   *          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;
    }
@@ -81,6 +86,13 @@ this.GMPUtils = {
    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
+5 −1
Original line number Diff line number Diff line
@@ -170,7 +170,11 @@ GMPWrapper.prototype = {
  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.