зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1262937 - part 7 - factor out union type deserialization errors; r=jld
This commit is contained in:
Родитель
dfe775eb9f
Коммит
647562c2d2
|
@ -511,5 +511,12 @@ MismatchedActorTypeError(const char* aActorDescription)
|
||||||
ProtocolErrorBreakpoint(message.get());
|
ProtocolErrorBreakpoint(message.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
UnionTypeReadError(const char* aUnionName)
|
||||||
|
{
|
||||||
|
nsPrintfCString message("error deserializing type of union %s", aUnionName);
|
||||||
|
NS_RUNTIMEABORT(message.get());
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace ipc
|
} // namespace ipc
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
|
@ -339,6 +339,9 @@ ActorLookupError(const char* aActorDescription);
|
||||||
MOZ_NEVER_INLINE void
|
MOZ_NEVER_INLINE void
|
||||||
MismatchedActorTypeError(const char* aActorDescription);
|
MismatchedActorTypeError(const char* aActorDescription);
|
||||||
|
|
||||||
|
MOZ_NEVER_INLINE void
|
||||||
|
UnionTypeReadError(const char* aUnionName);
|
||||||
|
|
||||||
struct PrivateIPDLInterface {};
|
struct PrivateIPDLInterface {};
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
|
|
@ -403,6 +403,11 @@ def _logicError(msg):
|
||||||
return StmtExpr(
|
return StmtExpr(
|
||||||
ExprCall(ExprVar('mozilla::ipc::LogicError'), args=[ ExprLiteral.String(msg) ]))
|
ExprCall(ExprVar('mozilla::ipc::LogicError'), args=[ ExprLiteral.String(msg) ]))
|
||||||
|
|
||||||
|
def _unionTypeReadError(unionname):
|
||||||
|
return StmtExpr(
|
||||||
|
ExprCall(ExprVar('mozilla::ipc::UnionTypeReadError'),
|
||||||
|
args=[ ExprLiteral.String(unionname) ]))
|
||||||
|
|
||||||
def _killProcess(pid):
|
def _killProcess(pid):
|
||||||
return ExprCall(
|
return ExprCall(
|
||||||
ExprVar('base::KillProcess'),
|
ExprVar('base::KillProcess'),
|
||||||
|
@ -462,6 +467,9 @@ def errfnRecv(msg, errcode=_Result.ValuError):
|
||||||
def errfnRead(msg):
|
def errfnRead(msg):
|
||||||
return [ _fatalError(msg), StmtReturn.FALSE ]
|
return [ _fatalError(msg), StmtReturn.FALSE ]
|
||||||
|
|
||||||
|
def errfnUnionType(unionname):
|
||||||
|
return [ _unionTypeReadError(unionname), StmtReturn.FALSE ]
|
||||||
|
|
||||||
def _destroyMethod():
|
def _destroyMethod():
|
||||||
return ExprVar('ActorDestroy')
|
return ExprVar('ActorDestroy')
|
||||||
|
|
||||||
|
@ -4632,8 +4640,8 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
|
||||||
uniontdef,
|
uniontdef,
|
||||||
StmtDecl(Decl(Type.INT, typevar.name)),
|
StmtDecl(Decl(Type.INT, typevar.name)),
|
||||||
self.checkedRead(
|
self.checkedRead(
|
||||||
None, ExprAddrOf(typevar), msgvar, itervar, errfnRead,
|
None, ExprAddrOf(typevar), msgvar, itervar, errfnUnionType,
|
||||||
'\'' + typevar.name + '\' (' + Type.INT.name + ') of union \'' + uniontype.name() + '\''),
|
[ uniontype.name() ]),
|
||||||
Whitespace.NL,
|
Whitespace.NL,
|
||||||
readswitch,
|
readswitch,
|
||||||
])
|
])
|
||||||
|
|
Загрузка…
Ссылка в новой задаче