From dc721199985feaf94d23af3e7c5ab2a12e15bcbe Mon Sep 17 00:00:00 2001 From: Matthew Rasmus Date: Wed, 7 Jan 2015 19:07:27 -0800 Subject: Fix `non_upper_case_globals` warnings --- components/script/dom/bindings/js.rs | 6 +++--- components/script/dom/bindings/refcounted.rs | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'components/script/dom') diff --git a/components/script/dom/bindings/js.rs b/components/script/dom/bindings/js.rs index a0c099769f0..ac8da0f8ba6 100644 --- a/components/script/dom/bindings/js.rs +++ b/components/script/dom/bindings/js.rs @@ -51,7 +51,7 @@ use dom::node::Node; use js::jsapi::JSObject; use js::jsval::JSVal; use layout_interface::TrustedNodeAddress; -use script_task::StackRoots; +use script_task::STACK_ROOTS; use servo_util::smallvec::{SmallVec, SmallVec16}; use std::cell::{Cell, UnsafeCell}; @@ -101,7 +101,7 @@ impl Temporary { /// Create a stack-bounded root for this value. pub fn root(self) -> Root { - StackRoots.with(|ref collection| { + STACK_ROOTS.with(|ref collection| { let RootCollectionPtr(collection) = collection.get().unwrap(); unsafe { Root::new(&*collection, &self.inner) @@ -164,7 +164,7 @@ impl JS { /// Root this JS-owned value to prevent its collection as garbage. pub fn root(&self) -> Root { - StackRoots.with(|ref collection| { + STACK_ROOTS.with(|ref collection| { let RootCollectionPtr(collection) = collection.get().unwrap(); unsafe { Root::new(&*collection, self) diff --git a/components/script/dom/bindings/refcounted.rs b/components/script/dom/bindings/refcounted.rs index 1f6149394f2..adf7d71fde5 100644 --- a/components/script/dom/bindings/refcounted.rs +++ b/components/script/dom/bindings/refcounted.rs @@ -36,7 +36,7 @@ use std::collections::hash_map::{HashMap, Vacant, Occupied}; use std::rc::Rc; use std::sync::{Arc, Mutex}; -thread_local!(pub static LiveReferences: Rc>> = Rc::new(RefCell::new(None))) +thread_local!(pub static LIVE_REFERENCES: Rc>> = Rc::new(RefCell::new(None))) /// A safe wrapper around a raw pointer to a DOM object that can be @@ -57,7 +57,7 @@ impl Trusted { /// be prevented from being GCed for the duration of the resulting `Trusted` object's /// lifetime. pub fn new(cx: *mut JSContext, ptr: JSRef, script_chan: Box) -> Trusted { - LiveReferences.with(|ref r| { + LIVE_REFERENCES.with(|ref r| { let r = r.borrow(); let live_references = r.as_ref().unwrap(); let refcount = live_references.addref(cx, &*ptr as *const T); @@ -74,7 +74,7 @@ impl Trusted { /// a different thread than the original value from which this `Trusted` was /// obtained. pub fn to_temporary(&self) -> Temporary { - assert!(LiveReferences.with(|ref r| { + assert!(LIVE_REFERENCES.with(|ref r| { let r = r.borrow(); let live_references = r.as_ref().unwrap(); self.owner_thread == (&*live_references) as *const _ as *const libc::c_void @@ -123,7 +123,7 @@ pub struct LiveDOMReferences { impl LiveDOMReferences { /// Set up the task-local data required for storing the outstanding DOM references. pub fn initialize() { - LiveReferences.with(|ref r| { + LIVE_REFERENCES.with(|ref r| { *r.borrow_mut() = Some(LiveDOMReferences { table: RefCell::new(HashMap::new()), }) @@ -152,7 +152,7 @@ impl LiveDOMReferences { /// Unpin the given DOM object if its refcount is 0. pub fn cleanup(cx: *mut JSContext, raw_reflectable: *const libc::c_void) { - LiveReferences.with(|ref r| { + LIVE_REFERENCES.with(|ref r| { let r = r.borrow(); let live_references = r.as_ref().unwrap(); let reflectable = raw_reflectable as *const Reflector; -- cgit v1.2.3