mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Introduce DOMClass::heap_size_of
It holds a function pointer to the HeapSizeOf::heap_size_of_children() implementation corresponding to that IDL interface. This removes the need for a clumsly TypeId-based match expression in the former heap_size_of_eventtarget() function.
This commit is contained in:
parent
32daa17d5c
commit
da67630931
4 changed files with 28 additions and 236 deletions
|
@ -61,7 +61,7 @@ use js::rust::Runtime;
|
|||
use layout_interface::{ReflowQueryType};
|
||||
use layout_interface::{self, LayoutChan, NewLayoutTaskInfo, ReflowGoal, ScriptLayoutChan};
|
||||
use libc;
|
||||
use mem::heap_size_of_eventtarget;
|
||||
use mem::heap_size_of_self_and_children;
|
||||
use msg::compositor_msg::{LayerId, ScriptToCompositorMsg};
|
||||
use msg::constellation_msg::Msg as ConstellationMsg;
|
||||
use msg::constellation_msg::{ConstellationChan, FocusType, LoadData};
|
||||
|
@ -1258,11 +1258,11 @@ impl ScriptTask {
|
|||
|
||||
for child in NodeCast::from_ref(&*it_page.document()).traverse_preorder() {
|
||||
let target = EventTargetCast::from_ref(&*child);
|
||||
dom_tree_size += heap_size_of_eventtarget(target);
|
||||
dom_tree_size += heap_size_of_self_and_children(target);
|
||||
}
|
||||
let window = it_page.window();
|
||||
let target = EventTargetCast::from_ref(&*window);
|
||||
dom_tree_size += heap_size_of_eventtarget(target);
|
||||
dom_tree_size += heap_size_of_self_and_children(target);
|
||||
|
||||
reports.push(Report {
|
||||
path: path![format!("url({})", current_url), "dom-tree"],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue