From a79c18bf0793357d92f3fa05bea9c2df500eafa3 Mon Sep 17 00:00:00 2001 From: Mark Finkle Date: Thu, 16 Dec 2010 18:15:55 -0500 Subject: [PATCH] Bug 619764 - Fennec content process crash reporter UI does not respect MOZ_CRASHREPORTER_NO_REPORT [r=vingtetun] --- mobile/chrome/content/browser.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/mobile/chrome/content/browser.js b/mobile/chrome/content/browser.js index afba71736692..2766b3956db8 100644 --- a/mobile/chrome/content/browser.js +++ b/mobile/chrome/content/browser.js @@ -2200,7 +2200,18 @@ var ContentCrashObserver = { if (!aSubject.QueryInterface(Ci.nsIPropertyBag2).hasKey("abnormal")) return; - let dumpID = aSubject.hasKey("dumpID") ? aSubject.getProperty("dumpID") : null; + // See if we should hide the UI or auto close the app based on env vars + let env = Cc["@mozilla.org/process/environment;1"].getService(Ci.nsIEnvironment); + let shutdown = env.get("MOZ_CRASHREPORTER_SHUTDOWN"); + if (shutdown) { + let appStartup = Cc["@mozilla.org/toolkit/app-startup;1"].getService(Ci.nsIAppStartup); + appStartup.quit(Ci.nsIAppStartup.eForceQuit); + return; + } + + let hideUI = env.get("MOZ_CRASHREPORTER_NO_REPORT"); + if (hideUI) + return; // Spin through the open tabs and resurrect the out-of-process tabs. Resurrection // does not auto-reload the content. We delay load the content as needed. @@ -2209,6 +2220,8 @@ var ContentCrashObserver = { aTab.resurrect(); }) + let dumpID = aSubject.hasKey("dumpID") ? aSubject.getProperty("dumpID") : null; + // Execute the UI prompt after the notification has had a chance to return and close the child process setTimeout(function(self) { // Ask the user if we should reload or close the current tab. Other tabs