Skip to content

Commit

Permalink
Remove unused enum GlobalField
Browse files Browse the repository at this point in the history
  • Loading branch information
chkimes committed Jan 11, 2016
1 parent efaf4cd commit 2703568
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions components/script/dom/bindings/global.rs
Expand Up @@ -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.
Expand Down Expand Up @@ -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())
Expand Down

0 comments on commit 2703568

Please sign in to comment.