Bug 1175006 - Reset state so we re-try creating a trial GMPVideoDecoder whenever Firefox updates. r=spohl
authorChris Pearce <cpearce@mozilla.com>
Wed, 17 Jun 2015 11:00:42 +1200
changeset 267352 9c45565cdccc03a06be779fa31f219337732ceed
parent 267351 6c05b6375d9feba15f298a4bdb079cca9e3a4488
child 267353 872f35399f85dff87ee2cc57b989afa296052331
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-esr52@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersspohl
bugs1175006
milestone41.0a1
Bug 1175006 - Reset state so we re-try creating a trial GMPVideoDecoder whenever Firefox updates. r=spohl
toolkit/modules/GMPInstallManager.jsm
--- a/toolkit/modules/GMPInstallManager.jsm
+++ b/toolkit/modules/GMPInstallManager.jsm
@@ -371,16 +371,25 @@ 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) {