mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 910962 - Make DeallocShmem not assert when child has crashed (r=bsmedberg)
This commit is contained in:
parent
af4001ab84
commit
671c3d615a
2
CLOBBER
2
CLOBBER
@ -22,4 +22,4 @@
|
||||
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
|
||||
# don't change CLOBBER for WebIDL changes any more.
|
||||
|
||||
bug 960811 - clobber to rebuild preprocessed files when enabling synthetic APKs
|
||||
Bug 925536 - Changing ipc/ipdl/ipdl/lower.py requires a clobber.
|
||||
|
@ -252,6 +252,13 @@ MessageChannel::Connected() const
|
||||
return (ChannelOpening == mChannelState || ChannelConnected == mChannelState);
|
||||
}
|
||||
|
||||
bool
|
||||
MessageChannel::CanSend() const
|
||||
{
|
||||
MonitorAutoLock lock(*mMonitor);
|
||||
return Connected();
|
||||
}
|
||||
|
||||
void
|
||||
MessageChannel::Clear()
|
||||
{
|
||||
|
@ -94,6 +94,8 @@ class MessageChannel : HasResultCodes
|
||||
// Make an Interrupt call to the other side of the channel
|
||||
bool Call(Message* aMsg, Message* aReply);
|
||||
|
||||
bool CanSend() const;
|
||||
|
||||
void SetReplyTimeoutMs(int32_t aTimeoutMs);
|
||||
|
||||
bool IsOnCxxStack() const {
|
||||
|
@ -3706,6 +3706,10 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
|
||||
# Message descriptor = UnShare(subprocess, mId, descriptor)
|
||||
# mShmemMap.Remove(id)
|
||||
# Shmem::Dealloc(rawmem)
|
||||
# if (!mChannel.CanSend()) {
|
||||
# delete descriptor;
|
||||
# return true;
|
||||
# }
|
||||
# return descriptor && Send(descriptor)
|
||||
destroyshmem.addstmts([
|
||||
StmtDecl(Decl(_shmemIdType(), idvar.name),
|
||||
@ -3716,8 +3720,14 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
|
||||
|
||||
failif = StmtIf(ExprNot(rawvar))
|
||||
failif.addifstmt(StmtReturn.FALSE)
|
||||
cansend = ExprCall(ExprSelect(p.channelVar(), '.', 'CanSend'), [])
|
||||
returnif = StmtIf(ExprNot(cansend))
|
||||
returnif.addifstmts([
|
||||
StmtExpr(ExprDelete(descriptorvar)),
|
||||
StmtReturn.TRUE])
|
||||
destroyshmem.addstmts([
|
||||
failif,
|
||||
Whitespace.NL,
|
||||
StmtDecl(Decl(Type('Message', ptr=1), descriptorvar.name),
|
||||
init=_shmemUnshareFrom(
|
||||
shmemvar,
|
||||
@ -3727,6 +3737,8 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
|
||||
StmtExpr(p.removeShmemId(idvar)),
|
||||
StmtExpr(_shmemDealloc(rawvar)),
|
||||
Whitespace.NL,
|
||||
returnif,
|
||||
Whitespace.NL,
|
||||
StmtReturn(ExprBinary(
|
||||
descriptorvar, '&&',
|
||||
ExprCall(
|
||||
|
Loading…
Reference in New Issue
Block a user