Bug 1546356 - Allow ManagedEndPoints as members of unions/structs. Part 2: add a typedef for ManagedEndpoint if it's used in a struct or union. r=nika
authorPeter Van der Beken <peterv@propagandism.org>
Fri, 19 Apr 2019 14:56:48 +0200
changeset 500483 9f3173e9665c8b62db04fd0c67ed0fe2a3d83fbc
parent 500482 c4a3bbc944a3f1d003bae9137595d5298f226a46
child 500484 618728a9d10f86b7f5e0a46002995581f89a1a8b
push id114165
push userpvanderbeken@mozilla.com
push dateWed, 06 Nov 2019 09:18:40 +0000
treeherdermozilla-inbound@db1ddab2985d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnika
bugs1546356
milestone72.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 1546356 - Allow ManagedEndPoints as members of unions/structs. Part 2: add a typedef for ManagedEndpoint if it's used in a struct or union. r=nika Differential Revision: https://phabricator.services.mozilla.com/D28549
ipc/ipdl/ipdl/lower.py
--- a/ipc/ipdl/ipdl/lower.py
+++ b/ipc/ipdl/ipdl/lower.py
@@ -2240,19 +2240,19 @@ before this struct.  Some types generate
     def __init__(self, fortype, unqualifiedTypedefs=False):
         ipdl.type.TypeVisitor.__init__(self)
         self.usingTypedefs = []
         self.forwardDeclStmts = []
         self.fullDeclTypes = []
         self.fortype = fortype
         self.unqualifiedTypedefs = unqualifiedTypedefs
 
-    def maybeTypedef(self, fqname, name):
+    def maybeTypedef(self, fqname, name, templateargs=[]):
         if fqname != name or self.unqualifiedTypedefs:
-            self.usingTypedefs.append(Typedef(Type(fqname), name))
+            self.usingTypedefs.append(Typedef(Type(fqname), name, templateargs))
 
     def visitImportedCxxType(self, t):
         if t in self.visited:
             return
         self.visited.add(t)
         self.maybeTypedef(t.fullname(), t.name())
 
     def visitActorType(self, t):
@@ -2312,16 +2312,29 @@ before this struct.  Some types generate
         self.maybeTypedef('mozilla::ipc::ByteBuf', 'ByteBuf')
 
     def visitFDType(self, s):
         if s in self.visited:
             return
         self.visited.add(s)
         self.maybeTypedef('mozilla::ipc::FileDescriptor', 'FileDescriptor')
 
+    def visitEndpointType(self, s):
+        if s in self.visited:
+            return
+        self.visited.add(s)
+        self.maybeTypedef('mozilla::ipc::Endpoint', 'Endpoint', ['FooSide'])
+
+    def visitManagedEndpointType(self, s):
+        if s in self.visited:
+            return
+        self.visited.add(s)
+        self.maybeTypedef('mozilla::ipc::ManagedEndpoint', 'ManagedEndpoint',
+                          ['FooSide'])
+
     def visitUniquePtrType(self, s):
         if s in self.visited:
             return
         self.visited.add(s)
 
     def visitVoidType(self, v): assert 0
 
     def visitMessageType(self, v): assert 0