aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/bindings')
-rw-r--r--components/script/dom/bindings/cell.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/components/script/dom/bindings/cell.rs b/components/script/dom/bindings/cell.rs
index 6c987270911..7e7e752bc0c 100644
--- a/components/script/dom/bindings/cell.rs
+++ b/components/script/dom/bindings/cell.rs
@@ -10,6 +10,7 @@ pub(crate) use std::cell::{Ref, RefCell, RefMut};
#[cfg(feature = "refcell_backtrace")]
pub(crate) use accountable_refcell::{Ref, RefCell, RefMut, ref_filter_map};
+use malloc_size_of::{MallocConditionalSizeOf, MallocSizeOfOps};
#[cfg(not(feature = "refcell_backtrace"))]
pub(crate) use ref_filter_map::ref_filter_map;
@@ -24,6 +25,12 @@ pub(crate) struct DomRefCell<T> {
value: RefCell<T>,
}
+impl<T: MallocConditionalSizeOf> MallocConditionalSizeOf for DomRefCell<T> {
+ fn conditional_size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
+ self.value.borrow().conditional_size_of(ops)
+ }
+}
+
// Functionality specific to Servo's `DomRefCell` type
// ===================================================