Bug 777185 - Hookup content process crash reporting. r=fabrice

--HG--
extra : rebase_source : fa1f24733b506994624ece032921125a2e2b1434
This commit is contained in:
Hubert Figuière 2012-10-11 16:18:00 +02:00
parent 9b9179d8dc
commit abfecd99d7

View File

@ -80,11 +80,12 @@ var shell = {
return this.CrashSubmit;
},
reportCrash: function shell_reportCrash() {
let crashID;
reportCrash: function shell_reportCrash(aCrashID) {
let crashID = aCrashID;
try {
crashID = Cc["@mozilla.org/xre/app-info;1"]
.getService(Ci.nsIXULRuntime).lastRunCrashID;
if (crashID == undefined || crashID == "")
crashID = Cc["@mozilla.org/xre/app-info;1"]
.getService(Ci.nsIXULRuntime).lastRunCrashID;
} catch(e) { }
if (Services.prefs.getBoolPref('app.reportCrashes') &&
crashID) {
@ -775,6 +776,18 @@ window.addEventListener('ContentStart', function ss_onContentStart() {
});
});
(function contentCrashTracker() {
Services.obs.addObserver(function(aSubject, aTopic, aData) {
let cs = Cc["@mozilla.org/consoleservice;1"]
.getService(Ci.nsIConsoleService);
let props = aSubject.QueryInterface(Ci.nsIPropertyBag2);
if (props.hasKey("abnormal") && props.hasKey("dumpID")) {
shell.reportCrash(props.getProperty("dumpID"));
}
},
"ipc:content-shutdown", false);
})();
(function geolocationStatusTracker() {
let gGeolocationActiveCount = 0;