diff options
author | Josh Matthews <josh@joshmatthews.net> | 2013-09-30 22:14:14 -0400 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2013-09-30 22:14:27 -0400 |
commit | cb826f99202f4539aa46b3fd07fbe557182b085a (patch) | |
tree | d83201b971f0c78a16dfd6a001a09cd5d58bfc7c /src/components/script/dom | |
parent | 74c38595483ba35cd285ea3ee9e59e32b10bccf4 (diff) | |
download | servo-cb826f99202f4539aa46b3fd07fbe557182b085a.tar.gz servo-cb826f99202f4539aa46b3fd07fbe557182b085a.zip |
Make proxy bindings generate trace and finalization hooks.
Diffstat (limited to 'src/components/script/dom')
-rw-r--r-- | src/components/script/dom/bindings/codegen/CodegenRust.py | 12 | ||||
-rw-r--r-- | src/components/script/dom/htmldocument.rs | 9 |
2 files changed, 14 insertions, 7 deletions
diff --git a/src/components/script/dom/bindings/codegen/CodegenRust.py b/src/components/script/dom/bindings/codegen/CodegenRust.py index 561466f00bf..4c28883ab13 100644 --- a/src/components/script/dom/bindings/codegen/CodegenRust.py +++ b/src/components/script/dom/bindings/codegen/CodegenRust.py @@ -2867,14 +2867,17 @@ class CGDefineDOMInterfaceMethod(CGAbstractMethod): //regexp_toShared: ptr::null(), defaultValue: ptr::null(), iteratorNext: ptr::null(), - finalize: ptr::null(), + finalize: %s, getElementIfPresent: ptr::null(), - getPrototypeOf: ptr::null() + getPrototypeOf: ptr::null(), + trace: %s }; (*page).js_info.get_mut_ref().dom_static.proxy_handlers.insert(PrototypeList::id::%s as uint, CreateProxyHandler(ptr::to_unsafe_ptr(&traps), ptr::to_unsafe_ptr(&Class) as *libc::c_void)); -""" % self.descriptor.name +""" % (FINALIZE_HOOK_NAME, + ('Some(%s)' % TRACE_HOOK_NAME) if self.descriptor.customTrace else 'None', + self.descriptor.name) else: body += """ (*page).js_info.get_ref().dom_static.attribute_ids.insert(PrototypeList::id::%s as uint, vec::cast_to_mut(vec::from_slice(sAttributes_ids))); @@ -4196,7 +4199,7 @@ class CGDescriptor(CGThing): #if hasLenientSetter: cgThings.append(CGGenericSetter(descriptor, # lenientThis=True)) - if descriptor.concrete and not descriptor.proxy: + if descriptor.concrete: if not descriptor.workers and descriptor.wrapperCache: #cgThings.append(CGAddPropertyHook(descriptor)) pass @@ -4208,7 +4211,6 @@ class CGDescriptor(CGThing): # Only generate a trace hook if the class wants a custom hook. if (descriptor.customTrace): cgThings.append(CGClassTraceHook(descriptor)) - pass if descriptor.interface.hasInterfaceObject(): cgThings.append(CGClassConstructHook(descriptor)) diff --git a/src/components/script/dom/htmldocument.rs b/src/components/script/dom/htmldocument.rs index 855231ea637..6e70ad236a5 100644 --- a/src/components/script/dom/htmldocument.rs +++ b/src/components/script/dom/htmldocument.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::HTMLDocumentBinding; -use dom::bindings::utils::{DOMString, ErrorResult, Fallible}; +use dom::bindings::utils::{DOMString, ErrorResult, Fallible, Traceable}; use dom::bindings::utils::{CacheableWrapper, BindingObject, WrapperCache}; use dom::document::{AbstractDocument, Document, WrappableDocument, HTML}; use dom::element::HTMLHeadElementTypeId; @@ -11,7 +11,7 @@ use dom::htmlcollection::HTMLCollection; use dom::node::{AbstractNode, ScriptView, ElementNodeTypeId}; use dom::window::Window; -use js::jsapi::{JSObject, JSContext}; +use js::jsapi::{JSObject, JSContext, JSTracer}; use servo_util::tree::TreeNodeRef; @@ -212,3 +212,8 @@ impl BindingObject for HTMLDocument { } } +impl Traceable for HTMLDocument { + fn trace(&self, tracer: *mut JSTracer) { + self.parent.trace(tracer); + } +}
\ No newline at end of file |