Bug 1334228 - Add separate assertions for message channels that haven't been opened. r=kanru
MozReview-Commit-ID: KqNdMEPieCk
--- a/ipc/glue/MessageChannel.h
+++ b/ipc/glue/MessageChannel.h
@@ -430,25 +430,27 @@ class MessageChannel : HasResultCodes
// Run on the not current thread.
void NotifyChannelClosed();
void NotifyMaybeChannelError();
private:
// Can be run on either thread
void AssertWorkerThread() const
{
+ MOZ_ASSERT(mWorkerLoopID != -1, "Channel hasn't been opened yet");
MOZ_RELEASE_ASSERT(mWorkerLoopID == MessageLoop::current()->id(),
"not on worker thread!");
}
// The "link" thread is either the I/O thread (ProcessLink) or the
// other actor's work thread (ThreadLink). In either case, it is
// NOT our worker thread.
void AssertLinkThread() const
{
+ MOZ_ASSERT(mWorkerLoopID != -1, "Channel hasn't been opened yet");
MOZ_RELEASE_ASSERT(mWorkerLoopID != MessageLoop::current()->id(),
"on worker thread but should not be!");
}
private:
class MessageTask :
public CancelableRunnable,
public LinkedListElement<RefPtr<MessageTask>>,