From bf22a473fa968854e5c9ca3aacf65501a15f8e68 Mon Sep 17 00:00:00 2001 From: Tetsuharu OHZEKI Date: Tue, 21 Oct 2014 02:20:28 +0900 Subject: [PATCH] Use DOMRefCell for TimerManager. --- components/script/timers.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/components/script/timers.rs b/components/script/timers.rs index d6fe8cb206c..ba9141aebd1 100644 --- a/components/script/timers.rs +++ b/components/script/timers.rs @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use dom::bindings::cell::DOMRefCell; + use script_task::{FireTimerMsg, ScriptChan}; use script_task::{TimerSource, FromWindow, FromWorker}; @@ -12,7 +14,7 @@ use js::jsapi::{JSContext, JSObject}; use js::jsval::{JSVal, NullValue}; use js::rust::with_compartment; -use std::cell::{Cell, RefCell}; +use std::cell::Cell; use std::cmp; use std::collections::hashmap::HashMap; use std::comm::{channel, Sender}; @@ -50,7 +52,7 @@ impl TimerHandle { #[jstraceable] #[privatize] pub struct TimerManager { - active_timers: RefCell>, + active_timers: DOMRefCell>, next_timer_handle: Cell, } @@ -77,7 +79,7 @@ struct TimerData { impl TimerManager { pub fn new() -> TimerManager { TimerManager { - active_timers: RefCell::new(HashMap::new()), + active_timers: DOMRefCell::new(HashMap::new()), next_timer_handle: Cell::new(0) } }