Bug 1000944. Allow unions and dictionaries that contain non-SpiderMonkey WebIDL interface types to be copy-constructed. r=dzbarsky
authorBoris Zbarsky <bzbarsky@mit.edu>
Sat, 26 Apr 2014 21:49:59 -0400
changeset 180454 252653fe3a934b7106cdf929f2ac9ee6d821e818
parent 180453 2f394d14ac89d54511dd36bfc0f4718492bcbaec
child 180455 93a71ca8b150771199a0293a8e1f8d2f6fbee345
push id42763
push userbzbarsky@mozilla.com
push dateSun, 27 Apr 2014 02:07:27 +0000
treeherdermozilla-inbound@93a71ca8b150 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdzbarsky
bugs1000944
milestone31.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1000944. Allow unions and dictionaries that contain non-SpiderMonkey WebIDL interface types to be copy-constructed. r=dzbarsky
dom/bindings/Codegen.py
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -40,17 +40,21 @@ def toBindingNamespace(arg):
 
 def isTypeCopyConstructible(type):
     # Nullable and sequence stuff doesn't affect copy/constructibility
     type = type.unroll()
     return (type.isPrimitive() or type.isString() or type.isEnum() or
             (type.isUnion() and
              CGUnionStruct.isUnionCopyConstructible(type)) or
             (type.isDictionary() and
-             CGDictionary.isDictionaryCopyConstructible(type.inner)))
+             CGDictionary.isDictionaryCopyConstructible(type.inner)) or
+            # Interface types are only copy-constructible if they're Gecko
+            # interfaces.  SpiderMonkey interfaces are not copy-constructible
+            # because of rooting issues.
+            (type.isInterface() and type.isGeckoInterface()))
 
 
 def wantsAddProperty(desc):
     return (desc.concrete and
             desc.wrapperCache and
             not (desc.workers and
                  desc.interface.getExtendedAttribute("Global")))