Skip to content

Commit

Permalink
Bug 1419455, part 2 - Clean up standardTypedefs. r=kanru
Browse files Browse the repository at this point in the history
There's already a typedef for MessageChannel, so use that instead of
Channel. Also, use IProtocol and not ProtocolBase or ChannelListener,
for simplicity.

MozReview-Commit-ID: 2zCjTpPTW4L

--HG--
extra : rebase_source : eed8d6d51a512ac85f6b4962fc12591bf81c2981
  • Loading branch information
amccreight committed Nov 21, 2017
1 parent 1bae204 commit 6501543
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions ipc/ipdl/ipdl/lower.py
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,7 @@ def channelSel(self):
return '->'

def channelType(self):
return Type('Channel', ptr=not self.decl.type.isToplevel())
return Type('MessageChannel', ptr=not self.decl.type.isToplevel())

def managerInterfaceType(self, ptr=0):
return Type('mozilla::ipc::IProtocol', ptr=ptr)
Expand Down Expand Up @@ -2471,10 +2471,8 @@ def lower(self, tu, clsname, cxxHeaderFile, cxxFile):

def standardTypedefs(self):
return [
Typedef(Type('mozilla::ipc::IProtocol'), 'ProtocolBase'),
Typedef(Type('mozilla::ipc::IProtocol'), 'IProtocol'),
Typedef(Type('IPC::Message'), 'Message'),
Typedef(Type('mozilla::ipc::MessageChannel'), 'Channel'),
Typedef(Type('mozilla::ipc::IProtocol'), 'ChannelListener'),
Typedef(Type('base::ProcessHandle'), 'ProcessHandle'),
Typedef(Type('mozilla::ipc::MessageChannel'), 'MessageChannel'),
Typedef(Type('mozilla::ipc::SharedMemory'), 'SharedMemory'),
Expand Down Expand Up @@ -2972,7 +2970,7 @@ def makeHandlerMethod(name, switch, hasReply, dispatches=0):
ExprVar('MSG_ROUTING_CONTROL'), '!=', routevar))
routedvar = ExprVar('routed__')
routeif.ifb.addstmt(
StmtDecl(Decl(Type('ChannelListener', ptr=1),
StmtDecl(Decl(Type('IProtocol', ptr=1),
routedvar.name),
_lookupListener(routevar)))
failif = StmtIf(ExprPrefixUnop(routedvar, '!'))
Expand Down Expand Up @@ -3235,7 +3233,7 @@ def implementManagerIface(self):
sizevar = ExprVar('aSize')
typevar = ExprVar('aType')
unsafevar = ExprVar('aUnsafe')
protocolbase = Type('ProtocolBase', ptr=1)
protocolbase = Type('IProtocol', ptr=1)
sourcevar = ExprVar('aSource')
ivar = ExprVar('i')
kidsvar = ExprVar('kids')
Expand Down

0 comments on commit 6501543

Please sign in to comment.