mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Measure heap memory usage for more types. Fixes #6951
This commit is contained in:
parent
94c8dcd575
commit
45145108da
175 changed files with 669 additions and 94 deletions
|
@ -30,8 +30,10 @@ pub enum CollectionTypeId {
|
|||
}
|
||||
|
||||
#[dom_struct]
|
||||
#[derive(HeapSizeOf)]
|
||||
pub struct HTMLCollection {
|
||||
reflector_: Reflector,
|
||||
#[ignore_heap_size_of = "Contains a trait object; can't measure due to #6870"]
|
||||
collection: CollectionTypeId,
|
||||
}
|
||||
|
||||
|
@ -57,7 +59,7 @@ impl HTMLCollection {
|
|||
|
||||
fn all_elements(window: &Window, root: &Node,
|
||||
namespace_filter: Option<Namespace>) -> Root<HTMLCollection> {
|
||||
#[derive(JSTraceable)]
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
struct AllElementFilter {
|
||||
namespace_filter: Option<Namespace>
|
||||
}
|
||||
|
@ -79,7 +81,7 @@ impl HTMLCollection {
|
|||
return HTMLCollection::all_elements(window, root, None);
|
||||
}
|
||||
|
||||
#[derive(JSTraceable)]
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
struct TagNameFilter {
|
||||
tag: Atom,
|
||||
ascii_lower_tag: Atom,
|
||||
|
@ -110,7 +112,7 @@ impl HTMLCollection {
|
|||
if tag == "*" {
|
||||
return HTMLCollection::all_elements(window, root, namespace_filter);
|
||||
}
|
||||
#[derive(JSTraceable)]
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
struct TagNameNSFilter {
|
||||
tag: Atom,
|
||||
namespace_filter: Option<Namespace>
|
||||
|
@ -135,7 +137,7 @@ impl HTMLCollection {
|
|||
|
||||
pub fn by_class_name(window: &Window, root: &Node, classes: DOMString)
|
||||
-> Root<HTMLCollection> {
|
||||
#[derive(JSTraceable)]
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
struct ClassNameFilter {
|
||||
classes: Vec<Atom>
|
||||
}
|
||||
|
@ -153,7 +155,7 @@ impl HTMLCollection {
|
|||
}
|
||||
|
||||
pub fn children(window: &Window, root: &Node) -> Root<HTMLCollection> {
|
||||
#[derive(JSTraceable)]
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
struct ElementChildFilter;
|
||||
impl CollectionFilter for ElementChildFilter {
|
||||
fn filter(&self, elem: &Element, root: &Node) -> bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue