mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 933821 - Replace IPC_ASSERT(MSG_ROUTING_NONE != msg->routing_id(), "need a route") with PrintMessageRouteError. r=bent
This commit is contained in:
parent
bbe2da67fa
commit
7929d92b91
@ -84,6 +84,15 @@ MessageChannel::~MessageChannel()
|
||||
Clear();
|
||||
}
|
||||
|
||||
static void
|
||||
PrintErrorMessage(Side side, const char* channelName, const char* msg)
|
||||
{
|
||||
const char *from = (side == ChildSide)
|
||||
? "Child"
|
||||
: ((side == ParentSide) ? "Parent" : "Unknown");
|
||||
printf_stderr("\n###!!! [%s][%s] Error: %s\n\n", from, channelName, msg);
|
||||
}
|
||||
|
||||
bool
|
||||
MessageChannel::Connected() const
|
||||
{
|
||||
@ -213,7 +222,10 @@ MessageChannel::Echo(Message* aMsg)
|
||||
nsAutoPtr<Message> msg(aMsg);
|
||||
AssertWorkerThread();
|
||||
mMonitor->AssertNotCurrentThreadOwns();
|
||||
IPC_ASSERT(MSG_ROUTING_NONE != msg->routing_id(), "need a route");
|
||||
if (MSG_ROUTING_NONE == msg->routing_id()) {
|
||||
ReportMessageRouteError("MessageChannel::Echo");
|
||||
return false;
|
||||
}
|
||||
|
||||
MonitorAutoLock lock(*mMonitor);
|
||||
|
||||
@ -235,7 +247,10 @@ MessageChannel::Send(Message* aMsg)
|
||||
nsAutoPtr<Message> msg(aMsg);
|
||||
AssertWorkerThread();
|
||||
mMonitor->AssertNotCurrentThreadOwns();
|
||||
IPC_ASSERT(MSG_ROUTING_NONE != msg->routing_id(), "need a route");
|
||||
if (MSG_ROUTING_NONE == msg->routing_id()) {
|
||||
ReportMessageRouteError("MessageChannel::Send");
|
||||
return false;
|
||||
}
|
||||
|
||||
MonitorAutoLock lock(*mMonitor);
|
||||
if (!Connected()) {
|
||||
@ -1254,14 +1269,11 @@ MessageChannel::DispatchOnChannelConnected(int32_t peer_pid)
|
||||
mListener->OnChannelConnected(peer_pid);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
PrintErrorMessage(Side side, const char* channelName, const char* msg)
|
||||
void
|
||||
MessageChannel::ReportMessageRouteError(const char* channelName) const
|
||||
{
|
||||
const char *from = (side == ChildSide)
|
||||
? "Child"
|
||||
: ((side == ParentSide) ? "Parent" : "Unknown");
|
||||
printf_stderr("\n###!!! [%s][%s] Error: %s\n\n", from, channelName, msg);
|
||||
PrintErrorMessage(mSide, channelName, "Need a route");
|
||||
mListener->OnProcessingError(MsgRouteError);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -169,6 +169,7 @@ class MessageChannel : HasResultCodes
|
||||
void PostErrorNotifyTask();
|
||||
void OnNotifyMaybeChannelError();
|
||||
void ReportConnectionError(const char* aChannelName) const;
|
||||
void ReportMessageRouteError(const char* channelName) const;
|
||||
bool MaybeHandleError(Result code, const char* channelName);
|
||||
|
||||
void Clear();
|
||||
|
Loading…
Reference in New Issue
Block a user