diff options
author | Alan Jeffrey <ajeffrey@mozilla.com> | 2017-01-04 13:56:14 +0000 |
---|---|---|
committer | Alan Jeffrey <ajeffrey@mozilla.com> | 2017-01-04 13:56:14 +0000 |
commit | 67bf23016e48f6aab7c3c5556a86226783a8c55d (patch) | |
tree | d21e21854c52bfffa388561218c8558dce869519 /components/script/timers.rs | |
parent | 78c87ea8d7bf6cbc2e2a8ea8a27e764222baf43d (diff) | |
download | servo-67bf23016e48f6aab7c3c5556a86226783a8c55d.tar.gz servo-67bf23016e48f6aab7c3c5556a86226783a8c55d.zip |
Added warnings for idempotent freeze/thaw.
Diffstat (limited to 'components/script/timers.rs')
-rw-r--r-- | components/script/timers.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/components/script/timers.rs b/components/script/timers.rs index 75e044421ea..b86bdc17aae 100644 --- a/components/script/timers.rs +++ b/components/script/timers.rs @@ -229,7 +229,9 @@ impl OneshotTimers { pub fn suspend(&self) { // Suspend is idempotent: do nothing if the timers are already suspended. - if self.suspended_since.get().is_some() { return; } + if self.suspended_since.get().is_some() { + return warn!("Suspending an already suspended timer."); + } self.suspended_since.set(Some(precise_time_ms())); self.invalidate_expected_event_id(); @@ -239,7 +241,7 @@ impl OneshotTimers { // Suspend is idempotent: do nothing if the timers are already suspended. let additional_offset = match self.suspended_since.get() { Some(suspended_since) => precise_time_ms() - suspended_since, - None => return, + None => return warn!("Resuming an already resumed timer."), }; self.suspension_offset.set(self.suspension_offset.get() + additional_offset); |