Bug 1177013 - Don't allow prio messages while dispatching sync messages (r=dvander)

This commit is contained in:
Bill McCloskey 2015-06-19 14:10:20 -07:00
parent 541869bf48
commit fe7eba5f60

View File

@ -795,6 +795,14 @@ MessageChannel::Send(Message* aMsg, Message* aReply)
return false;
}
if (DispatchingSyncMessagePriority() == IPC::Message::PRIORITY_NORMAL &&
aMsg->priority() > IPC::Message::PRIORITY_NORMAL)
{
// Don't allow sending CPOWs while we're dispatching a sync message.
// If you want to do that, use sendRpcMessage instead.
return false;
}
IPC_ASSERT(aMsg->is_sync(), "can only Send() sync messages here");
IPC_ASSERT(aMsg->priority() >= DispatchingSyncMessagePriority(),
"can't send sync message of a lesser priority than what's being dispatched");