aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_task.rs
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2015-10-11 11:50:38 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2015-10-14 21:52:16 +0200
commitda676309318a7069650ca2cd571de7fa9b9e516a (patch)
treec4f1646796e0d192358f70ea323e230693514177 /components/script/script_task.rs
parent32daa17d5cbcad02db0713e21e52410cdc60480e (diff)
downloadservo-da676309318a7069650ca2cd571de7fa9b9e516a.tar.gz
servo-da676309318a7069650ca2cd571de7fa9b9e516a.zip
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.
Diffstat (limited to 'components/script/script_task.rs')
-rw-r--r--components/script/script_task.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/components/script/script_task.rs b/components/script/script_task.rs
index ba4581cbdc1..37ab4f34107 100644
--- a/components/script/script_task.rs
+++ b/components/script/script_task.rs
@@ -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"],