Bug 1240985 - Check WasTransactionCanceled after timeout (and avoid timing out) (r=dvander)

This commit is contained in:
Bill McCloskey 2016-01-22 20:32:50 -08:00
Родитель 3e1276dc1a
Коммит 004730c364
1 изменённых файлов: 9 добавлений и 6 удалений

Просмотреть файл

@ -1009,12 +1009,15 @@ MessageChannel::Send(Message* aMsg, Message* aReply)
// if neither side has any other message Sends on the stack). // if neither side has any other message Sends on the stack).
bool canTimeOut = transaction == seqno; bool canTimeOut = transaction == seqno;
if (maybeTimedOut && canTimeOut && !ShouldContinueFromTimeout()) { if (maybeTimedOut && canTimeOut && !ShouldContinueFromTimeout()) {
IPC_LOG("Timing out Send: xid=%d", transaction); // Since ShouldContinueFromTimeout drops the lock, we need to
// re-check all our conditions here. We shouldn't time out if any of
// We might have received a reply during WaitForSyncNotify or inside // these things happen because there won't be a reply to the timed
// ShouldContinueFromTimeout (which drops the lock). We need to make // out message in these cases.
// sure not to set mTimedOutMessageSeqno if that happens, since then if (WasTransactionCanceled(transaction)) {
// there would be no way to unset it. IPC_LOG("Other side canceled seqno=%d, xid=%d", seqno, transaction);
mLastSendError = SyncSendError::CancelledAfterSend;
return false;
}
if (mRecvdErrors) { if (mRecvdErrors) {
mRecvdErrors--; mRecvdErrors--;
mLastSendError = SyncSendError::ReplyError; mLastSendError = SyncSendError::ReplyError;