Bug 773892 - Part 1: Add crash submission when starting b2g. r=ted

--HG--
extra : rebase_source : 48289cfd83479d98c169bdee564e5bae8775391f
This commit is contained in:
Hub Figuière 2012-07-18 14:40:24 -07:00
parent 4445fe5a1f
commit d48c62bedf
2 changed files with 20 additions and 0 deletions

View File

@ -198,6 +198,8 @@ pref("app.privacyURL", "http://www.mozilla.com/%LOCALE%/m/privacy.html");
pref("app.creditsURL", "http://www.mozilla.org/credits/");
pref("app.featuresURL", "http://www.mozilla.com/%LOCALE%/b2g/features/");
pref("app.faqURL", "http://www.mozilla.com/%LOCALE%/b2g/faq/");
// Whether we want to report crashes (headless)
pref("app.reportCrashes", true);
// Name of alternate about: page for certificate errors (when undefined, defaults to about:neterror)
pref("security.alternate_certificate_error_page", "certerror");

View File

@ -74,6 +74,22 @@ function addPermissions(urls) {
}
var shell = {
get CrashSubmit() {
delete this.CrashSubmit;
Cu.import("resource://gre/modules/CrashSubmit.jsm", this);
return this.CrashSubmit;
},
reportCrash: function shell_reportCrash() {
let crashID = Cc["@mozilla.org/xre/app-info;1"]
.getService(Ci.nsIXULRuntime).lastRunCrashID;
if (Services.prefs.getBoolPref('app.reportCrashes') &&
crashID) {
this.CrashSubmit().submit(crashID)
}
},
get contentBrowser() {
delete this.contentBrowser;
return this.contentBrowser = document.getElementById('homescreen');
@ -270,6 +286,8 @@ var shell = {
this.contentBrowser.removeEventListener('mozbrowserloadstart', this, true);
this.reportCrash();
let chromeWindow = window.QueryInterface(Ci.nsIDOMChromeWindow);
chromeWindow.browserDOMWindow = new nsBrowserAccess();