mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Rename DOMRefCell<T> to DomRefCell<T>
I don't want to do such a gratuitous rename, but with all the other types now having "Dom" as part of their name, and especially with "DomOnceCell", I feel like the other cell type that we already have should also follow the convention. That argument loses weight though when we realise there is still DOMString and other things.
This commit is contained in:
parent
9a7ba89c84
commit
577370746e
85 changed files with 436 additions and 436 deletions
|
@ -12,14 +12,14 @@ use style::thread_state;
|
|||
/// This extends the API of `core::cell::RefCell` to allow unsafe access in
|
||||
/// certain situations, with dynamic checking in debug builds.
|
||||
#[derive(Clone, Debug, Default, HeapSizeOf, PartialEq)]
|
||||
pub struct DOMRefCell<T> {
|
||||
pub struct DomRefCell<T> {
|
||||
value: RefCell<T>,
|
||||
}
|
||||
|
||||
// Functionality specific to Servo's `DOMRefCell` type
|
||||
// Functionality specific to Servo's `DomRefCell` type
|
||||
// ===================================================
|
||||
|
||||
impl<T> DOMRefCell<T> {
|
||||
impl<T> DomRefCell<T> {
|
||||
/// Return a reference to the contents.
|
||||
///
|
||||
/// For use in the layout thread only.
|
||||
|
@ -59,10 +59,10 @@ impl<T> DOMRefCell<T> {
|
|||
|
||||
// Functionality duplicated with `core::cell::RefCell`
|
||||
// ===================================================
|
||||
impl<T> DOMRefCell<T> {
|
||||
/// Create a new `DOMRefCell` containing `value`.
|
||||
pub fn new(value: T) -> DOMRefCell<T> {
|
||||
DOMRefCell {
|
||||
impl<T> DomRefCell<T> {
|
||||
/// Create a new `DomRefCell` containing `value`.
|
||||
pub fn new(value: T) -> DomRefCell<T> {
|
||||
DomRefCell {
|
||||
value: RefCell::new(value),
|
||||
}
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ impl<T> DOMRefCell<T> {
|
|||
///
|
||||
/// Panics if the value is currently mutably borrowed.
|
||||
pub fn borrow(&self) -> Ref<T> {
|
||||
self.try_borrow().expect("DOMRefCell<T> already mutably borrowed")
|
||||
self.try_borrow().expect("DomRefCell<T> already mutably borrowed")
|
||||
}
|
||||
|
||||
/// Mutably borrows the wrapped value.
|
||||
|
@ -93,7 +93,7 @@ impl<T> DOMRefCell<T> {
|
|||
///
|
||||
/// Panics if the value is currently borrowed.
|
||||
pub fn borrow_mut(&self) -> RefMut<T> {
|
||||
self.try_borrow_mut().expect("DOMRefCell<T> already borrowed")
|
||||
self.try_borrow_mut().expect("DomRefCell<T> already borrowed")
|
||||
}
|
||||
|
||||
/// Attempts to immutably borrow the wrapped value.
|
||||
|
|
|
@ -38,7 +38,7 @@ use canvas_traits::webgl::{WebGLReceiver, WebGLSender, WebGLShaderId, WebGLTextu
|
|||
use cssparser::RGBA;
|
||||
use devtools_traits::{CSSError, TimelineMarkerType, WorkerId};
|
||||
use dom::abstractworker::SharedRt;
|
||||
use dom::bindings::cell::DOMRefCell;
|
||||
use dom::bindings::cell::DomRefCell;
|
||||
use dom::bindings::error::Error;
|
||||
use dom::bindings::refcounted::{Trusted, TrustedPromise};
|
||||
use dom::bindings::reflector::{DomObject, Reflector};
|
||||
|
@ -202,7 +202,7 @@ unsafe impl<T: JSTraceable> JSTraceable for UnsafeCell<T> {
|
|||
}
|
||||
}
|
||||
|
||||
unsafe impl<T: JSTraceable> JSTraceable for DOMRefCell<T> {
|
||||
unsafe impl<T: JSTraceable> JSTraceable for DomRefCell<T> {
|
||||
unsafe fn trace(&self, trc: *mut JSTracer) {
|
||||
(*self).borrow_for_gc_trace().trace(trc)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue