Bug 874425 - Ensure that durationMs >= 0. r=yoric
authorDavid Rajchenbach-Teller <dteller@mozilla.com>
Fri, 30 Aug 2013 08:15:13 -0400
changeset 145074 f6d60cfe074c988ca4f602fc4a4885f26984e95e
parent 145073 c284d2d00b527861a27b4e9bd2a4cf9674d4a267
child 145075 8a46d34be0947cd0fafb2628e1dbe2a301535a0e
push id33151
push userryanvm@gmail.com
push dateFri, 30 Aug 2013 12:15:55 +0000
treeherdermozilla-inbound@f6d60cfe074c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersyoric
bugs874425
milestone26.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 874425 - Ensure that durationMs >= 0. r=yoric
toolkit/components/osfile/modules/osfile_async_front.jsm
--- a/toolkit/components/osfile/modules/osfile_async_front.jsm
+++ b/toolkit/components/osfile/modules/osfile_async_front.jsm
@@ -162,19 +162,19 @@ let Scheduler = {
         }
         // Bug 874425 demonstrates that two successive calls to Date.now()
         // can actually produce an interval with negative duration.
         // We assume that this is due to an operation that is so short
         // that Date.now() is not monotonic, so we round this up to 0.
         let durationMs = Math.max(0, data.durationMs);
         // Accumulate (or initialize) outExecutionDuration
         if (typeof options.outExecutionDuration == "number") {
-          options.outExecutionDuration += data.durationMs;
+          options.outExecutionDuration += durationMs;
         } else {
-          options.outExecutionDuration = data.durationMs;
+          options.outExecutionDuration = durationMs;
         }
         return data.ok;
       },
       function onError(error) {
         // Decode any serialized error
         if (error instanceof PromiseWorker.WorkerError) {
           throw OS.File.Error.fromMsg(error.data);
         } else {