Bug 1322758 - Stop decrementing ProfileGatherer counter when receiving an exit profile. r?mstange
For some reason, we were decrementing the ProfileGatherer's mPendingProfiles
when receiving an "exit profile". An exit profile is handed over by a subprocess
parent actor, but in order to have that exit profile, the content process
_must_ have sent it up to the parent already, and that means that the counter
had alreay been decremented on its receipt.
This means that if the subprocess parent actor exited, it'd decrement
the counter twice, which means that we open ourselves up for missing out
on profiles that haven't yet reached the parent.
I can't think of a good reason why we'd want to decrement the counter
when storing an exit profile, so I've just removed that bit.
MozReview-Commit-ID: 8jSqtpYbXh0
--- a/tools/profiler/gecko/ProfileGatherer.cpp
+++ b/tools/profiler/gecko/ProfileGatherer.cpp
@@ -230,22 +230,16 @@ ProfileGatherer::Cancel()
void
ProfileGatherer::OOPExitProfile(const nsCString& aProfile)
{
if (mExitProfiles.Length() >= MAX_SUBPROCESS_EXIT_PROFILES) {
mExitProfiles.RemoveElementAt(0);
}
mExitProfiles.AppendElement(aProfile);
-
- // If a process exited while gathering, we need to make
- // sure we decrement the counter.
- if (mGathering) {
- GatheredOOPProfile();
- }
}
NS_IMETHODIMP
ProfileGatherer::Observe(nsISupports* aSubject,
const char* aTopic,
const char16_t *someData)
{
if (!strcmp(aTopic, "profiler-subprocess")) {