backout f583132674d5 due to failing tests
authorBrad Lassey <blassey@mozilla.com>
Thu, 26 Jan 2012 01:42:38 -0500
changeset 86659 2b74b62701e2f5f636fb1ed447170cf18cbd45e9
parent 86658 38a3bc6cc423b044c7c73b0404f3a109d9511ad2
child 86660 0e7c2ed8e866f87e3c11e9914555434c1e3ffce5
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone12.0a1
backs outf583132674d5ab623bde7aa46c8e6d8db9c721b1
backout f583132674d5 due to failing tests
toolkit/mozapps/extensions/XPIProvider.jsm
--- a/toolkit/mozapps/extensions/XPIProvider.jsm
+++ b/toolkit/mozapps/extensions/XPIProvider.jsm
@@ -195,34 +195,16 @@ var gIDTest = /^(\{[0-9a-f]{8}-[0-9a-f]{
 ["LOG", "WARN", "ERROR"].forEach(function(aName) {
   this.__defineGetter__(aName, function() {
     Components.utils.import("resource://gre/modules/AddonLogging.jsm");
 
     LogManager.getLogger("addons.xpi", this);
     return this[aName];
   })
 }, this);
-  /**
-   * Sets permissions on a file
-   *
-   * @param  aFile
-   *         The file or directory to operate on.
-   * @param  aPermissions
-   *         The permisions to set
-   */
-
-function setFilePermissions(aFile, aPermissions) {
-  try {
-    aFile.permissions = aPermissions;
-  }
-  catch (e) {
-    WARN("Failed to set permissions " + aPermissions.toString(8) + " on " +
-         aFile.path, e);
-  }
-}
 
 /**
  * A safe way to install a file or the contents of a directory to a new
  * directory. The file or directory is moved or copied recursively and if
  * anything fails an attempt is made to rollback the entire operation. The
  * operation may also be rolled back to its original state after it has
  * completed by calling the rollback method.
  *
@@ -292,17 +274,17 @@ SafeInstallOperation.prototype = {
 
     // If this is only a copy operation then there is nothing else to do
     if (aCopy)
       return;
 
     // The directory should be empty by this point. If it isn't this will throw
     // and all of the operations will be rolled back
     try {
-      setPermissions(aDirectory, FileUtils.PERMS_DIRECTORY);
+      aDirectory.permissions = FileUtils.PERMS_DIRECTORY;
       aDirectory.remove(false);
     }
     catch (e) {
       ERROR("Failed to remove directory " + aDirectory.path, e);
       throw e;
     }
 
     // Note we put the directory move in after all the file moves so the
@@ -1098,23 +1080,17 @@ function extractFiles(aZipFile, aDir) {
     entries = zipReader.findEntries(null);
     while (entries.hasMore()) {
       let entryName = entries.getNext();
       let target = getTargetFile(aDir, entryName);
       if (target.exists())
         continue;
 
       zipReader.extract(entryName, target);
-      try {
-        target.permissions |= FileUtils.PERMS_FILE;
-      }
-      catch (e) {
-        WARN("Failed to set permissions " + aPermissions.toString(8) + " on " +
-             target.path, e);
-      }
+      target.permissions |= FileUtils.PERMS_FILE;
     }
   }
   finally {
     zipReader.close();
   }
 }
 
 /**
@@ -1271,34 +1247,34 @@ function cleanStagingDir(aDir, aLeafName
     if (dirEntries.nextFile)
       return;
   }
   finally {
     dirEntries.close();
   }
 
   try {
-    setPermissions(aDir, FileUtils.PERMS_DIRECTORY);
+    aDir.permissions = FileUtils.PERMS_DIRECTORY;
     aDir.remove(false);
   }
   catch (e) {
     WARN("Failed to remove staging dir", e);
     // Failing to remove the staging directory is ignorable
   }
 }
 
 /**
  * Recursively removes a directory or file fixing permissions when necessary.
  *
  * @param  aFile
  *         The nsIFile to remove
  */
 function recursiveRemove(aFile) {
-  setPermissions(aFile, aFile.isDirectory() ? FileUtils.PERMS_DIRECTORY
-                                            : FileUtils.PERMS_FILE);
+  aFile.permissions = aFile.isDirectory() ? FileUtils.PERMS_DIRECTORY
+                                          : FileUtils.PERMS_FILE;
 
   try {
     aFile.remove(true);
     return;
   }
   catch (e) {
     if (!aFile.isDirectory()) {
       ERROR("Failed to remove file " + aFile.path, e);
@@ -8095,21 +8071,17 @@ DirectoryInstallLocation.prototype = {
       }
       catch (e) {
         WARN("Failed to remove trash directory when installing " + aId, e);
       }
     }
 
     let newFile = this._directory.clone().QueryInterface(Ci.nsILocalFile);
     newFile.append(aSource.leafName);
-    try {
-      newFile.lastModifiedTime = Date.now();
-    } catch (e)  {
-      WARN("failed to set lastModifiedTime on " + newFile.path, e);
-    }
+    newFile.lastModifiedTime = Date.now();
     this._FileToIDMap[newFile.path] = aId;
     this._IDToFileMap[aId] = newFile;
 
     if (aExistingAddonID && aExistingAddonID != aId &&
         aExistingAddonID in this._IDToFileMap) {
       delete this._FileToIDMap[this._IDToFileMap[aExistingAddonID]];
       delete this._IDToFileMap[aExistingAddonID];
     }