aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/utils.rs
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2016-05-20 23:03:14 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2016-05-26 23:56:13 +0200
commitfd7c4f814949c45518d69216aa384d4d82d60107 (patch)
tree9fc233cc0720e84766debb13dc12e41d53214952 /components/script/dom/bindings/utils.rs
parenta20db08f06f93a693b9288728fc2a4a522f42344 (diff)
downloadservo-fd7c4f814949c45518d69216aa384d4d82d60107.tar.gz
servo-fd7c4f814949c45518d69216aa384d4d82d60107.zip
Remove utils::Prefable in favour of guard::Guard
Diffstat (limited to 'components/script/dom/bindings/utils.rs')
-rw-r--r--components/script/dom/bindings/utils.rs22
1 files changed, 0 insertions, 22 deletions
diff --git a/components/script/dom/bindings/utils.rs b/components/script/dom/bindings/utils.rs
index 3ba5838a4fa..cf1f437b1cf 100644
--- a/components/script/dom/bindings/utils.rs
+++ b/components/script/dom/bindings/utils.rs
@@ -39,7 +39,6 @@ use std::ffi::CString;
use std::os::raw::c_void;
use std::ptr;
use std::slice;
-use util::prefs;
/// Proxy handler for a WindowProxy.
pub struct WindowProxyHandler(pub *const libc::c_void);
@@ -550,24 +549,3 @@ unsafe extern "C" fn instance_class_has_proto_at_depth(clasp: *const js::jsapi::
pub const DOM_CALLBACKS: DOMCallbacks = DOMCallbacks {
instanceClassMatchesProto: Some(instance_class_has_proto_at_depth),
};
-
-/// A container around JS member specifications that are conditionally enabled.
-pub struct Prefable<T: 'static> {
- /// If present, the name of the preference used to conditionally enable these specs.
- pub pref: Option<&'static str>,
- /// The underlying slice of specifications.
- pub specs: &'static [T],
-}
-
-impl<T> Prefable<T> {
- /// Retrieve the slice represented by this container, unless the condition
- /// guarding it is false.
- pub fn specs(&self) -> Option<&'static [T]> {
- if let Some(pref) = self.pref {
- if !prefs::get_pref(pref).as_boolean().unwrap_or(false) {
- return None;
- }
- }
- Some(self.specs)
- }
-}