B2G/gecko/dom/network/src/NetworkStatsDB.jsm
/*
   * Fill data array (samples from database) with empty samples to match
   * requested start / end dates.
   */
Fill data array (samples from database) with empty samples to match
requested start / end dates.
Fill data array ( samples from database ) with empty samples to match requested start / end dates .
function fillResultSamples(aStart, aEnd, aData) {
    if (aData.length == 0) {
      aData.push({ rxBytes: undefined,
                  txBytes: undefined,
                  date: new Date(aStart) });
    }
    while (aStart < aData[0].date.getTime()) {
      aData.unshift({ rxBytes: undefined,
                      txBytes: undefined,
                      date: new Date(aData[0].date.getTime() - SAMPLE_RATE) });
    }
    while (aEnd > aData[aData.length - 1].date.getTime()) {
      aData.push({ rxBytes: undefined,
                   txBytes: undefined,
                   date: new Date(aData[aData.length - 1].date.getTime() + SAMPLE_RATE) });
    }
  }
function fillResultSamples ( aStart , aEnd , aData ) { if ( aData . length == 0 ) { aData . push ( { rxBytes : undefined , txBytes : undefined , date : new Date ( aStart ) } ) ; } while ( aStart < aData [ 0 ] . date . getTime ( ) ) { aData . unshift ( { rxBytes : undefined , txBytes : undefined , date : new Date ( aData [ 0 ] . date . getTime ( ) - SAMPLE_RATE ) } ) ; } while ( aEnd > aData [ aData . length - 1 ] . date . getTime ( ) ) { aData . push ( { rxBytes : undefined , txBytes : undefined , date : new Date ( aData [ aData . length - 1 ] . date . getTime ( ) + SAMPLE_RATE ) } ) ; } }
Fill data array (samples from database) with empty samples to match
 requested start / end dates.
Fill data array ( samples from database ) with empty samples to match requested start / end dates .