diff options
Diffstat (limited to 'components/script/dom/bindings/cell.rs')
-rw-r--r-- | components/script/dom/bindings/cell.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/components/script/dom/bindings/cell.rs b/components/script/dom/bindings/cell.rs index 50093457397..37143165a7d 100644 --- a/components/script/dom/bindings/cell.rs +++ b/components/script/dom/bindings/cell.rs @@ -7,8 +7,8 @@ use dom::bindings::trace::JSTraceable; use js::jsapi::JSTracer; use std::cell::{BorrowState, Ref, RefCell, RefMut}; -use util::task_state; -use util::task_state::SCRIPT; +use util::thread_state; +use util::thread_state::SCRIPT; /// A mutable field in the DOM. /// @@ -25,10 +25,10 @@ pub struct DOMRefCell<T> { impl<T> DOMRefCell<T> { /// Return a reference to the contents. /// - /// For use in the layout task only. + /// For use in the layout thread only. #[allow(unsafe_code)] pub unsafe fn borrow_for_layout(&self) -> &T { - debug_assert!(task_state::get().is_layout()); + debug_assert!(thread_state::get().is_layout()); &*self.value.as_unsafe_cell().get() } @@ -40,7 +40,7 @@ impl<T> DOMRefCell<T> { pub unsafe fn borrow_for_gc_trace(&self) -> &T { // FIXME: IN_GC isn't reliable enough - doesn't catch minor GCs // https://github.com/servo/servo/issues/6389 - // debug_assert!(task_state::get().contains(SCRIPT | IN_GC)); + // debug_assert!(thread_state::get().contains(SCRIPT | IN_GC)); &*self.value.as_unsafe_cell().get() } @@ -48,7 +48,7 @@ impl<T> DOMRefCell<T> { /// #[allow(unsafe_code)] pub unsafe fn borrow_for_script_deallocation(&self) -> &mut T { - debug_assert!(task_state::get().contains(SCRIPT)); + debug_assert!(thread_state::get().contains(SCRIPT)); &mut *self.value.as_unsafe_cell().get() } @@ -70,7 +70,7 @@ impl<T> DOMRefCell<T> { /// /// Panics if this is called off the script thread. pub fn try_borrow(&self) -> Option<Ref<T>> { - debug_assert!(task_state::get().is_script()); + debug_assert!(thread_state::get().is_script()); match self.value.borrow_state() { BorrowState::Writing => None, _ => Some(self.value.borrow()), @@ -88,17 +88,17 @@ impl<T> DOMRefCell<T> { /// /// Panics if this is called off the script thread. pub fn try_borrow_mut(&self) -> Option<RefMut<T>> { - debug_assert!(task_state::get().is_script()); + debug_assert!(thread_state::get().is_script()); match self.value.borrow_state() { BorrowState::Unused => Some(self.value.borrow_mut()), _ => None, } } - /// Version of the above that we use during restyle while the script task + /// Version of the above that we use during restyle while the script thread /// is blocked. pub fn borrow_mut_for_layout(&self) -> RefMut<T> { - debug_assert!(task_state::get().is_layout()); + debug_assert!(thread_state::get().is_layout()); self.value.borrow_mut() } } |