mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +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
|
@ -150,6 +150,7 @@ pub struct NativePropertyHooks {
|
|||
}
|
||||
|
||||
/// The struct that holds inheritance information for DOM object reflectors.
|
||||
#[allow(raw_pointer_derive)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct DOMClass {
|
||||
/// A list of interfaces that this object implements, in order of decreasing
|
||||
|
@ -161,6 +162,9 @@ pub struct DOMClass {
|
|||
|
||||
/// The NativePropertyHooks for the interface associated with this class.
|
||||
pub native_hooks: &'static NativePropertyHooks,
|
||||
|
||||
/// The HeapSizeOf function wrapper for that interface.
|
||||
pub heap_size_of: unsafe fn(*const libc::c_void) -> usize,
|
||||
}
|
||||
unsafe impl Sync for DOMClass {}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue