diff options
author | Josh Matthews <josh@joshmatthews.net> | 2015-07-31 12:46:36 -0400 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2015-08-03 23:05:00 -0400 |
commit | 8620fe599538effe755029e895fca6b9ca3b0f47 (patch) | |
tree | b7e1661271c4e358a7d003cf0b4837196ad198d0 /components/script/dom/node.rs | |
parent | c2497fcd49933f3782d529b891f4c8bb5de198c4 (diff) | |
download | servo-8620fe599538effe755029e895fca6b9ca3b0f47.tar.gz servo-8620fe599538effe755029e895fca6b9ca3b0f47.zip |
Start reporting memory usage for Window and all nodes in all DOM trees for frame treese in script tasks.
Diffstat (limited to 'components/script/dom/node.rs')
-rw-r--r-- | components/script/dom/node.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 1f6a681e582..94a0a1e05c0 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -78,6 +78,7 @@ use string_cache::{Atom, Namespace, QualName}; /// An HTML node. #[dom_struct] +#[derive(HeapSizeOf)] pub struct Node { /// The JavaScript reflector for this node. eventtarget: EventTarget, @@ -135,7 +136,7 @@ impl NodeDerived for EventTarget { bitflags! { #[doc = "Flags for node items."] - #[derive(JSTraceable)] + #[derive(JSTraceable, HeapSizeOf)] flags NodeFlags: u16 { #[doc = "Specifies whether this node is in a document."] const IS_IN_DOC = 0x01, @@ -206,20 +207,25 @@ enum SuppressObserver { } /// Layout data that is shared between the script and layout tasks. +#[derive(HeapSizeOf)] pub struct SharedLayoutData { /// The results of CSS styling for this node. pub style: Option<Arc<ComputedValues>>, } /// Encapsulates the abstract layout data. +#[allow(raw_pointer_derive)] +#[derive(HeapSizeOf)] pub struct LayoutData { _shared_data: SharedLayoutData, + #[ignore_heap_size_of = "TODO(#6910) Box value that should be counted but the type lives in layout"] _data: NonZero<*const ()>, } #[allow(unsafe_code)] unsafe impl Send for LayoutData {} +#[derive(HeapSizeOf)] pub struct LayoutDataRef { data_cell: RefCell<Option<LayoutData>>, } @@ -274,6 +280,7 @@ impl LayoutDataRef { /// The different types of nodes. #[derive(JSTraceable, Copy, Clone, PartialEq, Debug)] +#[derive(HeapSizeOf)] pub enum NodeTypeId { CharacterData(CharacterDataTypeId), DocumentType, |