Bug 874425 - Ensure that durationMs >= 0. r=yoric, a=test-only
authorDavid Rajchenbach-Teller <dteller@mozilla.com>
Fri, 30 Aug 2013 08:15:13 -0400
changeset 153927 eb53fd0e98d86f9c9b78025c25b7bdaa036926df
parent 153926 46b849a31a67852b112c718a3eb8694a1eaeb3b2
child 153928 5e3da059fa07ae5f5d20497f1d0cdddbf931c8a6
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersyoric, test-only
bugs874425
milestone25.0a2
Bug 874425 - Ensure that durationMs >= 0. r=yoric, a=test-only
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
@@ -161,19 +161,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 {