Skip to content

Commit

Permalink
Bug 1346426 Don't crash if a window is frozen while there is a dummy …
Browse files Browse the repository at this point in the history
…timer in the list. r=ehsan
  • Loading branch information
wanderview committed Mar 13, 2017
1 parent 004811f commit ded5d4f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dom/base/TimeoutManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1198,8 +1198,16 @@ TimeoutManager::Freeze()
MOZ_LOG(gLog, LogLevel::Debug,
("Freeze(TimeoutManager=%p)\n", this));

DebugOnly<bool> _seenDummyTimeout = false;

TimeStamp now = TimeStamp::Now();
ForEachUnorderedTimeout([&](Timeout* aTimeout) {
if (!aTimeout->mWindow) {
NS_ASSERTION(!_seenDummyTimeout, "More than one dummy timeout?!");
_seenDummyTimeout = true;
return;
}

// Save the current remaining time for this timeout. We will
// re-apply it when the window is Thaw()'d. This effectively
// shifts timers to the right as if time does not pass while
Expand Down

0 comments on commit ded5d4f

Please sign in to comment.