Bug 835785 - Don't show additional dump names in about:crashes. r=ted
authorGeorg Fritzsche <georg.fritzsche@googlemail.com>
Tue, 29 Jan 2013 14:20:06 +0100
changeset 120857 8eb63dccfe416911fab1fcf6a8467cfa2a6d5cdb
parent 120856 66efdc5f935527a2177f3a7dacebf8c2ec80d9ff
child 120858 4a5f5d0ef1ffe21504b94de496498c4548a9908e
push id22452
push usergeorg.fritzsche@googlemail.com
push dateTue, 05 Feb 2013 10:23:20 +0000
treeherdermozilla-inbound@8eb63dccfe41 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs835785
milestone21.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 835785 - Don't show additional dump names in about:crashes. r=ted
toolkit/crashreporter/content/crashes.js
toolkit/crashreporter/test/browser/head.js
--- a/toolkit/crashreporter/content/crashes.js
+++ b/toolkit/crashreporter/content/crashes.js
@@ -121,23 +121,25 @@ function populateReportList() {
     }
   }
 
   pendingDir = directoryService.get("UAppData", Ci.nsIFile);
   pendingDir.append("Crash Reports");
   pendingDir.append("pending");
 
   if (pendingDir.exists() && pendingDir.isDirectory()) {
+    var uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
     var entries = pendingDir.directoryEntries;
     while (entries.hasMoreElements()) {
       var file = entries.getNext().QueryInterface(Ci.nsIFile);
       var leaf = file.leafName;
-      if (leaf.substr(-4) == ".dmp") {
+      var id = leaf.slice(0, -4);
+      if (leaf.substr(-4) == ".dmp" && uuidRegex.test(id)) {
         var entry = {
-          id: leaf.slice(0, -4),
+          id: id,
           date: file.lastModifiedTime,
           pending: true
         };
         var pos = findInsertionPoint(reports, entry.date);
         reports.splice(pos, 0, entry);
       }
     }
   }
--- a/toolkit/crashreporter/test/browser/head.js
+++ b/toolkit/crashreporter/test/browser/head.js
@@ -107,17 +107,17 @@ function writeDataToFile(file, data) {
 
 function addPendingCrashreport(crD, date, extra) {
   let pendingdir = crD.clone();
   pendingdir.append("pending");
   let uuidGenerator = Cc["@mozilla.org/uuid-generator;1"]
                       .getService(Ci.nsIUUIDGenerator);
   let uuid = uuidGenerator.generateUUID().toString();
   // ditch the {}
-  uuid = uuid.substring(1, uuid.length - 2);
+  uuid = uuid.substring(1, uuid.length - 1);
   let dumpfile = pendingdir.clone();
   dumpfile.append(uuid + ".dmp");
   writeDataToFile(dumpfile, "MDMP"); // that's the start of a valid minidump, anyway
   let extrafile = pendingdir.clone();
   extrafile.append(uuid + ".extra");
   let extradata = "";
   for (let x in extra) {
     extradata += x + "=" + extra[x] + "\n";