From 2703568227e9957f3e1d44c3a03646675a285bc3 Mon Sep 17 00:00:00 2001 From: Chad Kimes Date: Sun, 10 Jan 2016 22:46:38 -0500 Subject: [PATCH] Remove unused enum GlobalField --- components/script/dom/bindings/global.rs | 30 ------------------------ 1 file changed, 30 deletions(-) diff --git a/components/script/dom/bindings/global.rs b/components/script/dom/bindings/global.rs index 8e455d29f289..2ac927066b6b 100644 --- a/components/script/dom/bindings/global.rs +++ b/components/script/dom/bindings/global.rs @@ -44,17 +44,6 @@ pub enum GlobalRoot { Worker(Root), } -/// 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), - /// A field for a `WorkerGlobalScope` object. - Worker(JS), -} - 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(reflector: &T) -> GlobalRoot { global_root_from_object(*reflector.reflector().get_jsobject())