Rename Root<T> to DomRoot<T>

In a later PR, DomRoot<T> will become a type alias of Root<Dom<T>>,
where Root<T> will be able to handle all the things that need to be
rooted that have a stable traceable address that doesn't move for the
whole lifetime of the root. Stay tuned.
This commit is contained in:
Anthony Ramine 2017-09-26 01:53:40 +02:00
parent 577370746e
commit f87c2a8d76
291 changed files with 1774 additions and 1770 deletions

View file

@ -8,7 +8,7 @@ use core::iter::FromIterator;
use dom::bindings::cell::DomRefCell;
use dom::bindings::codegen::Bindings::WebGLVertexArrayObjectOESBinding;
use dom::bindings::reflector::reflect_dom_object;
use dom::bindings::root::{Dom, MutNullableDom, Root};
use dom::bindings::root::{Dom, DomRoot, MutNullableDom};
use dom::globalscope::GlobalScope;
use dom::webglbuffer::WebGLBuffer;
use dom::webglobject::WebGLObject;
@ -38,7 +38,7 @@ impl WebGLVertexArrayObjectOES {
}
}
pub fn new(global: &GlobalScope, id: WebGLVertexArrayId) -> Root<WebGLVertexArrayObjectOES> {
pub fn new(global: &GlobalScope, id: WebGLVertexArrayId) -> DomRoot<WebGLVertexArrayObjectOES> {
reflect_dom_object(box WebGLVertexArrayObjectOES::new_inherited(id),
global,
WebGLVertexArrayObjectOESBinding::Wrap)
@ -68,15 +68,15 @@ impl WebGLVertexArrayObjectOES {
self.bound_attrib_buffers.borrow()
}
pub fn bound_attrib_buffers(&self) -> Vec<Root<WebGLBuffer>> {
self.bound_attrib_buffers.borrow().iter().map(|(_, b)| Root::from_ref(&**b)).collect()
pub fn bound_attrib_buffers(&self) -> Vec<DomRoot<WebGLBuffer>> {
self.bound_attrib_buffers.borrow().iter().map(|(_, b)| DomRoot::from_ref(&**b)).collect()
}
pub fn set_bound_attrib_buffers<'a, T>(&self, iter: T) where T: Iterator<Item=(u32, &'a WebGLBuffer)> {
*self.bound_attrib_buffers.borrow_mut() = HashMap::from_iter(iter.map(|(k,v)| (k, Dom::from_ref(v))));
}
pub fn bound_buffer_element_array(&self) -> Option<Root<WebGLBuffer>> {
pub fn bound_buffer_element_array(&self) -> Option<DomRoot<WebGLBuffer>> {
self.bound_buffer_element_array.get()
}