Bug 1117765: Disable OpenH264 module download when media.gmp-gmpopenh264.enabled is set to false. r=bsmedberg
authorStephen Pohl <spohl.mozilla.bugs@gmail.com>
Mon, 05 Jan 2015 12:09:24 -0500
changeset 247863 e7d6c779dc480289d4fff03f905791096888fc43
parent 247862 1a932cff0528a1882f0ee2ba8378e30d4c0c382b
child 247864 90e632524106f358e6dc0a6133dcf1ddd7bead28
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs1117765
milestone37.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 1117765: Disable OpenH264 module download when media.gmp-gmpopenh264.enabled is set to false. r=bsmedberg
toolkit/modules/GMPInstallManager.jsm
--- a/toolkit/modules/GMPInstallManager.jsm
+++ b/toolkit/modules/GMPInstallManager.jsm
@@ -111,16 +111,17 @@ let GMPPrefs = {
   _getPrefKey: function(key, addon) {
     return  key.replace("{0}", addon || "");
   },
 
   /**
    * List of keys which can be used in get and set
    */
   KEY_LOG_ENABLED: "media.gmp-manager.log",
+  KEY_ADDON_ENABLED: "media.{0}.enabled",
   KEY_ADDON_LAST_UPDATE: "media.{0}.lastUpdate",
   KEY_ADDON_VERSION: "media.{0}.version",
   KEY_ADDON_AUTOUPDATE: "media.{0}.autoupdate",
   KEY_URL: "media.gmp-manager.url",
   KEY_URL_OVERRIDE: "media.gmp-manager.url.override",
   KEY_CERT_CHECKATTRS: "media.gmp-manager.cert.checkAttributes",
   KEY_CERT_REQUIREBUILTIN: "media.gmp-manager.cert.requireBuiltIn",
   KEY_UPDATE_LAST_CHECK: "media.gmp-manager.lastCheck",
@@ -429,18 +430,20 @@ GMPInstallManager.prototype = {
   /**
    * Wrapper for checkForAddons and installAddon.
    * Will only install if not already installed and will log the results.
    * This will only install/update the OpenH264 plugin
    */
   simpleCheckAndInstall: function() {
     let log = getScopedLogger("simpleCheckAndInstall");
 
-    let autoUpdate = GMPPrefs.get(GMPPrefs.KEY_ADDON_AUTOUPDATE,
-                                  OPEN_H264_ID, true);
+    let autoUpdate = GMPPrefs.get(GMPPrefs.KEY_ADDON_ENABLED, OPEN_H264_ID,
+                                  true) &&
+                     GMPPrefs.get(GMPPrefs.KEY_ADDON_AUTOUPDATE, OPEN_H264_ID,
+                                  true);
     if (!autoUpdate) {
         log.info("Auto-update is off for openh264, aborting check.");
         return Promise.resolve({status: "check-disabled"});
     }
 
     let secondsBetweenChecks =
       GMPPrefs.get(GMPPrefs.KEY_UPDATE_SECONDS_BETWEEN_CHECKS, undefined,
                    DEFAULT_SECONDS_BETWEEN_CHECKS)