function processMemoryReporters(aMgr, aIgnoreSingle, aIgnoreMulti,
                                aHandleReport)
{
  // Process each memory reporter with aHandleReport.
  //
  // - Note that copying rOrig.amount (which calls a C++ function under the
  //   IDL covers) to r._amount for every reporter now means that the
  //   results as consistent as possible -- measurements are made all at
  //   once before most of the memory required to generate this page is
  //   allocated.
  //
  // - After this point we never use the original memory report again.

  function handleReport(aProcess, aUnsafePath, aKind, aUnits, aAmount,
                        aDescription)
  {
    checkReport(aUnsafePath, aKind, aUnits, aAmount, aDescription);
    aHandleReport(aProcess, aUnsafePath, aKind, aUnits, aAmount, aDescription);
  }

  let e = aMgr.enumerateReporters();
  while (e.hasMoreElements()) {
    let rOrig = e.getNext().QueryInterface(Ci.nsIMemoryReporter);
    let unsafePath;
    try {
      unsafePath = rOrig.path;
      if (!aIgnoreSingle(unsafePath)) {
        handleReport(rOrig.process, unsafePath, rOrig.kind, rOrig.units, 
                     rOrig.amount, rOrig.description);
      }
    }
    catch (ex) {
      debug("Exception thrown by memory reporter: " + unsafePath + ": " + ex);
    }
  }

  let e = aMgr.enumerateMultiReporters();
  while (e.hasMoreElements()) {
    let mr = e.getNext().QueryInterface(Ci.nsIMemoryMultiReporter);
    let name = mr.name;
    try {
      if (!aIgnoreMulti(name)) {
        mr.collectReports(handleReport, null);
      }
    }
    catch (ex) {
      // There are two exception cases that must be distinguished here.
      //
      // - We want to halt proceedings on exceptions thrown within this file
      //   (i.e. assertion failures in handleReport);  such exceptions contain
      //   gAssertionFailureMsgPrefix in their string representation.
      //
      // - We want to continue on when faced with exceptions thrown outside
      //   this file (i.e. when measuring an amount in collectReports).
      let str = ex.toString();
      if (str.search(gAssertionFailureMsgPrefix) >= 0) {
        throw(ex); 
      } else {
        debug("Exception thrown within memory multi-reporter: " + name + ": " +
              ex);
      }
    }
  }
}
/**
 * Iterates over each reporter and multi-reporter.
 *
 * @param aMgr
 *        The memory reporter manager.
 * @param aIgnoreSingle
 *        Function that indicates if we should skip a single reporter, based
 *        on its path.
 * @param aIgnoreMulti
 *        Function that indicates if we should skip a multi-reporter, based on
 *        its name.
 * @param aHandleReport
 *        The function that's called for each report.
 */
