Bug 714717 - Part 1, Sanity check nextWaitTime. r=MikeK
authorKan-Ru Chen <kanru@kanru.info>
Wed, 11 Jan 2012 15:38:00 +0100
changeset 85508 e44700517c2d414f416f6cab6f84fdffe9cddb67
parent 85507 b4d322e5af4744b0153a647efbdf4e7a83aa0ae2
child 85509 751ce658ce7397c9a2dedf5e6e84ac7877b28a0b
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMikeK
bugs714717
milestone12.0a1
Bug 714717 - Part 1, Sanity check nextWaitTime. r=MikeK
widget/xpwidgets/nsIdleService.cpp
--- a/widget/xpwidgets/nsIdleService.cpp
+++ b/widget/xpwidgets/nsIdleService.cpp
@@ -408,17 +408,19 @@ nsIdleService::CheckAwayState(bool aNoTi
 
     // Remember if anyone becomes idle (it's safe to do this as a binary compare
     // as we are or'ing).
     anyOneIdle |= curListener.isIdle;
   }
 
   // In order to find when the next idle event should time out, we need to
   // subtract the time we should wait, from the time that has already passed.
-  nextWaitTime -= idleTime;
+  if (PR_UINT32_MAX != nextWaitTime) {
+    nextWaitTime -= idleTime;
+  }
 
   // Notify all listeners that just timed out.
   for (PRInt32 i = 0; i < notifyList.Count(); i++) {
     notifyList[i]->Observe(this, OBSERVER_TOPIC_IDLE, timeStr.get());
   }
 
   // If we are in poll mode, we need to poll for activity if anyone are idle,
   // otherwise we can wait polling until they would expire.