diff options
Diffstat (limited to 'components/script')
-rw-r--r-- | components/script/Cargo.toml | 3 | ||||
-rw-r--r-- | components/script/dom/bindings/js.rs | 6 | ||||
-rw-r--r-- | components/script/dom/bindings/num.rs | 7 | ||||
-rw-r--r-- | components/script/dom/validitystate.rs | 4 | ||||
-rw-r--r-- | components/script/lib.rs | 5 |
5 files changed, 21 insertions, 4 deletions
diff --git a/components/script/Cargo.toml b/components/script/Cargo.toml index 7d98caec983..577b00c088a 100644 --- a/components/script/Cargo.toml +++ b/components/script/Cargo.toml @@ -35,13 +35,14 @@ euclid = "0.10.1" fnv = "1.0" gfx_traits = {path = "../gfx_traits"} heapsize = "0.3.6" -heapsize_plugin = "0.1.2" +heapsize_derive = "0.1" html5ever = {version = "0.5.1", features = ["heap_size", "unstable"]} hyper = "0.9.9" hyper_serde = "0.1.4" image = "0.10" ipc-channel = "0.5" js = {git = "https://github.com/servo/rust-mozjs", features = ["promises"]} +jstraceable_derive = {path = "../jstraceable_derive"} libc = "0.2" log = "0.3.5" mime = "0.2.1" diff --git a/components/script/dom/bindings/js.rs b/components/script/dom/bindings/js.rs index 779cb62d634..11aed4be9af 100644 --- a/components/script/dom/bindings/js.rs +++ b/components/script/dom/bindings/js.rs @@ -625,6 +625,12 @@ impl<T: Reflectable> Deref for Root<T> { } } +impl<T: Reflectable + HeapSizeOf> HeapSizeOf for Root<T> { + fn heap_size_of_children(&self) -> usize { + (**self).heap_size_of_children() + } +} + impl<T: Reflectable> PartialEq for Root<T> { fn eq(&self, other: &Self) -> bool { self.ptr == other.ptr diff --git a/components/script/dom/bindings/num.rs b/components/script/dom/bindings/num.rs index fde24d08421..03b0c743f9f 100644 --- a/components/script/dom/bindings/num.rs +++ b/components/script/dom/bindings/num.rs @@ -4,6 +4,7 @@ //! The `Finite<T>` struct. +use heapsize::HeapSizeOf; use num_traits::Float; use std::ops::Deref; @@ -38,3 +39,9 @@ impl<T: Float> Deref for Finite<T> { value } } + +impl<T: Float + HeapSizeOf> HeapSizeOf for Finite<T> { + fn heap_size_of_children(&self) -> usize { + (**self).heap_size_of_children() + } +} diff --git a/components/script/dom/validitystate.rs b/components/script/dom/validitystate.rs index 938320b7254..c6bb0761f3c 100644 --- a/components/script/dom/validitystate.rs +++ b/components/script/dom/validitystate.rs @@ -10,8 +10,8 @@ use dom::element::Element; use dom::window::Window; // https://html.spec.whatwg.org/multipage/#validity-states -#[derive_JSTraceable] -#[derive_HeapSizeOf] +#[derive(JSTraceable)] +#[derive(HeapSizeOf)] pub enum ValidityStatus { ValueMissing, TypeMismatch, diff --git a/components/script/lib.rs b/components/script/lib.rs index c679a5950d3..ed4fcf8b5ee 100644 --- a/components/script/lib.rs +++ b/components/script/lib.rs @@ -14,6 +14,7 @@ #![feature(on_unimplemented)] #![feature(optin_builtin_traits)] #![feature(plugin)] +#![feature(proc_macro)] #![feature(slice_patterns)] #![feature(stmt_expr_attributes)] #![feature(try_from)] @@ -24,7 +25,6 @@ #![doc = "The script crate contains all matters DOM."] -#![plugin(heapsize_plugin)] #![plugin(phf_macros)] #![plugin(plugins)] @@ -46,6 +46,7 @@ extern crate euclid; extern crate fnv; extern crate gfx_traits; extern crate heapsize; +#[macro_use] extern crate heapsize_derive; extern crate html5ever; extern crate hyper; extern crate hyper_serde; @@ -53,6 +54,8 @@ extern crate image; extern crate ipc_channel; #[macro_use] extern crate js; +#[macro_use] +extern crate jstraceable_derive; extern crate libc; #[macro_use] extern crate log; |