Bug 945973 - Part 1: Remove about:memory's is-a-sentence description check. r=mccr8, a=lsblakk
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 02 Jan 2014 14:30:23 -0800
changeset 167835 ee9621b18745e40ab6f1b65589e553ee63e4c53d
parent 167834 2e786892906efa30fa6f6fa175b839aaf33c480c
child 167836 4f51977e2f71c505461e747429b1280cda05a787
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8, lsblakk
bugs945973
milestone27.0
Bug 945973 - Part 1: Remove about:memory's is-a-sentence description check. r=mccr8, a=lsblakk
toolkit/components/aboutmemory/content/aboutMemory.js
--- a/toolkit/components/aboutmemory/content/aboutMemory.js
+++ b/toolkit/components/aboutmemory/content/aboutMemory.js
@@ -466,18 +466,16 @@ function updateAboutMemoryFromReporters(
 
   } catch (ex) {
     handleException(ex);
   }
 }
 
 // Increment this if the JSON format changes.
 //
-// If/when this changes to 2, the beLenient() function and its use can be
-// removed.
 var gCurrentFileFormatVersion = 1;
 
 /**
  * Populate about:memory using the data in the given JSON object.
  *
  * @param aObj
  *        An object containing JSON data that (hopefully!) conforms to the
  *        schema used by nsIMemoryInfoDumper.
@@ -912,55 +910,23 @@ function appendAboutMemoryMain(aProcessR
  *        Function that extracts the memory reports from the reporters or from
  *        file.
  * @return The table of PColls by process.
  */
 function getPCollsByProcess(aProcessReports)
 {
   let pcollsByProcess = {};
 
-  // This regexp matches sentences and sentence fragments, i.e. strings that
-  // start with a capital letter and ends with a '.'.  (The final sentence may
-  // be in parentheses, so a ')' might appear after the '.'.)
-  const gSentenceRegExp = /^[A-Z].*\.\)?$/m;
-
   function handleReport(aProcess, aUnsafePath, aKind, aUnits, aAmount,
                         aDescription, aPresence)
   {
     if (aUnsafePath.startsWith("explicit/")) {
       assertInput(aKind === KIND_HEAP || aKind === KIND_NONHEAP,
                   "bad explicit kind");
       assertInput(aUnits === UNITS_BYTES, "bad explicit units");
-      assertInput(gSentenceRegExp.test(aDescription),
-                  "non-sentence explicit description");
-
-    } else {
-      const kLenientPrefixes =
-        ['rss/', 'pss/', 'size/', 'swap/', 'compartments/', 'ghost-windows/'];
-      let beLenient = function(aUnsafePath) {
-        for (let i = 0; i < kLenientPrefixes.length; i++) {
-          if (aUnsafePath.startsWith(kLenientPrefixes[i])) {
-            return true;
-          }
-        }
-        return false;
-      }
-
-      // In general, non-explicit reports should have a description that is a
-      // complete sentence.  However, we want to be able to read old saved
-      // reports, so we are lenient in a couple of situations where we used to
-      // allow non-sentence descriptions:
-      // - smaps reports (which were removed in bug 912165);
-      // - compartment and ghost-window reports (which had empty descriptions
-      //   prior to bug 911641).
-      if (!beLenient(aUnsafePath)) {
-        assertInput(gSentenceRegExp.test(aDescription),
-                    "non-sentence other description: " + aUnsafePath + ", " +
-                    aDescription);
-      }
     }
 
     assert(aPresence === undefined ||
            aPresence == DReport.PRESENT_IN_FIRST_ONLY ||
            aPresence == DReport.PRESENT_IN_SECOND_ONLY,
            "bad presence");
 
     let process = aProcess === "" ? gUnnamedProcessStr : aProcess;