Measure the stylist during memory reporting.

This commit is contained in:
Nicholas Nethercote 2017-09-05 15:11:18 +10:00 committed by Emilio Cobos Álvarez
parent f648e12935
commit d880efcab3
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
14 changed files with 356 additions and 28 deletions

View file

@ -8,8 +8,8 @@ use context::QuirksMode;
use fnv::FnvHashSet;
use media_queries::Device;
use shared_lock::SharedRwLockReadGuard;
use stylesheets::{DocumentRule, ImportRule, MediaRule, SupportsRule};
use stylesheets::{NestedRuleIterationCondition, Stylesheet};
use stylesheets::{DocumentRule, ImportRule, MallocEnclosingSizeOfFn, MallocSizeOfHash, MediaRule};
use stylesheets::{NestedRuleIterationCondition, Stylesheet, SupportsRule};
/// A key for a given media query result.
///
@ -88,6 +88,12 @@ impl EffectiveMediaQueryResults {
// because of stylesheet reusing... shrug.
self.set.insert(item.to_media_list_key());
}
/// Measure heap usage.
pub fn malloc_size_of_children(&self, malloc_enclosing_size_of: MallocEnclosingSizeOfFn)
-> usize {
self.set.malloc_shallow_size_of_hash(malloc_enclosing_size_of)
}
}
/// A filter that filters over effective rules, but allowing all potentially