diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2016-11-02 18:46:15 +0100 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2016-11-03 01:10:32 +0100 |
commit | 5bb4c6c8846e71c7553cb625464b06ca0fedba08 (patch) | |
tree | c1dd794a9c246d668ccefc4320b6d1871c004231 /components/script/dom | |
parent | b640a83725a2b2a6c93be44107e49f4e99e7d59f (diff) | |
download | servo-5bb4c6c8846e71c7553cb625464b06ca0fedba08.tar.gz servo-5bb4c6c8846e71c7553cb625464b06ca0fedba08.zip |
Use heapsize_derive instead of heapsize_plugin
Diffstat (limited to 'components/script/dom')
-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 | 2 |
3 files changed, 14 insertions, 1 deletions
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..21740b16bfc 100644 --- a/components/script/dom/validitystate.rs +++ b/components/script/dom/validitystate.rs @@ -11,7 +11,7 @@ use dom::window::Window; // https://html.spec.whatwg.org/multipage/#validity-states #[derive_JSTraceable] -#[derive_HeapSizeOf] +#[derive(HeapSizeOf)] pub enum ValidityStatus { ValueMissing, TypeMismatch, |