diff options
author | Chad Kimes <ckimes89@gmail.com> | 2016-01-10 22:46:38 -0500 |
---|---|---|
committer | Chad Kimes <ckimes89@gmail.com> | 2016-01-10 22:46:38 -0500 |
commit | 2703568227e9957f3e1d44c3a03646675a285bc3 (patch) | |
tree | fada00c7034b6db8419e4f1a1bb9792db61ced75 | |
parent | efaf4cdecad2202b8994d77fb46113e889c19968 (diff) | |
download | servo-2703568227e9957f3e1d44c3a03646675a285bc3.tar.gz servo-2703568227e9957f3e1d44c3a03646675a285bc3.zip |
Remove unused enum GlobalField
-rw-r--r-- | components/script/dom/bindings/global.rs | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/components/script/dom/bindings/global.rs b/components/script/dom/bindings/global.rs index 8e455d29f28..2ac927066b6 100644 --- a/components/script/dom/bindings/global.rs +++ b/components/script/dom/bindings/global.rs @@ -44,17 +44,6 @@ pub enum GlobalRoot { Worker(Root<WorkerGlobalScope>), } -/// A traced reference to a global object, for use in fields of traced Rust -/// structures. -#[derive(JSTraceable, HeapSizeOf)] -#[must_root] -pub enum GlobalField { - /// A field for a `Window` object. - Window(JS<window::Window>), - /// A field for a `WorkerGlobalScope` object. - Worker(JS<WorkerGlobalScope>), -} - impl<'a> GlobalRef<'a> { /// Get the `JSContext` for the `JSRuntime` associated with the thread /// this global object is on. @@ -273,25 +262,6 @@ impl GlobalRoot { } } -impl GlobalField { - /// Create a new `GlobalField` from a rooted reference. - #[allow(unrooted_must_root)] - pub fn from_rooted(global: &GlobalRef) -> GlobalField { - match *global { - GlobalRef::Window(window) => GlobalField::Window(JS::from_ref(window)), - GlobalRef::Worker(worker) => GlobalField::Worker(JS::from_ref(worker)), - } - } - - /// Create a stack-bounded root for this reference. - pub fn root(&self) -> GlobalRoot { - match *self { - GlobalField::Window(ref window) => GlobalRoot::Window(Root::from_ref(window)), - GlobalField::Worker(ref worker) => GlobalRoot::Worker(Root::from_ref(worker)), - } - } -} - /// Returns the global object of the realm that the given DOM object's reflector was created in. pub fn global_root_from_reflector<T: Reflectable>(reflector: &T) -> GlobalRoot { global_root_from_object(*reflector.reflector().get_jsobject()) |