Bug 1393837 - Make sure codegen includes all the parent interfaces r=peterv
authorValentin Gosu <valentin.gosu@gmail.com>
Wed, 06 Sep 2017 10:33:45 +0200
changeset 428646 9698cc8c675274d5c787a1c4fbb3bc0817dd6729
parent 428645 0f782497fb09c037fd5a7bf977641cde1dd2202e
child 428647 61feaf98e908f76676b131e7345b83917ca1075f
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs1393837
milestone57.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 1393837 - Make sure codegen includes all the parent interfaces r=peterv MozReview-Commit-ID: 5UWExNmYyME
dom/bindings/Codegen.py
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -1075,16 +1075,30 @@ class CGHeaders(CGWrapper):
                 # interface object as the proto of our interface object.
                 if iface.hasInterfaceObject():
                     parent = iface.parent
                     while parent and not parent.hasInterfaceObject():
                         parent = parent.parent
                     if parent:
                         ancestors.append(parent)
         interfaceDeps.extend(ancestors)
+
+        # Include parent interface headers needed for jsonifier code.
+        jsonInterfaceParents = []
+        for desc in descriptors:
+            if not desc.operations['Jsonifier']:
+                continue
+            parent = desc.interface.parent
+            while parent:
+                parentDesc = desc.getDescriptor(parent.identifier.name)
+                if parentDesc.operations['Jsonifier']:
+                    jsonInterfaceParents.append(parentDesc.interface)
+                parent = parent.parent
+        interfaceDeps.extend(jsonInterfaceParents)
+
         bindingIncludes = set(self.getDeclarationFilename(d) for d in interfaceDeps)
 
         # Grab all the implementation declaration files we need.
         implementationIncludes = set(d.headerFile for d in descriptors if d.needsHeaderInclude())
 
         # Grab the includes for checking hasInstance
         interfacesImplementingSelf = set()
         for d in descriptors: