mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Remove NativePropertyHooks
This commit is contained in:
parent
6beebd3b4f
commit
967948be06
2 changed files with 2 additions and 44 deletions
|
@ -276,34 +276,6 @@ class CGThing():
|
||||||
raise NotImplementedError # Override me!
|
raise NotImplementedError # Override me!
|
||||||
|
|
||||||
|
|
||||||
class CGNativePropertyHooks(CGThing):
|
|
||||||
"""
|
|
||||||
Generate a NativePropertyHooks for a given descriptor
|
|
||||||
"""
|
|
||||||
def __init__(self, descriptor, properties):
|
|
||||||
CGThing.__init__(self)
|
|
||||||
self.descriptor = descriptor
|
|
||||||
self.properties = properties
|
|
||||||
|
|
||||||
def define(self):
|
|
||||||
parent = self.descriptor.interface.parent
|
|
||||||
if parent:
|
|
||||||
parentHooks = ("Some(&::dom::bindings::codegen::Bindings::%sBinding::sNativePropertyHooks)"
|
|
||||||
% parent.identifier.name)
|
|
||||||
else:
|
|
||||||
parentHooks = "None"
|
|
||||||
|
|
||||||
substitutions = {
|
|
||||||
"parentHooks": parentHooks
|
|
||||||
}
|
|
||||||
|
|
||||||
return string.Template(
|
|
||||||
"pub static sNativePropertyHooks: NativePropertyHooks = NativePropertyHooks {\n"
|
|
||||||
" native_properties: &sNativeProperties,\n"
|
|
||||||
" proto_hooks: ${parentHooks},\n"
|
|
||||||
"};\n").substitute(substitutions)
|
|
||||||
|
|
||||||
|
|
||||||
class CGMethodCall(CGThing):
|
class CGMethodCall(CGThing):
|
||||||
"""
|
"""
|
||||||
A class to generate selection of a method signature from a set of
|
A class to generate selection of a method signature from a set of
|
||||||
|
@ -1760,7 +1732,6 @@ def DOMClass(descriptor):
|
||||||
return """\
|
return """\
|
||||||
DOMClass {
|
DOMClass {
|
||||||
interface_chain: [ %s ],
|
interface_chain: [ %s ],
|
||||||
native_hooks: &sNativePropertyHooks,
|
|
||||||
type_id: %s,
|
type_id: %s,
|
||||||
heap_size_of: %s as unsafe fn(_) -> _,
|
heap_size_of: %s as unsafe fn(_) -> _,
|
||||||
}""" % (prototypeChainString, DOMClassTypeId(descriptor), heapSizeOf)
|
}""" % (prototypeChainString, DOMClassTypeId(descriptor), heapSizeOf)
|
||||||
|
@ -4913,7 +4884,6 @@ class CGDescriptor(CGThing):
|
||||||
properties = PropertyArrays(descriptor)
|
properties = PropertyArrays(descriptor)
|
||||||
cgThings.append(CGGeneric(str(properties)))
|
cgThings.append(CGGeneric(str(properties)))
|
||||||
cgThings.append(CGNativeProperties(descriptor, properties))
|
cgThings.append(CGNativeProperties(descriptor, properties))
|
||||||
cgThings.append(CGNativePropertyHooks(descriptor, properties))
|
|
||||||
cgThings.append(CGCreateInterfaceObjectsMethod(descriptor, properties))
|
cgThings.append(CGCreateInterfaceObjectsMethod(descriptor, properties))
|
||||||
|
|
||||||
cgThings.append(CGNamespace.build([descriptor.name + "Constants"],
|
cgThings.append(CGNamespace.build([descriptor.name + "Constants"],
|
||||||
|
@ -5331,8 +5301,8 @@ class CGBindingRoot(CGThing):
|
||||||
'dom::bindings::reflector::{Reflectable}',
|
'dom::bindings::reflector::{Reflectable}',
|
||||||
'dom::bindings::utils::{ConstantSpec, DOMClass, DOMJSClass}',
|
'dom::bindings::utils::{ConstantSpec, DOMClass, DOMJSClass}',
|
||||||
'dom::bindings::utils::{DOM_PROTO_UNFORGEABLE_HOLDER_SLOT, JSCLASS_DOM_GLOBAL}',
|
'dom::bindings::utils::{DOM_PROTO_UNFORGEABLE_HOLDER_SLOT, JSCLASS_DOM_GLOBAL}',
|
||||||
'dom::bindings::utils::{NativeProperties, NativePropertyHooks, NonNullJSNative}',
|
'dom::bindings::utils::{NativeProperties, NonNullJSNative, create_dom_global}',
|
||||||
'dom::bindings::utils::{create_dom_global, do_create_interface_objects, finalize_global}',
|
'dom::bindings::utils::{do_create_interface_objects, finalize_global}',
|
||||||
'dom::bindings::utils::{find_enum_string_index, generic_getter}',
|
'dom::bindings::utils::{find_enum_string_index, generic_getter}',
|
||||||
'dom::bindings::utils::{generic_lenient_getter, generic_lenient_setter}',
|
'dom::bindings::utils::{generic_lenient_getter, generic_lenient_setter}',
|
||||||
'dom::bindings::utils::{generic_method, generic_setter, get_array_index_from_id}',
|
'dom::bindings::utils::{generic_method, generic_setter, get_array_index_from_id}',
|
||||||
|
|
|
@ -129,15 +129,6 @@ impl ConstantSpec {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Helper structure for cross-origin wrappers for DOM binding objects.
|
|
||||||
pub struct NativePropertyHooks {
|
|
||||||
/// The property arrays for this interface.
|
|
||||||
pub native_properties: &'static NativeProperties,
|
|
||||||
|
|
||||||
/// The NativePropertyHooks instance for the parent interface, if any.
|
|
||||||
pub proto_hooks: Option<&'static NativePropertyHooks>,
|
|
||||||
}
|
|
||||||
|
|
||||||
/// The struct that holds inheritance information for DOM object reflectors.
|
/// The struct that holds inheritance information for DOM object reflectors.
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct DOMClass {
|
pub struct DOMClass {
|
||||||
|
@ -148,9 +139,6 @@ pub struct DOMClass {
|
||||||
/// The type ID of that interface.
|
/// The type ID of that interface.
|
||||||
pub type_id: TopTypeId,
|
pub type_id: TopTypeId,
|
||||||
|
|
||||||
/// The NativePropertyHooks for the interface associated with this class.
|
|
||||||
pub native_hooks: &'static NativePropertyHooks,
|
|
||||||
|
|
||||||
/// The HeapSizeOf function wrapper for that interface.
|
/// The HeapSizeOf function wrapper for that interface.
|
||||||
pub heap_size_of: unsafe fn(*const libc::c_void) -> usize,
|
pub heap_size_of: unsafe fn(*const libc::c_void) -> usize,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue