From a1091772ec9258d4e2c4184e07edab730e4d559c Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Tue, 21 Jun 2016 19:35:36 -0400 Subject: Implement binding support for returning and accepting Promises in WebIDL. --- components/script/dom/bindings/codegen/Configuration.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'components/script/dom/bindings/codegen/Configuration.py') diff --git a/components/script/dom/bindings/codegen/Configuration.py b/components/script/dom/bindings/codegen/Configuration.py index 6e71bd4bd00..835bcbe4774 100644 --- a/components/script/dom/bindings/codegen/Configuration.py +++ b/components/script/dom/bindings/codegen/Configuration.py @@ -194,9 +194,17 @@ class Descriptor(DescriptorProvider): typeName = desc.get('nativeType', nativeTypeDefault) - # Callback types do not use JS smart pointers, so we should not use the + spiderMonkeyInterface = desc.get('spiderMonkeyInterface', False) + + # Callback and SpiderMonkey types do not use JS smart pointers, so we should not use the # built-in rooting mechanisms for them. - if self.interface.isCallback(): + if spiderMonkeyInterface: + self.needsRooting = False + self.returnType = 'Rc<%s>' % typeName + self.argumentType = '&%s' % typeName + self.nativeType = typeName + pathDefault = 'dom::types::%s' % typeName + elif self.interface.isCallback(): self.needsRooting = False ty = 'dom::bindings::codegen::Bindings::%sBinding::%s' % (ifaceName, ifaceName) pathDefault = ty -- cgit v1.2.3