Bug 1423261: Diagnostics patch to obtain more info about the IPC channel state when we expect it to be closed. r=jimm

This commit is contained in:
Stephen A Pohl 2018-03-01 11:41:34 -05:00
Родитель c2e89ca6b0
Коммит 562c70ab11
1 изменённых файлов: 24 добавлений и 1 удалений

Просмотреть файл

@ -701,7 +701,30 @@ MessageChannel::Clear()
if (!Unsound_IsClosed()) {
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ProtocolName"),
nsDependentCString(mName));
MOZ_CRASH("MessageChannel destroyed without being closed");
switch (mChannelState) {
case ChannelOpening:
MOZ_CRASH("MessageChannel destroyed without being closed " \
"(mChannelState == ChannelOpening).");
break;
case ChannelConnected:
MOZ_CRASH("MessageChannel destroyed without being closed " \
"(mChannelState == ChannelConnected).");
break;
case ChannelTimeout:
MOZ_CRASH("MessageChannel destroyed without being closed " \
"(mChannelState == ChannelTimeout).");
break;
case ChannelClosing:
MOZ_CRASH("MessageChannel destroyed without being closed " \
"(mChannelState == ChannelClosing).");
break;
case ChannelError:
MOZ_CRASH("MessageChannel destroyed without being closed " \
"(mChannelState == ChannelError).");
break;
default:
MOZ_CRASH("MessageChannel destroyed without being closed.");
}
}
#endif