Iterates over each reporter and multi-reporter.
@param aMgr
The memory reporter manager.
@param aIgnoreSingle
Function that indicates if we should skip a single reporter, based
on its path.
@param aIgnoreMulti
Function that indicates if we should skip a multi-reporter, based on
its name.
@param aHandleReport
The function that's called for each report.
Iterates over each reporter and multi - reporter . @param aMgr The memory reporter manager . @param aIgnoreSingle Function that indicates if we should skip a single reporter based on its path . @param aIgnoreMulti Function that indicates if we should skip a multi - reporter based on its name . @param aHandleReport The function that ' s called for each report .
function processMemoryReporters(aMgr, aIgnoreSingle, aIgnoreMulti,
                                aHandleReport)
{
   - Note that copying rOrig.amount (which calls a C++ function under the
     IDL covers) to r._amount for every reporter now means that the
     results as consistent as possible -- measurements are made all at
     once before most of the memory required to generate this page is
     allocated.
   - After this point we never use the original memory report again.
  function handleReport(aProcess, aUnsafePath, aKind, aUnits, aAmount,
                        aDescription)
  {
    checkReport(aUnsafePath, aKind, aUnits, aAmount, aDescription);
    aHandleReport(aProcess, aUnsafePath, aKind, aUnits, aAmount, aDescription);
  }
  let e = aMgr.enumerateReporters();
  while (e.hasMoreElements()) {
    let rOrig = e.getNext().QueryInterface(Ci.nsIMemoryReporter);
    let unsafePath;
    try {
      unsafePath = rOrig.path;
      if (!aIgnoreSingle(unsafePath)) {
        handleReport(rOrig.process, unsafePath, rOrig.kind, rOrig.units, 
                     rOrig.amount, rOrig.description);
      }
    }
    catch (ex) {
      debug("Exception thrown by memory reporter: " + unsafePath + ": " + ex);
    }
  }
  let e = aMgr.enumerateMultiReporters();
  while (e.hasMoreElements()) {
    let mr = e.getNext().QueryInterface(Ci.nsIMemoryMultiReporter);
    let name = mr.name;
    try {
      if (!aIgnoreMulti(name)) {
        mr.collectReports(handleReport, null);
      }
    }
    catch (ex) {
       There are two exception cases that must be distinguished here.
       - We want to halt proceedings on exceptions thrown within this file
         (i.e. assertion failures in handleReport);  such exceptions contain
         gAssertionFailureMsgPrefix in their string representation.
       - We want to continue on when faced with exceptions thrown outside
         this file (i.e. when measuring an amount in collectReports).
      let str = ex.toString();
      if (str.search(gAssertionFailureMsgPrefix) >= 0) {
        throw(ex); 
      } else {
        debug("Exception thrown within memory multi-reporter: " + name + ": " +
              ex);
      }
    }
  }
}
function processMemoryReporters ( aMgr , aIgnoreSingle , aIgnoreMulti , aHandleReport ) { function handleReport ( aProcess , aUnsafePath , aKind , aUnits , aAmount , aDescription ) { checkReport ( aUnsafePath , aKind , aUnits , aAmount , aDescription ) ; aHandleReport ( aProcess , aUnsafePath , aKind , aUnits , aAmount , aDescription ) ; } let e = aMgr . enumerateReporters ( ) ; while ( e . hasMoreElements ( ) ) { let rOrig = e . getNext ( ) . QueryInterface ( Ci . nsIMemoryReporter ) ; let unsafePath ; try { unsafePath = rOrig . path ; if ( ! aIgnoreSingle ( unsafePath ) ) { handleReport ( rOrig . process , unsafePath , rOrig . kind , rOrig . units , rOrig . amount , rOrig . description ) ; } } catch ( ex ) { debug ( "Exception thrown by memory reporter: " + unsafePath + ": " + ex ) ; } } let e = aMgr . enumerateMultiReporters ( ) ; while ( e . hasMoreElements ( ) ) { let mr = e . getNext ( ) . QueryInterface ( Ci . nsIMemoryMultiReporter ) ; let name = mr . name ; try { if ( ! aIgnoreMulti ( name ) ) { mr . collectReports ( handleReport , null ) ; } } catch ( ex ) { let str = ex . toString ( ) ; if ( str . search ( gAssertionFailureMsgPrefix ) >= 0 ) { throw ( ex ) ; } else { debug ( "Exception thrown within memory multi-reporter: " + name + ": " + ex ) ; } } } }
Iterates over each reporter and multi-reporter.
Iterates over each reporter and multi - reporter .
// Process each memory reporter with aHandleReport. // // - Note that copying rOrig.amount (which calls a C++ function under the //   IDL covers) to r._amount for every reporter now means that the //   results as consistent as possible -- measurements are made all at //   once before most of the memory required to generate this page is //   allocated. // // - After this point we never use the original memory report again. // There are two exception cases that must be distinguished here. // // - We want to halt proceedings on exceptions thrown within this file //   (i.e. assertion failures in handleReport);  such exceptions contain //   gAssertionFailureMsgPrefix in their string representation. // // - We want to continue on when faced with exceptions thrown outside //   this file (i.e. when measuring an amount in collectReports).