Bug 1232799 - Remove KEY_PLUGIN_TRIAL_CREATE pref from GMPProvider and friends. r?spohl draft
authorChris Pearce <cpearce@mozilla.com>
Wed, 16 Dec 2015 10:38:51 +1300
changeset 315596 da4e90b6fcb032625c109f4636f39f0897d2fb6b
parent 315595 84c1cea6012ac2670dda7c1d5e1aaaad03ee70e6
child 512058 34f9dea7683592c784ce7b5c824d3f7c3b977b35
push id8434
push usercpearce@mozilla.com
push dateTue, 15 Dec 2015 21:41:02 +0000
reviewersspohl
bugs1232799, 1232527
milestone46.0a1
Bug 1232799 - Remove KEY_PLUGIN_TRIAL_CREATE pref from GMPProvider and friends. r?spohl The GMPVideoDecoderTrialCreator was removed from Gecko in bug 1232527, and so we don't need to set/reset this pref in the GMPProvider any more.
toolkit/modules/GMPInstallManager.jsm
toolkit/modules/GMPUtils.jsm
toolkit/mozapps/extensions/internal/GMPProvider.jsm
--- a/toolkit/modules/GMPInstallManager.jsm
+++ b/toolkit/modules/GMPInstallManager.jsm
@@ -182,25 +182,16 @@ GMPInstallManager.prototype = {
    */
   simpleCheckAndInstall: Task.async(function*() {
     let log = getScopedLogger("GMPInstallManager.simpleCheckAndInstall");
 
     if (this._versionchangeOccurred()) {
       log.info("A version change occurred. Ignoring " +
                "media.gmp-manager.lastCheck to check immediately for " +
                "new or updated GMPs.");
-      // Firefox updated; it could be that the TrialGMPVideoDecoderCreator
-      // had failed but could now succeed, or vice versa. So reset the
-      // prefs so we re-try next time EME is used.
-      GMP_PLUGIN_IDS.concat("gmp-eme-clearkey").forEach(
-        function(id, index, array) {
-          log.info("Version change, resetting " +
-                   GMPPrefs.getPrefKey(GMPPrefs.KEY_PLUGIN_TRIAL_CREATE, id));
-          GMPPrefs.reset(GMPPrefs.KEY_PLUGIN_TRIAL_CREATE, id);
-        });
     } else {
       let secondsBetweenChecks =
         GMPPrefs.get(GMPPrefs.KEY_SECONDS_BETWEEN_CHECKS,
                      DEFAULT_SECONDS_BETWEEN_CHECKS)
       let secondsSinceLast = this._getTimeSinceLastCheck();
       log.info("Last check was: " + secondsSinceLast +
                " seconds ago, minimum seconds: " + secondsBetweenChecks);
       if (secondsBetweenChecks > secondsSinceLast) {
@@ -490,20 +481,16 @@ GMPDownloader.prototype = {
                               gmpAddon.version);
       log.info("install to directory path: " + path);
       let gmpInstaller = new GMPExtractor(zipPath, path);
       let installPromise = gmpInstaller.install();
       return installPromise.then(extractedPaths => {
         // Success, set the prefs
         let now = Math.round(Date.now() / 1000);
         GMPPrefs.set(GMPPrefs.KEY_PLUGIN_LAST_UPDATE, now, gmpAddon.id);
-        // Reset the trial create pref, so that Gecko knows to do a test
-        // run before reporting that the GMP works to content.
-        GMPPrefs.reset(GMPPrefs.KEY_PLUGIN_TRIAL_CREATE, gmpAddon.version,
-                       gmpAddon.id);
         // Remember our ABI, so that if the profile is migrated to another
         // platform or from 32 -> 64 bit, we notice and don't try to load the
         // unexecutable plugin library.
         GMPPrefs.set(GMPPrefs.KEY_PLUGIN_ABI, UpdateUtils.ABI, gmpAddon.id);
         // Setting the version pref signals installation completion to consumers,
         // if you need to set other prefs etc. do it before this.
         GMPPrefs.set(GMPPrefs.KEY_PLUGIN_VERSION, gmpAddon.version,
                      gmpAddon.id);
--- a/toolkit/modules/GMPUtils.jsm
+++ b/toolkit/modules/GMPUtils.jsm
@@ -133,17 +133,16 @@ this.GMPUtils = {
  */
 this.GMPPrefs = {
   KEY_EME_ENABLED:              "media.eme.enabled",
   KEY_PLUGIN_ENABLED:           "media.{0}.enabled",
   KEY_PLUGIN_LAST_UPDATE:       "media.{0}.lastUpdate",
   KEY_PLUGIN_VERSION:           "media.{0}.version",
   KEY_PLUGIN_AUTOUPDATE:        "media.{0}.autoupdate",
   KEY_PLUGIN_FORCEVISIBLE:      "media.{0}.forcevisible",
-  KEY_PLUGIN_TRIAL_CREATE:      "media.{0}.trial-create",
   KEY_PLUGIN_ABI:               "media.{0}.abi",
   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",
   KEY_SECONDS_BETWEEN_CHECKS:   "media.gmp-manager.secondsBetweenChecks",
   KEY_APP_DISTRIBUTION:         "distribution.id",
--- a/toolkit/mozapps/extensions/internal/GMPProvider.jsm
+++ b/toolkit/mozapps/extensions/internal/GMPProvider.jsm
@@ -439,17 +439,16 @@ GMPWrapper.prototype = {
   uninstallPlugin: function() {
     AddonManagerPrivate.callAddonListeners("onUninstalling", this, false);
     if (this.gmpPath) {
       this._log.info("uninstallPlugin() - unregistering gmp directory " +
                      this.gmpPath);
       gmpService.removeAndDeletePluginDirectory(this.gmpPath);
     }
     GMPPrefs.reset(GMPPrefs.KEY_PLUGIN_VERSION, this.id);
-    GMPPrefs.reset(GMPPrefs.KEY_PLUGIN_TRIAL_CREATE, this.id);
     GMPPrefs.reset(GMPPrefs.KEY_PLUGIN_ABI, this.id);
     GMPPrefs.reset(GMPPrefs.KEY_PLUGIN_LAST_UPDATE, this.id);
     AddonManagerPrivate.callAddonListeners("onUninstalled", this);
   },
 
   shutdown: function() {
     Preferences.ignore(GMPPrefs.getPrefKey(GMPPrefs.KEY_PLUGIN_ENABLED,
                                            this._plugin.id),