Bug 942118 - Ensure that we call MessageChannel::ReportConnectionError() with no lock. r=bent

Making a call to mListener with a mMonitor lock is bad. Most of the code
path for ReportConnectionError() are doing this because they are just
after the Connected() method which needs the lock. We ensure to unlock
mMonitor in the scope of the ReportConnectionError() call.
This commit is contained in:
Alexandre Lissy 2013-11-22 17:29:25 +01:00
parent fd1ab57ebe
commit 219a43e8f8

View File

@ -1285,6 +1285,9 @@ MessageChannel::ReportMessageRouteError(const char* channelName) const
void
MessageChannel::ReportConnectionError(const char* aChannelName) const
{
AssertWorkerThread();
mMonitor->AssertCurrentThreadOwns();
const char* errorMsg = nullptr;
switch (mChannelState) {
case ChannelClosed:
@ -1308,6 +1311,8 @@ MessageChannel::ReportConnectionError(const char* aChannelName) const
}
PrintErrorMessage(mSide, aChannelName, errorMsg);
MonitorAutoUnlock unlock(*mMonitor);
mListener->OnProcessingError(MsgDropped);
}