aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/codegen/Configuration.py
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2016-06-21 19:35:36 -0400
committerJosh Matthews <josh@joshmatthews.net>2016-09-22 16:16:48 -0400
commita1091772ec9258d4e2c4184e07edab730e4d559c (patch)
treef9a92d79c1d844a288f64c20260dabe5675047a5 /components/script/dom/bindings/codegen/Configuration.py
parent73b296350927bad6d526cce21434ce68a75216fa (diff)
downloadservo-a1091772ec9258d4e2c4184e07edab730e4d559c.tar.gz
servo-a1091772ec9258d4e2c4184e07edab730e4d559c.zip
Implement binding support for returning and accepting Promises in WebIDL.
Diffstat (limited to 'components/script/dom/bindings/codegen/Configuration.py')
-rw-r--r--components/script/dom/bindings/codegen/Configuration.py12
1 files changed, 10 insertions, 2 deletions
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