mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Fix non_upper_case_globals
warnings
This commit is contained in:
parent
01d4739d16
commit
dc72119998
6 changed files with 21 additions and 21 deletions
|
@ -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<T: Reflectable> Temporary<T> {
|
|||
|
||||
/// Create a stack-bounded root for this value.
|
||||
pub fn root(self) -> Root<T> {
|
||||
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<T: Reflectable> JS<T> {
|
|||
|
||||
/// Root this JS-owned value to prevent its collection as garbage.
|
||||
pub fn root(&self) -> Root<T> {
|
||||
StackRoots.with(|ref collection| {
|
||||
STACK_ROOTS.with(|ref collection| {
|
||||
let RootCollectionPtr(collection) = collection.get().unwrap();
|
||||
unsafe {
|
||||
Root::new(&*collection, self)
|
||||
|
|
|
@ -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<RefCell<Option<LiveDOMReferences>>> = Rc::new(RefCell::new(None)))
|
||||
thread_local!(pub static LIVE_REFERENCES: Rc<RefCell<Option<LiveDOMReferences>>> = Rc::new(RefCell::new(None)))
|
||||
|
||||
|
||||
/// A safe wrapper around a raw pointer to a DOM object that can be
|
||||
|
@ -57,7 +57,7 @@ impl<T: Reflectable> Trusted<T> {
|
|||
/// be prevented from being GCed for the duration of the resulting `Trusted<T>` object's
|
||||
/// lifetime.
|
||||
pub fn new(cx: *mut JSContext, ptr: JSRef<T>, script_chan: Box<ScriptChan + Send>) -> Trusted<T> {
|
||||
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<T: Reflectable> Trusted<T> {
|
|||
/// a different thread than the original value from which this `Trusted<T>` was
|
||||
/// obtained.
|
||||
pub fn to_temporary(&self) -> Temporary<T> {
|
||||
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue