Bug 1367176 - Expose promise typedef to public so it can be used outside of actor. r?billm draft
authorKan-Ru Chen <kanru@kanru.info>
Wed, 24 May 2017 13:06:35 -0400
changeset 584550 32e4da1c476341fe4a0d04bd5994ce8b78cbb3cc
parent 583779 37d777d872002597198405f22eefa9199e5103af
child 630427 de01a37d4f079126cc74abaa036de9aa51d97700
push id60789
push userbmo:kchen@mozilla.com
push dateThu, 25 May 2017 17:37:37 +0000
reviewersbillm
bugs1367176
milestone55.0a1
Bug 1367176 - Expose promise typedef to public so it can be used outside of actor. r?billm MozReview-Commit-ID: JRlPR2rs3ij
ipc/ipdl/ipdl/lower.py
--- a/ipc/ipdl/ipdl/lower.py
+++ b/ipc/ipdl/ipdl/lower.py
@@ -2613,26 +2613,30 @@ class _GenerateProtocolActorCode(ipdl.as
                                            self.prettyside)),
                 Whitespace.NL ])
 
         self.cls.addstmt(Label.PROTECTED)
         for typedef in p.cxxTypedefs():
             self.cls.addstmt(typedef)
         for typedef in self.includedActorTypedefs:
             self.cls.addstmt(typedef)
+
+        self.cls.addstmt(Whitespace.NL)
+
+        self.cls.addstmts([ Typedef(p.fqStateType(), 'State'), Whitespace.NL ])
+
+        self.cls.addstmt(Label.PUBLIC)
         for md in p.messageDecls:
             if self.receivesMessage(md) and md.hasAsyncReturns():
                 self.cls.addstmt(
                     Typedef(_makePromise(md.returns, self.side, resolver=True),
                             md.promiseName()))
-
         self.cls.addstmt(Whitespace.NL)
 
-        self.cls.addstmts([ Typedef(p.fqStateType(), 'State'), Whitespace.NL ])
-
+        self.cls.addstmt(Label.PROTECTED)
         # interface methods that the concrete subclass has to impl
         for md in p.messageDecls:
             isctor, isdtor = md.decl.type.isCtor(), md.decl.type.isDtor()
 
             if self.receivesMessage(md):
                 # generate Recv/Answer* interface
                 implicit = (not isdtor)
                 returnsems = 'resolver' if md.decl.type.isAsync() else 'out'