mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +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
|
@ -6,7 +6,7 @@ use dom::bindings::codegen::Bindings::NavigatorBinding;
|
|||
use dom::bindings::codegen::Bindings::NavigatorBinding::NavigatorMethods;
|
||||
use dom::bindings::codegen::Bindings::VRBinding::VRBinding::VRMethods;
|
||||
use dom::bindings::reflector::{Reflector, DomObject, reflect_dom_object};
|
||||
use dom::bindings::root::{MutNullableDom, Root};
|
||||
use dom::bindings::root::{DomRoot, MutNullableDom};
|
||||
use dom::bindings::str::DOMString;
|
||||
use dom::bluetooth::Bluetooth;
|
||||
use dom::gamepadlist::GamepadList;
|
||||
|
@ -47,7 +47,7 @@ impl Navigator {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn new(window: &Window) -> Root<Navigator> {
|
||||
pub fn new(window: &Window) -> DomRoot<Navigator> {
|
||||
reflect_dom_object(box Navigator::new_inherited(),
|
||||
window,
|
||||
NavigatorBinding::Wrap)
|
||||
|
@ -91,7 +91,7 @@ impl NavigatorMethods for Navigator {
|
|||
}
|
||||
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-navigator-bluetooth
|
||||
fn Bluetooth(&self) -> Root<Bluetooth> {
|
||||
fn Bluetooth(&self) -> DomRoot<Bluetooth> {
|
||||
self.bluetooth.or_init(|| Bluetooth::new(&self.global()))
|
||||
}
|
||||
|
||||
|
@ -101,12 +101,12 @@ impl NavigatorMethods for Navigator {
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-navigator-plugins
|
||||
fn Plugins(&self) -> Root<PluginArray> {
|
||||
fn Plugins(&self) -> DomRoot<PluginArray> {
|
||||
self.plugins.or_init(|| PluginArray::new(&self.global()))
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-navigator-mimetypes
|
||||
fn MimeTypes(&self) -> Root<MimeTypeArray> {
|
||||
fn MimeTypes(&self) -> DomRoot<MimeTypeArray> {
|
||||
self.mime_types.or_init(|| MimeTypeArray::new(&self.global()))
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,7 @@ impl NavigatorMethods for Navigator {
|
|||
}
|
||||
|
||||
// https://w3c.github.io/ServiceWorker/#navigator-service-worker-attribute
|
||||
fn ServiceWorker(&self) -> Root<ServiceWorkerContainer> {
|
||||
fn ServiceWorker(&self) -> DomRoot<ServiceWorkerContainer> {
|
||||
self.service_worker.or_init(|| {
|
||||
ServiceWorkerContainer::new(&self.global())
|
||||
})
|
||||
|
@ -128,7 +128,7 @@ impl NavigatorMethods for Navigator {
|
|||
}
|
||||
|
||||
// https://www.w3.org/TR/gamepad/#navigator-interface-extension
|
||||
fn GetGamepads(&self) -> Root<GamepadList> {
|
||||
fn GetGamepads(&self) -> DomRoot<GamepadList> {
|
||||
let root = self.gamepads.or_init(|| {
|
||||
GamepadList::new(&self.global(), &[])
|
||||
});
|
||||
|
@ -139,7 +139,7 @@ impl NavigatorMethods for Navigator {
|
|||
root
|
||||
}
|
||||
// https://w3c.github.io/permissions/#navigator-and-workernavigator-extension
|
||||
fn Permissions(&self) -> Root<Permissions> {
|
||||
fn Permissions(&self) -> DomRoot<Permissions> {
|
||||
self.permissions.or_init(|| Permissions::new(&self.global()))
|
||||
}
|
||||
|
||||
|
@ -151,7 +151,7 @@ impl NavigatorMethods for Navigator {
|
|||
}
|
||||
|
||||
impl Navigator {
|
||||
pub fn Vr(&self) -> Root<VR> {
|
||||
pub fn Vr(&self) -> DomRoot<VR> {
|
||||
self.vr.or_init(|| VR::new(&self.global()))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue