Backed out changeset f3760acfed2a (bug 1172028) for causing xperf regression
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Wed, 10 Jun 2015 13:44:00 +0200
changeset 248127 70776f034a7c99d3e9db1a0a7ed21b290bd9a546
parent 248126 35b13bc241fdd65dd2a9e6b5a55b54699b844270
child 248128 13ef6f65874d4d661b795209b7e306096a19d91a
push id60888
push userkwierso@gmail.com
push dateThu, 11 Jun 2015 01:38:38 +0000
treeherdermozilla-inbound@39e638ed06bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1172028
milestone41.0a1
backs outf3760acfed2ac7f66c0170948e5c91561bfda44a
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
Backed out changeset f3760acfed2a (bug 1172028) for causing xperf regression
layout/tools/reftest/runreftest.py
testing/profiles/prefs_general.js
toolkit/mozapps/extensions/internal/XPIProvider.jsm
toolkit/mozapps/extensions/test/xpcshell/test_signed_inject.js
--- a/layout/tools/reftest/runreftest.py
+++ b/layout/tools/reftest/runreftest.py
@@ -216,19 +216,16 @@ class RefTest(object):
     prefs['browser.snippets.firstrunHomepage.enabled'] = False
     # And for useragent updates.
     prefs['general.useragent.updates.enabled'] = False
     # And for webapp updates.  Yes, it is supposed to be an integer.
     prefs['browser.webapps.checkForUpdates'] = 0
     # And for about:newtab content fetch and pings.
     prefs['browser.newtabpage.directory.source'] = 'data:application/json,{"reftest":1}'
     prefs['browser.newtabpage.directory.ping'] = ''
-    # Only allow add-ons from the profile and app and allow foreign injection
-    prefs["extensions.enabledScopes"] = 5;
-    prefs["extensions.autoDisableScopes"] = 0;
     # Allow unsigned add-ons
     prefs['xpinstall.signatures.required'] = False
 
     #Don't use auto-enabled e10s
     prefs['browser.tabs.remote.autostart.1'] = False
     prefs['browser.tabs.remote.autostart.2'] = False
     if options.e10s:
       prefs['browser.tabs.remote.autostart'] = True
--- a/testing/profiles/prefs_general.js
+++ b/testing/profiles/prefs_general.js
@@ -64,17 +64,16 @@ user_pref("experiments.logging.level", "
 user_pref("experiments.logging.dump", true);
 // Point the manifest at something local so we don't risk it hitting production
 // data and installing experiments that may vary over time.
 user_pref("experiments.manifest.uri", "http://%(server)s/experiments-dummy/manifest");
 
 // Only load extensions from the application and user profile
 // AddonManager.SCOPE_PROFILE + AddonManager.SCOPE_APPLICATION
 user_pref("extensions.enabledScopes", 5);
-user_pref("extensions.autoDisableScopes", 0);
 // Disable metadata caching for installed add-ons by default
 user_pref("extensions.getAddons.cache.enabled", false);
 // Disable intalling any distribution add-ons
 user_pref("extensions.installDistroAddons", false);
 // XPI extensions are required for test harnesses to load
 user_pref("extensions.defaultProviders.enabled", true);
 // Disable signature requirements where possible
 user_pref("xpinstall.signatures.required", false);
--- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm
@@ -652,22 +652,18 @@ function applyBlocklistChanges(aOldAddon
  *         The add-on to check
  * @return true if the add-on should not be appDisabled
  */
 function isUsableAddon(aAddon) {
   // Hack to ensure the default theme is always usable
   if (aAddon.type == "theme" && aAddon.internalName == XPIProvider.defaultSkin)
     return true;
 
-  if (mustSign(aAddon.type)) {
-    if (aAddon.signedState <= AddonManager.SIGNEDSTATE_MISSING)
-      return false;
-    if (aAddon.foreignInstall && aAddon.signedState < AddonManager.SIGNEDSTATE_SIGNED)
-      return false;
-  }
+  if (mustSign(aAddon.type) && aAddon.signedState <= AddonManager.SIGNEDSTATE_MISSING)
+    return false;
 
   if (aAddon.blocklistState == Blocklist.STATE_BLOCKED)
     return false;
 
   if (AddonManager.checkUpdateSecurity && !aAddon.providesUpdatesSecurely)
     return false;
 
   if (!aAddon.isPlatformCompatible)
@@ -2751,57 +2747,50 @@ this.XPIProvider = {
           }
         }
 
         aManifests[aLocation.name][id] = null;
         let existingAddonID = id;
 
         let jsonfile = stagingDir.clone();
         jsonfile.append(id + ".json");
-        // Assume this was a foreign install if there is no cached metadata file
-        let foreignInstall = !jsonfile.exists();
-        let addon;
 
         try {
-          addon = syncLoadManifestFromFile(stageDirEntry);
+          aManifests[aLocation.name][id] = syncLoadManifestFromFile(stageDirEntry);
         }
         catch (e) {
           logger.error("Unable to read add-on manifest from " + stageDirEntry.path, e);
           // This add-on can't be installed so just remove it now
           seenFiles.push(stageDirEntry.leafName);
           seenFiles.push(jsonfile.leafName);
           continue;
         }
 
-        if (mustSign(addon.type) &&
-            (addon.signedState <= AddonManager.SIGNEDSTATE_MISSING ||
-            (foreignInstall && addon.signedState < AddonManager.SIGNEDSTATE_SIGNED))) {
+        let addon = aManifests[aLocation.name][id];
+
+        if ((addon.signedState <= AddonManager.SIGNEDSTATE_MISSING) && mustSign(addon.type)) {
           logger.warn("Refusing to install staged add-on " + id + " with signed state " + addon.signedState);
           seenFiles.push(stageDirEntry.leafName);
           seenFiles.push(jsonfile.leafName);
           continue;
         }
 
         // Check for a cached metadata for this add-on, it may contain updated
         // compatibility information
-        if (!foreignInstall) {
+        if (jsonfile.exists()) {
           logger.debug("Found updated metadata for " + id + " in " + aLocation.name);
           let fis = Cc["@mozilla.org/network/file-input-stream;1"].
                        createInstance(Ci.nsIFileInputStream);
           let json = Cc["@mozilla.org/dom/json;1"].
                      createInstance(Ci.nsIJSON);
 
           try {
             fis.init(jsonfile, -1, 0, 0);
             let metadata = json.decodeFromStream(fis, jsonfile.fileSize);
             addon.importMetadata(metadata);
-
-            // Pass this through to addMetadata so it knows this add-on was
-            // likely installed through the UI
-            aManifests[aLocation.name][id] = addon;
           }
           catch (e) {
             // If some data can't be recovered from the cached metadata then it
             // is unlikely to be a problem big enough to justify throwing away
             // the install, just log and error and continue
             logger.error("Unable to read metadata from " + jsonfile.path, e);
           }
           finally {
@@ -3387,19 +3376,16 @@ this.XPIProvider = {
 
       // Update the AddonInternal properties.
       newAddon._installLocation = aInstallLocation;
       newAddon.visible = !(newAddon.id in visibleAddons);
       newAddon.installDate = aAddonState.mtime;
       newAddon.updateDate = aAddonState.mtime;
       newAddon.foreignInstall = isDetectedInstall;
 
-      // appDisabled depends on whether the add-on is a foreignInstall so update
-      newAddon.appDisabled = !isUsableAddon(newAddon);
-
       if (aMigrateData) {
         // If there is migration data then apply it.
         logger.debug("Migrating data from old database");
 
         DB_MIGRATE_METADATA.forEach(function(aProp) {
           // A theme's disabled state is determined by the selected theme
           // preference which is read in loadManifestFromRDF
           if (aProp == "userDisabled" && newAddon.type == "theme")
--- a/toolkit/mozapps/extensions/test/xpcshell/test_signed_inject.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_signed_inject.js
@@ -4,17 +4,16 @@ Services.prefs.setBoolPref(PREF_XPI_SIGN
 Services.prefs.setBoolPref(PREF_EM_CHECK_UPDATE_SECURITY, false);
 
 const DATA = "data/signing_checks/";
 const ADDONS = {
   bootstrap: {
     unsigned: "unsigned_bootstrap_2.xpi",
     badid: "signed_bootstrap_badid_2.xpi",
     signed: "signed_bootstrap_2.xpi",
-    preliminary: "preliminary_bootstrap_2.xpi",
   },
   nonbootstrap: {
     unsigned: "unsigned_nonbootstrap_2.xpi",
     badid: "signed_nonbootstrap_badid_2.xpi",
     signed: "signed_nonbootstrap_2.xpi",
   }
 };
 const ID = "test@tests.mozilla.org";
@@ -330,50 +329,8 @@ add_task(function*() {
   do_check_eq(getActiveVersion(), -1);
 
   do_check_false(file.exists());
   clearCache(file);
 
   yield promiseShutdownManager();
   resetPrefs();
 });
-
-// Only fully-signed sideloaded add-ons should work
-add_task(function*() {
-  let file = manuallyInstall(do_get_file(DATA + ADDONS.bootstrap.preliminary), profileDir, ID);
-
-  startupManager();
-
-  // Currently we leave the sideloaded add-on there but just don't run it
-  let addon = yield promiseAddonByID(ID);
-  do_check_neq(addon, null);
-  do_check_true(addon.appDisabled);
-  do_check_false(addon.isActive);
-  do_check_eq(addon.signedState, AddonManager.SIGNEDSTATE_PRELIMINARY);
-  do_check_eq(getActiveVersion(), -1);
-
-  addon.uninstall();
-  yield promiseShutdownManager();
-  resetPrefs();
-
-  do_check_false(file.exists());
-  clearCache(file);
-});
-
-add_task(function*() {
-  let stage = profileDir.clone();
-  stage.append("staged");
-
-  let file = manuallyInstall(do_get_file(DATA + ADDONS.bootstrap.preliminary), stage, ID);
-
-  startupManager();
-
-  // Should have refused to install preliminarily signed version
-  let addon = yield promiseAddonByID(ID);
-  do_check_eq(addon, null);
-  do_check_eq(getActiveVersion(), -1);
-
-  do_check_false(file.exists());
-  clearCache(file);
-
-  yield promiseShutdownManager();
-  resetPrefs();
-});