Bug 1274404 - Annotate IPC message name and size when crashing due to message size. r=mccr8

This commit is contained in:
Eric Rahm 2016-05-20 14:30:39 -07:00
parent d6c154f454
commit ff177872a0

View File

@ -158,7 +158,12 @@ ProcessLink::EchoMessage(Message *msg)
void
ProcessLink::SendMessage(Message *msg)
{
MOZ_RELEASE_ASSERT(msg->size() < IPC::Channel::kMaximumMessageSize);
if (msg->size() > IPC::Channel::kMaximumMessageSize) {
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("IPCMessageName"), nsDependentCString(msg->name()));
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("IPCMessageSize"), nsPrintfCString("%d", msg->size()));
MOZ_CRASH("IPC message size is too large");
}
mChan->AssertWorkerThread();
mChan->mMonitor->AssertCurrentThreadOwns();