Add accountable-refcell as optional build time feature

This commit is contained in:
Kunal Mohan 2020-01-07 13:27:19 +05:30
parent bd636b0e6c
commit 02c1612cb0
No known key found for this signature in database
GPG key ID: 2B475A4524237BAC
29 changed files with 69 additions and 44 deletions

View file

@ -46,6 +46,7 @@
//! Note: WebRender has a reduced fork of this crate, so that we can avoid
//! publishing this crate on crates.io.
extern crate accountable_refcell;
extern crate app_units;
#[cfg(feature = "servo")]
extern crate content_security_policy;
@ -970,3 +971,10 @@ impl<T: MallocSizeOf> DerefMut for Measurable<T> {
&mut self.0
}
}
#[cfg(feature = "servo")]
impl<T: MallocSizeOf> MallocSizeOf for accountable_refcell::RefCell<T> {
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
self.borrow().size_of(ops)
}
}