Bug 1367591 - Process gDelayedAnnotations on Windows and Mac as well, not just on Linux. r=jdm

MozReview-Commit-ID: LQrU8NTdj7V

--HG--
extra : rebase_source : 61b49accf70bac556f3e8a813e985ae71bd25b48
This commit is contained in:
Markus Stange 2017-05-28 22:30:22 -04:00
Родитель 81f9096e52
Коммит 482d9344e2
1 изменённых файлов: 15 добавлений и 7 удалений

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

@ -2333,6 +2333,18 @@ EnqueueDelayedNote(DelayedNote* aNote)
gDelayedAnnotations->AppendElement(aNote);
}
static void
RunAndCleanUpDelayedNotes()
{
if (gDelayedAnnotations) {
for (nsAutoPtr<DelayedNote>& note : *gDelayedAnnotations) {
note->Run();
}
delete gDelayedAnnotations;
gDelayedAnnotations = nullptr;
}
}
nsresult AnnotateCrashReport(const nsACString& key, const nsACString& data)
{
if (!GetEnabled())
@ -3812,6 +3824,7 @@ SetRemoteExceptionHandler(const nsACString& crashPipe)
NS_ConvertASCIItoUTF16(crashPipe).get(),
nullptr);
gExceptionHandler->set_handle_debug_exceptions(true);
RunAndCleanUpDelayedNotes();
#ifdef _WIN64
SetJitExceptionHandler();
@ -3862,13 +3875,7 @@ SetRemoteExceptionHandler()
nullptr, // no callback context
true, // install signal handlers
gMagicChildCrashReportFd);
if (gDelayedAnnotations) {
for (uint32_t i = 0; i < gDelayedAnnotations->Length(); i++) {
gDelayedAnnotations->ElementAt(i)->Run();
}
delete gDelayedAnnotations;
}
RunAndCleanUpDelayedNotes();
mozalloc_set_oom_abort_handler(AnnotateOOMAllocationSize);
@ -3897,6 +3904,7 @@ SetRemoteExceptionHandler(const nsACString& crashPipe)
nullptr, // no callback context
true, // install signal handlers
crashPipe.BeginReading());
RunAndCleanUpDelayedNotes();
mozalloc_set_oom_abort_handler(AnnotateOOMAllocationSize);