Bug 1715755 - Part 1: Don't ignore dead actors for sync and intr messages, r=handyman

When this change was first implemented, it ignored dead actors for all types of
messages, but for messages with replies they cannot be ignored, as a reply must
be sent. This should fix that oversight.

Differential Revision: https://phabricator.services.mozilla.com/D123148
This commit is contained in:
Nika Layzell 2021-08-25 18:30:24 +00:00
parent 44f360b272
commit e3b52f319a

View File

@ -4047,14 +4047,23 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
return method
if dispatches:
if hasReply:
ondeadactor = [StmtReturn(_Result.RouteError)]
else:
ondeadactor = [
self.logMessage(
None, ExprAddrOf(msgvar), "Ignored message for dead actor"
),
StmtReturn(_Result.Processed),
]
method.addcode(
"""
int32_t route__ = ${msgvar}.routing_id();
if (MSG_ROUTING_CONTROL != route__) {
IProtocol* routed__ = Lookup(route__);
if (!routed__ || !routed__->GetLifecycleProxy()) {
${logignored}
return MsgProcessed;
$*{ondeadactor}
}
RefPtr<mozilla::ipc::ActorLifecycleProxy> proxy__ =
@ -4064,9 +4073,7 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
""",
msgvar=msgvar,
logignored=self.logMessage(
None, ExprAddrOf(msgvar), "Ignored message for dead actor"
),
ondeadactor=ondeadactor,
name=name,
args=[p.name for p in params],
)