Bug 1124933 - Add a generic api for annotating KillHard calls. r=billm

This commit is contained in:
Jim Mathies 2015-02-03 05:59:10 -06:00
parent 9ffb3a022f
commit 78b2097606
2 changed files with 17 additions and 0 deletions

View File

@ -3013,6 +3013,11 @@ ContentParent::Observe(nsISupports* aSubject,
if (!result.IsEmpty()) {
pse->AddSubProfile(result.get());
}
if (IsKillHardAnnotationSet()) {
crashReporter->AnnotateCrashReport(
NS_LITERAL_CSTRING("kill_hard"),
GetKillHardAnnotation());
}
}
}
#endif

View File

@ -240,6 +240,16 @@ public:
*/
void KillHard();
/**
* API for adding a crash reporter annotation that provides a reason
* for a listener request to abort the child.
*/
bool IsKillHardAnnotationSet() { return mKillHardAnnotation.IsEmpty(); }
const nsCString& GetKillHardAnnotation() { return mKillHardAnnotation; }
void SetKillHardAnnotation(const nsACString& aReason) {
mKillHardAnnotation = aReason;
}
ContentParentId ChildID() MOZ_OVERRIDE { return mChildID; }
const nsString& AppManifestURL() const { return mAppManifestURL; }
@ -794,6 +804,8 @@ private:
nsString mAppManifestURL;
nsCString mKillHardAnnotation;
/**
* We cache mAppName instead of looking it up using mAppManifestURL when we
* need it because it turns out that getting an app from the apps service is