Bug 879475 - Rename the MsgStart messages to MsgStartChild for child protocols r=jlebar
This commit is contained in:
@@ -52,7 +52,7 @@ bool
|
||||
Bridge(const PrivateIPDLInterface&,
|
||||
AsyncChannel* aParentChannel, ProcessHandle aParentProcess,
|
||||
AsyncChannel* aChildChannel, ProcessHandle aChildProcess,
|
||||
ProtocolId aProtocol)
|
||||
ProtocolId aProtocol, ProtocolId aChildProtocol)
|
||||
{
|
||||
ProcessId parentId = GetProcId(aParentProcess);
|
||||
ProcessId childId = GetProcId(aChildProcess);
|
||||
@@ -71,7 +71,7 @@ Bridge(const PrivateIPDLInterface&,
|
||||
aProtocol)) ||
|
||||
!aChildChannel->Send(new ChannelOpened(childSide,
|
||||
parentId,
|
||||
aProtocol))) {
|
||||
aChildProtocol))) {
|
||||
CloseDescriptor(parentSide);
|
||||
CloseDescriptor(childSide);
|
||||
return false;
|
||||
@@ -83,7 +83,7 @@ bool
|
||||
Open(const PrivateIPDLInterface&,
|
||||
AsyncChannel* aOpenerChannel, ProcessHandle aOtherProcess,
|
||||
Transport::Mode aOpenerMode,
|
||||
ProtocolId aProtocol)
|
||||
ProtocolId aProtocol, ProtocolId aChildProtocol)
|
||||
{
|
||||
bool isParent = (Transport::MODE_SERVER == aOpenerMode);
|
||||
ProcessHandle thisHandle = GetCurrentProcessHandle();
|
||||
@@ -102,7 +102,7 @@ Open(const PrivateIPDLInterface&,
|
||||
}
|
||||
|
||||
Message* parentMsg = new ChannelOpened(parentSide, childId, aProtocol);
|
||||
Message* childMsg = new ChannelOpened(childSide, parentId, aProtocol);
|
||||
Message* childMsg = new ChannelOpened(childSide, parentId, aChildProtocol);
|
||||
nsAutoPtr<Message> messageForUs(isParent ? parentMsg : childMsg);
|
||||
nsAutoPtr<Message> messageForOtherSide(!isParent ? parentMsg : childMsg);
|
||||
if (!aOpenerChannel->Echo(messageForUs.forget()) ||
|
||||
|
||||
@@ -122,12 +122,12 @@ struct PrivateIPDLInterface {};
|
||||
bool
|
||||
Bridge(const PrivateIPDLInterface&,
|
||||
AsyncChannel*, base::ProcessHandle, AsyncChannel*, base::ProcessHandle,
|
||||
ProtocolId);
|
||||
ProtocolId, ProtocolId);
|
||||
|
||||
bool
|
||||
Open(const PrivateIPDLInterface&,
|
||||
AsyncChannel*, base::ProcessHandle, Transport::Mode,
|
||||
ProtocolId);
|
||||
ProtocolId, ProtocolId);
|
||||
|
||||
bool
|
||||
UnpackChannelOpened(const PrivateIPDLInterface&,
|
||||
|
||||
@@ -158,6 +158,7 @@ enum IPCMessageStart {
|
||||
|
||||
for name in allprotocols:
|
||||
print >>ipcmsgstart, " %s," % name
|
||||
print >>ipcmsgstart, " %sChild," % name
|
||||
|
||||
print >>ipcmsgstart, """
|
||||
LastMsgIndex
|
||||
|
||||
@@ -1539,7 +1539,7 @@ class _GenerateProtocolCode(ipdl.ast.Visitor):
|
||||
msgenum = TypeEnum('MessageType')
|
||||
msgstart = _messageStartName(self.protocol.decl.type) +' << 16'
|
||||
msgenum.addId(self.protocol.name + 'Start', msgstart)
|
||||
msgenum.addId(self.protocol.name +'PreStart', '('+ msgstart +') - 1')
|
||||
#msgenum.addId(self.protocol.name +'PreStart', '('+ msgstart +') - 1')
|
||||
|
||||
for md in p.messageDecls:
|
||||
msgenum.addId(md.msgId())
|
||||
@@ -1593,7 +1593,8 @@ class _GenerateProtocolCode(ipdl.ast.Visitor):
|
||||
args=[ _backstagePass(),
|
||||
p.callGetChannel(parentvar), p.callOtherProcess(parentvar),
|
||||
p.callGetChannel(childvar), p.callOtherProcess(childvar),
|
||||
_protocolId(p.decl.type)
|
||||
_protocolId(p.decl.type),
|
||||
ExprVar(_messageStartName(p.decl.type) + 'Child')
|
||||
])))
|
||||
return bridgefunc
|
||||
|
||||
@@ -1613,7 +1614,8 @@ class _GenerateProtocolCode(ipdl.ast.Visitor):
|
||||
args=[ _backstagePass(),
|
||||
p.callGetChannel(openervar), p.callOtherProcess(openervar),
|
||||
_sideToTransportMode(localside),
|
||||
_protocolId(p.decl.type)
|
||||
_protocolId(p.decl.type),
|
||||
ExprVar(_messageStartName(p.decl.type) + 'Child')
|
||||
])))
|
||||
return openfunc
|
||||
|
||||
@@ -3992,7 +3994,10 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
|
||||
iffailalloc,
|
||||
StmtBreak()
|
||||
])
|
||||
return CaseLabel(_protocolId(actor.ptype).name), case
|
||||
label = _messageStartName(actor.ptype)
|
||||
if actor.side is 'child':
|
||||
label += 'Child'
|
||||
return CaseLabel(label), case
|
||||
|
||||
pswitch = StmtSwitch(pvar)
|
||||
for actor in actors:
|
||||
|
||||
Reference in New Issue
Block a user