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
Родитель 4445fe5a1f
Коммит d48c62bedf
2 изменённых файлов: 20 добавлений и 0 удалений

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

@ -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");

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

@ -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();