mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
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:
parent
577370746e
commit
f87c2a8d76
291 changed files with 1774 additions and 1770 deletions
|
@ -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()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue