diff options
author | Tetsuharu OHZEKI <saneyuki.snyk@gmail.com> | 2014-10-21 02:22:38 +0900 |
---|---|---|
committer | Tetsuharu OHZEKI <saneyuki.snyk@gmail.com> | 2014-10-22 10:01:01 +0900 |
commit | 072bb5b9650c27aa9d39ad0ec38bb64be6964202 (patch) | |
tree | 64fd8b0d833260ed7af63f4e42b89a976f2b9915 | |
parent | bf22a473fa968854e5c9ca3aacf65501a15f8e68 (diff) | |
download | servo-072bb5b9650c27aa9d39ad0ec38bb64be6964202.tar.gz servo-072bb5b9650c27aa9d39ad0ec38bb64be6964202.zip |
Use DOMRefCell for ScriptTask.
-rw-r--r-- | components/script/script_task.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/components/script/script_task.rs b/components/script/script_task.rs index 214d666d636..2ea31959e05 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -5,6 +5,7 @@ //! The script task is the task that owns the DOM in memory, runs JavaScript, and spawns parsing //! and layout tasks. +use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods; use dom::bindings::codegen::Bindings::DOMRectBinding::DOMRectMethods; use dom::bindings::codegen::Bindings::ElementBinding::ElementMethods; @@ -64,7 +65,6 @@ use url::Url; use libc::size_t; use std::any::{Any, AnyRefExt}; -use std::cell::RefCell; use std::collections::HashSet; use std::comm::{channel, Sender, Receiver, Select}; use std::mem::replace; @@ -143,7 +143,7 @@ impl Drop for StackRootTLS { /// FIXME: Rename to `Page`, following WebKit? pub struct ScriptTask { /// A handle to the information pertaining to page layout - page: RefCell<Rc<Page>>, + page: DOMRefCell<Rc<Page>>, /// A handle to the image cache task. image_cache_task: ImageCacheTask, /// A handle to the resource task. @@ -176,9 +176,9 @@ pub struct ScriptTask { /// The JavaScript runtime. js_runtime: js::rust::rt, /// The JSContext. - js_context: RefCell<Option<Rc<Cx>>>, + js_context: DOMRefCell<Option<Rc<Cx>>>, - mouse_over_targets: RefCell<Option<Vec<JS<Node>>>> + mouse_over_targets: DOMRefCell<Option<Vec<JS<Node>>>> } /// In the event of task failure, all data on the stack runs its destructor. However, there @@ -327,7 +327,7 @@ impl ScriptTask { }); ScriptTask { - page: RefCell::new(Rc::new(page)), + page: DOMRefCell::new(Rc::new(page)), image_cache_task: img_cache_task, resource_task: resource_task, @@ -342,8 +342,8 @@ impl ScriptTask { devtools_port: devtools_receiver, js_runtime: js_runtime, - js_context: RefCell::new(Some(js_context)), - mouse_over_targets: RefCell::new(None) + js_context: DOMRefCell::new(Some(js_context)), + mouse_over_targets: DOMRefCell::new(None) } } |